From: Sam Hague Date: Mon, 30 Nov 2015 16:18:26 +0000 (+0000) Subject: Merge "Added Update and Remove commands code" X-Git-Tag: release/beryllium-sr2~249 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=f4f9e638b5b42e7d9c8c4815f91a8d876fe320cf;hp=43fdf79f6ec610eb5f70cba880304c4cb9109848;p=netvirt.git Merge "Added Update and Remove commands code" --- diff --git a/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java b/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java index f5a65294c4..8b47a8f6a1 100644 --- a/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java +++ b/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java @@ -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 { diff --git a/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java b/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java index 7c7f43493c..33a9d7b781 100644 --- a/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java +++ b/openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/SouthboundMapper.java @@ -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); } diff --git a/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java b/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java index 947dcec1f3..d3357053d1 100644 --- a/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java +++ b/openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java @@ -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); } diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java index 3a3ea5dc38..d59f536017 100644 --- a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java +++ b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java @@ -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 { diff --git a/resources/commons/Ovsdb-HwvtepSouthbound-Collection.json.postman_collection b/resources/commons/Ovsdb-HwvtepSouthbound-Collection.json.postman_collection index 45fd82f5f1..524fa8b1dc 100755 --- a/resources/commons/Ovsdb-HwvtepSouthbound-Collection.json.postman_collection +++ b/resources/commons/Ovsdb-HwvtepSouthbound-Collection.json.postman_collection @@ -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":[], @@ -56,10 +56,10 @@ "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, @@ -112,10 +112,10 @@ "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, @@ -143,7 +143,7 @@ "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, @@ -193,12 +193,12 @@ { "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, @@ -209,10 +209,10 @@ "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, diff --git a/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java b/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java index 9111acc92e..978c5223b5 100644 --- a/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java +++ b/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java @@ -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) {