Introducing ConnectionInfo 29/18229/1
authorEd Warnicke <eaw@cisco.com>
Mon, 13 Apr 2015 23:38:50 +0000 (16:38 -0700)
committerEd Warnicke <eaw@cisco.com>
Mon, 13 Apr 2015 23:44:03 +0000 (16:44 -0700)
Added a ConnectionInfo with remote/local ip/port to
the model.

Change-Id: I77fc3d8f9efbce0a07fc8106ec0487eeca4e09e6
Signed-off-by: Ed Warnicke <eaw@cisco.com>
resources/commons/OVSDB_Southbound.postman_collection
southbound/southbound-api/src/main/yang/ovsdb.yang
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbClientKey.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManager.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListener.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/OvsdbNodeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OpenVSwitchUpdateCommand.java

index 5acbc093bea2dd348549f1750e0c106c96888461..b3a5225b5765ac507136b0b8e19aa5ad1538eeeb 100644 (file)
-{    "id":"7969e460-82a6-c628-3921-c8b2f833cf20",
-    "name":"Ovsdb Southbound Collection",
-    "timestamp":1424977469540,
-    "order":[        "d358f955-9aaa-35a4-0f05-e0e817d19fae",
-        "1a877c07-3c4e-5fa3-baa1-517d650e566f",
-        "0408246c-2f84-8cbd-3448-4da85c92c819",
-        "375116bc-3c00-ce41-766f-7670a4b5645b",
-        "ea3557d2-68ab-d3a3-9ed5-b7bf59c45cc5",
-        "2e6a0928-ebf5-63ca-5db6-23a85bf85e5f",
-        "997fc659-ba78-2621-9b7b-7b57f428fb1e",
-        "a01f6148-a8fd-e579-de7b-79fb490fa001",
-        "5e0fc988-e250-55d1-4411-fceabb459b3a"
-    ],
-    "owner":0,
-    "sharedWithTeam":false,
-    "synced":false,
-    "subscribed":false,
-    "hasRequests":true,
-    "requests":[        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"0408246c-2f84-8cbd-3448-4da85c92c819",
-            "name":"Create Specific Config Bridge",
-            "description":"This restconf request creates bridge on the specified ovsdb node.   Restconf URI contains node-id and this node-id has ip address and port. To determine the ip address and port information, fire \"Get Operational Topology\" restconf request and search for node where you want to create a bridge and then use the ip-address / port details from that output. Once you find out the ip-address/port, update the node-id and ovsdb:managed-by element in the restconf body.\n\n       Note: these %2F ('/') in the url are not there by mistake, those are there intentionally because node-id can contain '/'.\n\n    Note:Bridge name should not contain '-' in it, If you bridge name will contain '-', bridge creation will fail. It's know bug and under investigation.",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest",
-            "method":"PUT",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"ovsdb://10.10.10.10:22222/bridge/brtest\",\n             \"ovsdb:bridge-name\": \"brtest\",\n             \"ovsdb:datapath-id\": \"00:00:b2:bf:48:25:f2:4b\",\n             \"ovsdb:protocol-entry\": [\n                {\n                  \"protocol\": \"ovsdb:ovsdb-bridge-protocol-openflow-13\"\n                }\n              ],\n              \"ovsdb:controller-entry\": [\n                {\n                  \"target\": \"tcp:11.11.11.11:6633\"\n                }\n              ],\n             \"ovsdb:managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb://10.10.10.10:22222']\"\n        }\n    ]\n}",
-            "dataMode":"raw",
-            "timestamp":0,
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"1a877c07-3c4e-5fa3-baa1-517d650e566f",
-            "name":"Get Operational Topology",
-            "description":"This restconf request will fetch the operational topology. Operational topology details are fetch by southbound plugin from all the connected ovsdb node.",
-            "url":"http://localhost:8080/restconf/operational/network-topology:network-topology/",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":[
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-            ],
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"2e6a0928-ebf5-63ca-5db6-23a85bf85e5f",
-            "name":"Get Specific Config OvsdbNode",
-            "description":"This restconf request fetch the configuration for specific node (ovsdb node or bridge node)",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":[
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"375116bc-3c00-ce41-766f-7670a4b5645b",
-            "name":"Delete Specific Config OvsdbNode",
-            "description":"This restconf request delete any node (ovsdb node or bridge node) from the config data store. You can use the same request to delete the ovsdb node by using the following URI: http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest",
-            "method":"DELETE",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":[
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"5e0fc988-e250-55d1-4411-fceabb459b3a",
-            "name":"Get Specific Config Termination Point",
-            "description":"Fetch configuration for specific termination point of the bridge from config data store.",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest/termination-point/vxlanport/",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":[
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"997fc659-ba78-2621-9b7b-7b57f428fb1e",
-            "name":"Create Specific Config Termination Point",
-            "description":"This restconf request creates port/interface and attach it to specific bridge. Using ovsdb:option, you can pass the optional input to port/interface create optional. E.g. remote_ip=xx.xx.xx.xx.",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest/termination-point/vxlanport/",
-            "method":"PUT",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\nAccept: application/json\n",
-            "data":"{\n  \"network-topology:termination-point\": [\n    \t{\n  \t\t\t\"ovsdb:options\": [\n    \t\t\t{\n                  \"ovsdb:option\": \"remote_ip\",\n                  \"ovsdb:value\" : \"10.10.11.11\"\n\t\t    \t}\n\t  \t\t],\n\t  \t\t\"ovsdb:name\": \"vxlanport\",\n          \t\"ovsdb:interface-type\": \"ovsdb:interface-type-vxlan\",\n  \t\t\t\"tp-id\": \"vxlanport\",\n            \"vlan-tag\": \"1\",\n            \"trunks\": [\n                {\n                    \"trunk\": \"2\"\n                },\n                {\n                    \"trunk\": \"3\"\n                }\n            ],\n            \"vlan-mode\":\"access\"\n\t\t}\n    ]\n}",
-            "dataMode":"raw",
-            "timestamp":0,
-            "version":2,
-            "time":1428527877458
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"a01f6148-a8fd-e579-de7b-79fb490fa001",
-            "name":"Delete Specific ConfigTermination Point",
-            "description":"Delete configuration of specified termination point of bridge. ",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest/termination-point/vxlanport/",
-            "method":"DELETE",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":[
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"d358f955-9aaa-35a4-0f05-e0e817d19fae",
-            "name":"Create Specific Config OvsdbNode",
-            "description":"Fire this Restconf request if you want to initiate the connection to ovsdb node from controller. It assumes that ovsdb node is listening for tcp connection in passive mode. To configure the ovsdb node for listening incoming connection, please fire following command at ovsdb node machine\n\n\"ovs-vsctl set-manager tcp:16640\"",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:16640",
-            "method":"PUT",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
-            "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"ovsdb://10.10.10.10:16640\",\n            \"ovsdb:port\": 16640,\n            \"ovsdb:ip\": \"10.10.10.10\"\n        }\n    ]\n}",
-            "dataMode":"raw",
-            "timestamp":0,
-            "version":2
-        },
-        {            "collectionId":"7969e460-82a6-c628-3921-c8b2f833cf20",
-            "id":"ea3557d2-68ab-d3a3-9ed5-b7bf59c45cc5",
-            "name":"Get Config Topology",
-            "description":"Fetch the config topology from configuration data store.",
-            "url":"http://localhost:8080/restconf/config/network-topology:network-topology/",
-            "method":"GET",
-            "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
-            "data":[
-            ],
-            "dataMode":"params",
-            "timestamp":0,
-            "responses":[
-            ],
-            "version":2
-        }
-    ]
-}
\ No newline at end of file
+{
+   "id":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+   "name":"Ovsdb Southbound Collection",
+   "timestamp":1424977469540,
+   "order":[
+      "da6876b9-d594-5e41-80b0-858e5a6b40b8",
+      "f930747d-8044-d544-5e81-1c1a492c80a3",
+      "eaf0abfa-820e-e554-a5df-7ee96bc0ef6a",
+      "e9e14494-2ff0-4bfe-2854-6100b91832ff",
+      "37f0baee-75a7-6b2f-0890-2b5d125110bc",
+      "ec2b5fdd-dfef-ad11-40e9-c9bbe235e845",
+      "b9064b3d-351d-d529-dc3a-b7907c76f134",
+      "fe956461-edb8-90ad-b9bc-5e95951fa757",
+      "d67eac2b-f77c-6ea5-ecfc-dab88c428c88"
+   ],
+   "owner":0,
+   "sharedWithTeam":false,
+   "synced":false,
+   "subscribed":false,
+   "hasRequests":true,
+   "requests":[
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"37f0baee-75a7-6b2f-0890-2b5d125110bc",
+         "name":"Get Config Topology",
+         "description":"Fetch the config topology from configuration data store.",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/",
+         "method":"GET",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
+         "data":[
+
+         ],
+         "dataMode":"params",
+         "timestamp":0,
+         "responses":[
+
+         ],
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"b9064b3d-351d-d529-dc3a-b7907c76f134",
+         "name":"Create Specific Config Termination Point",
+         "description":"This restconf request creates port/interface and attach it to specific bridge. Using ovsdb:option, you can pass the optional input to port/interface create optional. E.g. remote_ip=xx.xx.xx.xx.",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest/termination-point/vxlanport/",
+         "method":"PUT",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\nAccept: application/json\n",
+         "data":"{\n  \"network-topology:termination-point\": [\n    \t{\n  \t\t\t\"ovsdb:options\": [\n    \t\t\t{\n                  \"ovsdb:option\": \"remote_ip\",\n                  \"ovsdb:value\" : \"10.10.11.11\"\n\t\t    \t}\n\t  \t\t],\n\t  \t\t\"ovsdb:name\": \"vxlanport\",\n          \t\"ovsdb:interface-type\": \"ovsdb:interface-type-vxlan\",\n  \t\t\t\"tp-id\": \"vxlanport\",\n            \"vlan-tag\": \"1\",\n            \"trunks\": [\n                {\n                    \"trunk\": \"2\"\n                },\n                {\n                    \"trunk\": \"3\"\n                }\n            ],\n            \"vlan-mode\":\"access\"\n\t\t}\n    ]\n}",
+         "dataMode":"raw",
+         "timestamp":0,
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"d67eac2b-f77c-6ea5-ecfc-dab88c428c88",
+         "name":"Get Specific Config Termination Point",
+         "description":"Fetch configuration for specific termination point of the bridge from config data store.",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest/termination-point/vxlanport/",
+         "method":"GET",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
+         "data":[
+
+         ],
+         "dataMode":"params",
+         "timestamp":0,
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"da6876b9-d594-5e41-80b0-858e5a6b40b8",
+         "name":"Create Specific Config OvsdbNode",
+         "description":"Fire this Restconf request if you want to initiate the connection to ovsdb node from controller. It assumes that ovsdb node is listening for tcp connection in passive mode. To configure the ovsdb node for listening incoming connection, please fire following command at ovsdb node machine\n\n\"ovs-vsctl set-manager tcp:16640\"",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:16640",
+         "method":"PUT",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+         "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"ovsdb://10.10.10.10:16640\",\n            \"connection-info\": {\n              \"ovsdb:remote-port\": 16640,\n              \"ovsdb:remote-ip\": \"127.0.0.1\"\n            }\n        }\n    ]\n}",
+         "dataMode":"raw",
+         "timestamp":0,
+         "version":2,
+         "time":1428968453378
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"e9e14494-2ff0-4bfe-2854-6100b91832ff",
+         "name":"Delete Specific Config OvsdbNode",
+         "description":"This restconf request delete any node (ovsdb node or bridge node) from the config data store. You can use the same request to delete the ovsdb node by using the following URI: http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest",
+         "method":"DELETE",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
+         "data":[
+
+         ],
+         "dataMode":"params",
+         "timestamp":0,
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"eaf0abfa-820e-e554-a5df-7ee96bc0ef6a",
+         "name":"Create Specific Config Bridge",
+         "description":"This restconf request creates bridge on the specified ovsdb node.   Restconf URI contains node-id and this node-id has ip address and port. To determine the ip address and port information, fire \"Get Operational Topology\" restconf request and search for node where you want to create a bridge and then use the ip-address / port details from that output. Once you find out the ip-address/port, update the node-id and ovsdb:managed-by element in the restconf body.\n\n       Note: these %2F ('/') in the url are not there by mistake, those are there intentionally because node-id can contain '/'.\n\n    Note:Bridge name should not contain '-' in it, If you bridge name will contain '-', bridge creation will fail. It's know bug and under investigation.",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest",
+         "method":"PUT",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+         "data":"{\n  \"network-topology:node\": [\n        {\n            \"node-id\": \"ovsdb://10.10.10.10:22222/bridge/brtest\",\n             \"ovsdb:bridge-name\": \"brtest\",\n             \"ovsdb:datapath-id\": \"00:00:b2:bf:48:25:f2:4b\",\n             \"ovsdb:protocol-entry\": [\n                {\n                  \"protocol\": \"ovsdb:ovsdb-bridge-protocol-openflow-13\"\n                }\n              ],\n              \"ovsdb:controller-entry\": [\n                {\n                  \"target\": \"tcp:11.11.11.11:6633\"\n                }\n              ],\n             \"ovsdb:managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='ovsdb:1']/network-topology:node[network-topology:node-id='ovsdb://10.10.10.10:22222']\"\n        }\n    ]\n}",
+         "dataMode":"raw",
+         "timestamp":0,
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"ec2b5fdd-dfef-ad11-40e9-c9bbe235e845",
+         "name":"Get Specific Config OvsdbNode",
+         "description":"This restconf request fetch the configuration for specific node (ovsdb node or bridge node)",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest",
+         "method":"GET",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
+         "data":[
+
+         ],
+         "dataMode":"params",
+         "timestamp":0,
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"f930747d-8044-d544-5e81-1c1a492c80a3",
+         "name":"Get Operational Topology",
+         "description":"This restconf request will fetch the operational topology. Operational topology details are fetch by southbound plugin from all the connected ovsdb node.",
+         "url":"http://localhost:8080/restconf/operational/network-topology:network-topology/",
+         "method":"GET",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
+         "data":[
+
+         ],
+         "dataMode":"params",
+         "timestamp":0,
+         "responses":[
+
+         ],
+         "version":2
+      },
+      {
+         "collectionId":"ebc00c37-8a7e-f980-5b19-3f62212c5a58",
+         "id":"fe956461-edb8-90ad-b9bc-5e95951fa757",
+         "name":"Delete Specific ConfigTermination Point",
+         "description":"Delete configuration of specified termination point of bridge. ",
+         "url":"http://localhost:8080/restconf/config/network-topology:network-topology/topology/ovsdb:1/node/ovsdb:%2F%2F10.10.10.10:22222%2Fbridge%2Fbrtest/termination-point/vxlanport/",
+         "method":"DELETE",
+         "headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
+         "data":[
+
+         ],
+         "dataMode":"params",
+         "timestamp":0,
+         "version":2
+      }
+   ]
+}
index f0aef64de1048b0694572d5d05fac8947537fec4..6f26912de19a465cfc982b261573662e8bc9cf3d 100755 (executable)
@@ -212,8 +212,29 @@ module ovsdb {
 
     }
 
