Merge "Added Update and Remove commands code"
authorSam Hague <shague@redhat.com>
Mon, 30 Nov 2015 16:18:26 +0000 (16:18 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 30 Nov 2015 16:18:26 +0000 (16:18 +0000)
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java
resources/commons/Ovsdb-HwvtepSouthbound-Collection.json.postman_collection
utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java

index f5a65294c4dae0e1ca9bc61f62a3b433f8197ab6..8b47a8f6a1005a142020c63d110325e33ffb4c80 100644 (file)
@@ -334,7 +334,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
     }
 
     private String connectionInfoToString(final ConnectionInfo connectionInfo) {
-        return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+        return String.valueOf(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
     }
 
     private boolean addOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException {
@@ -440,7 +440,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
                         } else if (tokens[0].equalsIgnoreCase("ptcp")) {
                             ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
                             if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
-                                controllerIpStr = new String(connectionInfo.getLocalIp().getValue());
+                                controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
                                 controllersStr.add(Constants.OPENFLOW_CONNECTION_PROTOCOL
                                         + ":" + controllerIpStr + ":" + Constants.OPENFLOW_PORT);
                             } else {
index 7c7f43493c0dfd691cb1b74459d6b0b2fa34ddc2..33a9d7b7813dc5a17eff7b418ac10cc470584f71 100644 (file)
@@ -125,7 +125,7 @@ public class SouthboundMapper {
 
     public static NodeId createNodeId(IpAddress ip, PortNumber port) {
         String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
-                + new String(ip.getValue()) + ":" + port.getValue();
+                + String.valueOf(ip.getValue()) + ":" + port.getValue();
         Uri uri = new Uri(uriString);
         return new NodeId(uri);
     }
index 947dcec1f3d8211f94d7796df07e0985a468745f..d3357053d1e7ebf0738ba3c1753da5d14d7fa69b 100644 (file)
@@ -68,11 +68,8 @@ public class SfcClassifierService extends AbstractServiceInstance implements Con
 
     }
 
-    //private AtomicLong flowCookieInc = new AtomicLong(0x1L);
     private BigInteger getCookie(FlowID flowID) {
-        String cookieString = new String().format("1110%02d%010d", flowID.value, cookieIndex++);
-                //new String().format("1100%02d00%04d", flowID.value, flowCookieInc.getAndIncrement());
-                // "1100%02000000d%04d"
+        String cookieString = String.format("1110%02d%010d", flowID.value, cookieIndex++);
         return new BigInteger(cookieString, 16);
     }
 
index 3a3ea5dc38847e92cf272340ded4d4327c8a09eb..d59f53601734280d497669f225369496a3d40f84 100644 (file)
@@ -561,7 +561,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                         } else if (tokens[0].equalsIgnoreCase("ptcp")) {
                             ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
                             if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
-                                controllerIpStr = new String(connectionInfo.getLocalIp().getValue());
+                                controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
                                 controllersStr.add(Constants.OPENFLOW_CONNECTION_PROTOCOL
                                         + ":" + controllerIpStr + ":" + Constants.OPENFLOW_PORT);
                             } else {
index 45fd82f5f1f9e5c1c2fed7421fefadd7fc4cdf44..524fa8b1dc080c27b5d334e23630b2a1a8800695 100755 (executable)
@@ -29,7 +29,7 @@
             "id":"18032e93-3bc5-9976-4525-fe1e77e98207",
             "name":"Delete Specific Config Logical Switch",
             "description":"This restconf request delete specific logical switch from the config data store.",
-            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Flogicalswitch%2Fls0",
+            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
             "method":"DELETE",
             "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
             "data":[],
             "id":"538c71b3-e3e6-f01b-cc4c-d2b686686aa8",
             "name":"Get Specific Operational Logical Switch",
             "description":"This restconf request fetch the operational for specific Logical Switch",
-            "url":"http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2logicalswitch%2ls0",
+            "url":"http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
             "method":"GET",
             "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"hwvtep-node-name\": \"ls0\",\n            \"tunnel-key\": \"10000\"\n        }\n    ]\n}",
+            "data":[],
             "dataMode":"raw",
             "timestamp":0,
             "version":2,
             "id":"9bc22ca7-049c-af51-7c12-6bf71044b2ec",
             "name":"Create Specific Config Logical Switch",
             "description":"Fire this Restconf request if you want to create a logical switch.",
-            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/",
+            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640",
             "method":"POST",
             "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"hwvtep-node-name\": \"ls0\",\n            \"tunnel-key\": \"10000\",\n            \"managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='hwvtep:1']/network-topology:node[network-topology:node-id='hwvtep://{{hwvtepNodeIp}}:6640']\"             \n        }\n    ]\n}",
+            "data":"{\n  \"logical-switches\": [\n        {\n            \"hwvtep-node-name\": \"ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"tunnel-key\": \"10000\"\n         }\n    ]\n}",
             "dataMode":"raw",
             "timestamp":0,
             "version":2,
             "url":"http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640",
             "method":"GET",
             "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"hwvtep-node-name\": \"ls0\",\n            \"tunnel-key\": \"10000\"\n        }\n    ]\n}",
+            "data":[],
             "dataMode":"raw",
             "timestamp":0,
             "version":2,
         {
             "collectionId":"19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
             "id":"f6d300f7-380a-d090-0d4a-2b2ddefe5104",
-            "name":"Create Specific Config Logical Switch",
+            "name":"Update Specific Config Logical Switch",
             "description":"Fire this request if you want to update specific logical switch.",
-            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Flogicalswitch%2Fls0",
+            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
             "method":"PUT",
             "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"hwvtep-node-name\": \"ls0\",\n            \"tunnel-key\": \"10000\",\n            \"managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='hwvtep:1']/network-topology:node[network-topology:node-id='hwvtep://{{hwvtepNodeIp}}:6640']\"             \n        }\n    ]\n}",
+            "data":"{\n  \"logical-switches\": [\n        {\n            \"hwvtep-node-name\": \"ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"tunnel-key\": \"10000\"\n         }\n    ]\n}",
             "dataMode":"raw",
             "timestamp":0,
             "version":2,
             "id":"f9f71d74-a49d-b190-d929-b6772ce0ba73",
             "name":"Get Specific Config Logical Switch",
             "description":"This restconf request fetch configuration for specific logical switch.",
-            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Flogicalswitch%2Fls0",
+            "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
             "method":"GET",
             "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n            \"hwvtep-node-description\": \"\",\n            \"hwvtep-node-name\": \"ls0\",\n            \"tunnel-key\": \"10000\"\n        }\n    ]\n}",
+            "data":[],
             "dataMode":"raw",
             "timestamp":0,
             "version":2,
index 9111acc92e35f5b81e5b8e7873461039f6d52bfa..978c5223b5384d2c8a330abc6c4bc6885742d1e6 100644 (file)
@@ -86,7 +86,7 @@ public class SouthboundUtils {
 
     public NodeId createNodeId(IpAddress ip, PortNumber port) {
         String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
-                + new String(ip.getValue()) + ":" + port.getValue();
+                + String.valueOf(ip.getValue()) + ":" + port.getValue();
         Uri uri = new Uri(uriString);
         return new NodeId(uri);
     }
@@ -168,7 +168,8 @@ public class SouthboundUtils {
     }
 
     public String connectionInfoToString(final ConnectionInfo connectionInfo) {
-        return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+        return String.valueOf(
+                connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
     }
 
     public boolean addOvsdbNode(final ConnectionInfo connectionInfo) {