routing manager version 0.3.2

- version 0.3.2 updated

Change-Id: I3c99c9d3f48d2f74ba829a53e0f9a1391ea2661b
Signed-off-by: 1000044 <gergo.mocsi@nokia.com>
diff --git a/pkg/nbi/httprestful.go b/pkg/nbi/httprestful.go
index 4b936a6..035501a 100644
--- a/pkg/nbi/httprestful.go
+++ b/pkg/nbi/httprestful.go
@@ -77,7 +77,7 @@
 	}
 	if nil != xappData {
                 var xapps []rtmgr.XApp
-                err := json.Unmarshal([]byte(xappData.Data), &xapps)
+                err := json.Unmarshal([]byte(xappData.XApps), &xapps)
 		return &xapps, err
 	} else {
 		rtmgr.Logger.Info("No data")
@@ -89,11 +89,11 @@
 }
 
 func validateXappCallbackData(callbackData *models.XappCallbackData) error {
-	if len(callbackData.Data) == 0 {
-		return fmt.Errorf("Invalid Data field: \"%s\"", callbackData.Data)
+	if len(callbackData.XApps) == 0 {
+		return fmt.Errorf("Invalid Data field: \"%s\"", callbackData.XApps)
 	}
 	var xapps []rtmgr.XApp
-        err := json.Unmarshal([]byte(callbackData.Data), &xapps)
+        err := json.Unmarshal([]byte(callbackData.XApps), &xapps)
         if err != nil {
 		return fmt.Errorf("Unmarshal failed: \"%s\"", err.Error())
 	}
diff --git a/pkg/nbi/httprestful_test.go b/pkg/nbi/httprestful_test.go
index 137e75b..ecf0c2e 100644
--- a/pkg/nbi/httprestful_test.go
+++ b/pkg/nbi/httprestful_test.go
@@ -96,8 +96,8 @@
 
 func TestRecvXappCallbackData(t *testing.T) {
 	data := models.XappCallbackData {
-                Data: *swag.String("[]"),
-                DataVersion: *swag.Int64(1),
+                XApps: *swag.String("[]"),
+                Version: *swag.Int64(1),
                 Event: *swag.String("any"),
                 ID: *swag.Int64(123456),
 	}
@@ -124,8 +124,8 @@
 	datach := make(chan *models.XappCallbackData, 10)
 	defer close(datach)
 	data := models.XappCallbackData{
-		Data: *swag.String("[]"),
-		DataVersion: *swag.Int64(1),
+		XApps: *swag.String("[]"),
+		Version: *swag.Int64(1),
 		Event: *swag.String("someevent"),
 		ID: *swag.Int64(123456)}
 	var httpRestful, _ = GetNbi("httpRESTful")
@@ -146,8 +146,8 @@
 
 func TestValidateXappCallbackData(t *testing.T) {
         data := models.XappCallbackData{
-                Data: *swag.String("[]"),
-                DataVersion: *swag.Int64(1),
+                XApps: *swag.String("[]"),
+                Version: *swag.Int64(1),
                 Event: *swag.String("someevent"),
                 ID: *swag.Int64(123456)}
 
@@ -159,8 +159,8 @@
 
 func TestValidateXappCallbackDataWithInvalidData(t *testing.T) {
         data := models.XappCallbackData{
-                Data: *swag.String("{}"),
-                DataVersion: *swag.Int64(1),
+                XApps: *swag.String("{}"),
+                Version: *swag.Int64(1),
                 Event: *swag.String("someevent"),
                 ID: *swag.Int64(123456)}
 
diff --git a/pkg/nbi/nbi.go b/pkg/nbi/nbi.go
index bb0f485..1e2a8d3 100644
--- a/pkg/nbi/nbi.go
+++ b/pkg/nbi/nbi.go
@@ -98,7 +98,7 @@
         client := apiclient.New(transport, strfmt.Default)
         addSubParams := operations.NewAddSubscriptionParamsWithTimeout(10 * time.Second)
         // create sub req with rest url and port
-        subReq := CreateSubReq(nbiifUrl.Hostname(), nbiifUrl.Port())
+        subReq := CreateSubReq(string(nbiifUrl.Scheme+"://"+nbiifUrl.Hostname()), nbiifUrl.Port())
         resp, postErr := client.Operations.AddSubscription(addSubParams.WithSubscriptionRequest(subReq))
         if postErr != nil {
                 rtmgr.Logger.Error("POST unsuccessful:"+postErr.Error())
diff --git a/pkg/rpe/rmr.go b/pkg/rpe/rmr.go
index 41c1c4c..9cda9d9 100644
--- a/pkg/rpe/rmr.go
+++ b/pkg/rpe/rmr.go
@@ -59,13 +59,7 @@
 	rawrt := []string{key + "newrt|start\n"}
 	rt := r.getRouteTable(eps)
 	for _, rte := range *rt {
-		rawrte := key //+ "rte|" + rte.MessageType
-		if rte.SubID == -1 {
-			rawrte += "rte|"
-		} else {
-			rawrte += "mse|"
-		}
-		rawrte += rte.MessageType
+		rawrte := key + "mse|" + rte.MessageType
 		for _, tx := range rte.TxList {
 			rawrte += "," + tx.Ip + ":" + strconv.Itoa(int(tx.Port))
 		}