+    grouping ovsdb-connection-info-attributes { 
+          leaf remote-ip {
+            type inet:ip-address;
+            description "Ovsdb Connection Remote IP";
+          }
+          leaf remote-port {
+            type inet:port-number;
+            description "Ovsdb Connection Remote Port Number";
+          }
+          leaf local-ip {
+            type inet:ip-address;
+            description "Ovsdb Connection Local IP";
+          }
+          leaf local-port {
+            type inet:port-number;
+            description "Ovsdb Connection Local Port Number IP";
+          }
+    }
+
     grouping ovsdb-node-attributes {
-        uses overlay:ip-port-locator;
+        container connection-info{
+            uses ovsdb-connection-info-attributes;
+        }
 
         leaf ovs-version {
             type string;
index 778ba1000bcdd46170da1e89b8b0858c373d6cdc..ffff1be45ca21791381b24b2f0a61ae004e32a8f 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.ovsdb.southbound;
 import org.opendaylight.ovsdb.lib.OvsdbClient;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.overlay.rev150105.IpPortLocator;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -22,9 +22,9 @@ public class OvsdbClientKey {
     private IpAddress ipaddress;
     private PortNumber port;
 
-    OvsdbClientKey(IpPortLocator locator) {
-        ipaddress = locator.getIp();
-        port = locator.getPort();
+    OvsdbClientKey(ConnectionInfo connectionInfo) {
+        ipaddress = connectionInfo.getRemoteIp();
+        port = connectionInfo.getRemotePort();
     }
 
     public OvsdbClientKey(IpAddress ip, PortNumber port) {
index 3017e9b8b19f8b0d20616c4cbbd14fdac0e87ace..7c92a78904b764ad3029d278fedfebefa39caffb 100644 (file)
@@ -21,10 +21,10 @@ import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
 import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
 import org.opendaylight.ovsdb.southbound.transactions.md.OvsdbNodeRemoveCommand;
 import org.opendaylight.ovsdb.southbound.transactions.md.TransactionInvoker;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.overlay.rev150105.IpPortLocator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAttributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
@@ -69,9 +69,9 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         // TODO handle case where we already have a connection
         // TODO use transaction chains to handle ordering issues between disconnected
         // and connected when writing to the operational store
-        InetAddress ip = SouthboundMapper.createInetAddress(ovsdbNode.getIp());
+        InetAddress ip = SouthboundMapper.createInetAddress(ovsdbNode.getConnectionInfo().getRemoteIp());
         OvsdbClient client = OvsdbConnectionService.getService().connect(ip,
-                ovsdbNode.getPort().getValue().intValue());
+                ovsdbNode.getConnectionInfo().getRemotePort().getValue().intValue());
         // For connections from the controller to the ovs instance, the library doesn't call
         // this method for us
         connected(client);
@@ -79,7 +79,8 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
     }
 
     public void disconnect(OvsdbNodeAugmentation ovsdbNode) throws UnknownHostException {
-        OvsdbClientKey key = new OvsdbClientKey(ovsdbNode.getIp(), ovsdbNode.getPort());
+        OvsdbClientKey key = new OvsdbClientKey(ovsdbNode.getConnectionInfo().getRemoteIp(),
+                ovsdbNode.getConnectionInfo().getRemotePort());
         OvsdbClient client = clients.get(key);
         if (client != null) {
             client.disconnect();
@@ -97,15 +98,15 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         return clients.get(key);
     }
 
-    public OvsdbConnectionInstance getConnectionInstance(IpPortLocator loc) {
-        Preconditions.checkNotNull(loc);
-        return getConnectionInstance(new OvsdbClientKey(loc));
+    public OvsdbConnectionInstance getConnectionInstance(ConnectionInfo connectionInfo) {
+        Preconditions.checkNotNull(connectionInfo);
+        return getConnectionInstance(new OvsdbClientKey(connectionInfo));
     }
 
     public OvsdbConnectionInstance getConnectionInstance(OvsdbBridgeAttributes mn) {
         Optional<OvsdbNodeAugmentation> optional = SouthboundUtil.getManagingNode(db, mn);
         if (optional.isPresent()) {
-            return getConnectionInstance(optional.get());
+            return getConnectionInstance(optional.get().getConnectionInfo());
         } else {
             return null;
         }
@@ -116,7 +117,7 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
         OvsdbBridgeAugmentation ovsdbManagedNode = node.getAugmentation(OvsdbBridgeAugmentation.class);
         if (ovsdbNode != null) {
-            return getConnectionInstance(ovsdbNode);
+            return getConnectionInstance(ovsdbNode.getConnectionInfo());
         } else if (ovsdbManagedNode != null) {
             return getConnectionInstance(ovsdbManagedNode);
         } else {
@@ -148,8 +149,8 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
         return getConnectionInstance(key);
     }
 
-    public OvsdbClient getClient(IpPortLocator loc) {
-        return getConnectionInstance(loc);
+    public OvsdbClient getClient(ConnectionInfo connectionInfo) {
+        return getConnectionInstance(connectionInfo);
     }
 
     public OvsdbClient getClient(OvsdbBridgeAttributes mn) {
index 7388554f062b2341dee1252ba6581908904fec05..983c977509b2a17dd67b742a6cd62d250e47fe53 100644 (file)
@@ -104,7 +104,7 @@ public class OvsdbDataChangeListener implements DataChangeListener, AutoCloseabl
         for (Entry<InstanceIdentifier<?>, DataObject> updated : changes.getUpdatedData().entrySet()) {
             if (updated.getValue() instanceof OvsdbNodeAugmentation) {
                 OvsdbNodeAugmentation value = (OvsdbNodeAugmentation) updated.getValue();
-                OvsdbClient client = cm.getClient(value);
+                OvsdbClient client = cm.getClient(value.getConnectionInfo());
                 if (client == null) {
                     for (Entry<InstanceIdentifier<?>, DataObject> original : changes.getOriginalData().entrySet()) {
                         if (original.getValue() instanceof OvsdbNodeAugmentation) {
@@ -164,8 +164,8 @@ public class OvsdbDataChangeListener implements DataChangeListener, AutoCloseabl
                 } else {
                     OvsdbNodeAugmentation ovsNode =
                             ((Node)created.getValue()).getAugmentation(OvsdbNodeAugmentation.class);
-                    if (ovsNode != null) {
-                        OvsdbConnectionInstance client = cm.getConnectionInstance(ovsNode);
+                    if (ovsNode != null && ovsNode.getConnectionInfo() != null) {
+                        OvsdbConnectionInstance client = cm.getConnectionInstance(ovsNode.getConnectionInfo());
                         if (client != null) {
                             LOG.debug("Found client for {}", created.getValue());
                             result.add(client);
index f0ab1ef2f4fb2a38c3046313cf8f763c92c4b7aa..782dc1260525ab11cc54c4ff9d68e8e6c9a28a74 100644 (file)
@@ -43,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
@@ -81,8 +82,10 @@ public class SouthboundMapper {
 
     public static OvsdbNodeAugmentation createOvsdbAugmentation(OvsdbClientKey key) {
         OvsdbNodeAugmentationBuilder ovsdbNodeBuilder = new OvsdbNodeAugmentationBuilder();
-        ovsdbNodeBuilder.setIp(key.getIp());
-        ovsdbNodeBuilder.setPort(key.getPort());
+        ConnectionInfoBuilder ciBuilder = new ConnectionInfoBuilder();
+        ciBuilder.setRemoteIp(key.getIp());
+        ciBuilder.setRemotePort(key.getPort());
+        ovsdbNodeBuilder.setConnectionInfo(ciBuilder.build());
         return ovsdbNodeBuilder.build();
     }
 
index fa028fb254c8f03917ecb9814ebc424ebac24f87..354d483630b6b3cde09a4c647d8f4c2fd133009b 100644 (file)
@@ -46,8 +46,8 @@ public class OvsdbNodeUpdateCommand implements TransactCommand {
             updated.entrySet()) {
             OvsdbNodeAugmentation ovsdbNode = ovsdbNodeEntry.getValue();
             LOG.debug("Received request to update ovsdb node ip: {} port: {}",
-                        ovsdbNode.getIp(),
-                        ovsdbNode.getPort());
+                        ovsdbNode.getConnectionInfo().getRemoteIp(),
+                        ovsdbNode.getConnectionInfo().getRemotePort());
 
             // OpenVSwitchPart
             OpenVSwitch ovs = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), OpenVSwitch.class);
index 380a180b27863d923e537c86653d402198c2bf3c..90f07bc03ea97d869e245e4b554bba21b1d830a7 100644 (file)
@@ -26,12 +26,13 @@ import org.opendaylight.ovsdb.southbound.OvsdbClientKey;
 import org.opendaylight.ovsdb.southbound.SouthboundMapper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchExternalIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchExternalIdsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.DatapathTypeEntryBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.InterfaceTypeEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.InterfaceTypeEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchExternalIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchExternalIdsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchOtherConfigs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchOtherConfigsBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
@@ -141,8 +142,9 @@ public class OpenVSwitchUpdateCommand extends AbstractTransactionCommand {
                 }
 
                 NodeBuilder nodeBuilder = new NodeBuilder();
+                ConnectionInfo connectionInfo = ovsdbNode.getConnectionInfo();
                 nodeBuilder.setNodeId(SouthboundMapper.createNodeId(
-                        ovsdbNode.getIp(), ovsdbNode.getPort()));
+                        connectionInfo.getRemoteIp(), connectionInfo.getRemotePort()));
                 nodeBuilder.addAugmentation(OvsdbNodeAugmentation.class,
                         ovsdbNodeBuilder.build());
                 transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath,