iid type change in network elements 33/40733/9
authorMatej Perina <matej.perina@pantheon.sk>
Fri, 24 Jun 2016 07:36:19 +0000 (09:36 +0200)
committerMatej Perina <matej.perina@pantheon.sk>
Mon, 27 Jun 2016 08:08:11 +0000 (08:08 +0000)
Change-Id: I95f68d510debb3ae6046122b3d27d61125a55956
Signed-off-by: Matej Perina <matej.perina@pantheon.sk>
location-providers/ne-location-provider/src/main/java/org/opendaylight/groupbasedpolicy/ne/location/provider/NeLocationProvider.java
location-providers/ne-location-provider/src/main/yang/network-elements.yang
location-providers/ne-location-provider/src/test/java/org/opendaylight/groupbasedpolicy/ne/location/provider/NeLocationProviderTest.java

index 29583bf1779af387a3ab6cbdd3d820cfd4aeff17..cc8d7cd69bfdebfe943abb9f45bc6ab3e9e473d8 100644 (file)
@@ -371,7 +371,7 @@ public class NeLocationProvider implements DataTreeChangeListener<NetworkElement
     }
 
     private void processCreatedEN(EndpointNetwork en, InstanceIdentifier<?> nodeIID,
-            InstanceIdentifier<?> connectorIID, WriteTransaction wtx) {
+            String connectorIID, WriteTransaction wtx) {
         for (AddressEndpoint endpoint : endpoints) {
             if (endpoint.getContextType().isAssignableFrom(L3Context.class)
                     && endpoint.getContextId().equals(en.getL3ContextId())
@@ -405,10 +405,10 @@ public class NeLocationProvider implements DataTreeChangeListener<NetworkElement
         }
     }
 
-    private AbsoluteLocation createRealLocation(InstanceIdentifier<?> node, InstanceIdentifier<?> iface) {
+    private AbsoluteLocation createRealLocation(InstanceIdentifier<?> node, String iface) {
         return new AbsoluteLocationBuilder()
             .setLocationType(new ExternalLocationCaseBuilder().setExternalNodeMountPoint(node)
-                    .setExternalNodeConnector(iface.toString()).build()).build();
+                    .setExternalNodeConnector(iface).build()).build();
     }
 
     private <T> List<T> nullToEmpty(@Nullable List<T> list) {
index c0b3a510967ae58c70164580a4cc68db3f5e37b1..b0c071d8035dee032698877f6a2cb45ab2bc1b01 100644 (file)
@@ -45,7 +45,7 @@
                          represented in topology of southbound plugin.
                          This should be more like RelativeSchemaPath
                          from network-element's IID to interface.";
-                     type instance-identifier;
+                     type string;
                  }
                  list endpoint-network {
                      description "Set of networks somewhere behind the interface.
index 08c0053d7cce17d6d4a7623733175f53f51d92fe..4d6e20acba1bf0d2f1e123c7778dd4bc53d29c9c 100644 (file)
@@ -281,13 +281,13 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         EndpointNetwork en = createEndpointNetwork(L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_2);
         InstanceIdentifier<EndpointNetwork> iid = InstanceIdentifier.builder(NetworkElements.class)
             .child(NetworkElement.class, new NetworkElementKey(createNetworkElementIid(NODE_ID_1)))
-            .child(Interface.class, new InterfaceKey(createInterfaceIid(NODE_ID_1, CONNECTOR_ID_1)))
+            .child(Interface.class, new InterfaceKey(CONNECTOR_ID_1))
             .child(EndpointNetwork.class, new EndpointNetworkKey(en.getKey()))
             .build();
         InstanceIdentifier<EndpointNetwork> removeIid =
                 InstanceIdentifier.builder(NetworkElements.class)
                     .child(NetworkElement.class, new NetworkElementKey(createNetworkElementIid(NODE_ID_1)))
-                    .child(Interface.class, new InterfaceKey(createInterfaceIid(NODE_ID_1, CONNECTOR_ID_1)))
+                    .child(Interface.class, new InterfaceKey(CONNECTOR_ID_1))
                     .child(EndpointNetwork.class, new EndpointNetworkKey(
                             new IpPrefix(new Ipv4Prefix(IPv4_NETWORK_ADDRESS_1)),new ContextId(L3_CONTEXT_ID)))
                     .build();
@@ -338,7 +338,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         writeBaseNetworkElements();
         InstanceIdentifier<Interface> iid = InstanceIdentifier.builder(NetworkElements.class)
             .child(NetworkElement.class, new NetworkElementKey(createNetworkElementIid(NODE_ID_1)))
-            .child(Interface.class, new InterfaceKey(createInterfaceIid(NODE_ID_1, CONNECTOR_ID_1)))
+            .child(Interface.class, new InterfaceKey(CONNECTOR_ID_1))
             .build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.delete(LogicalDatastoreType.CONFIGURATION, iid);
@@ -386,8 +386,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                                     .setAbsoluteLocation(new AbsoluteLocationBuilder()
                                             .setLocationType(new ExternalLocationCaseBuilder()
                                                     .setExternalNodeMountPoint(createNetworkElementIid(NODE_ID_1))
-                                                    .setExternalNodeConnector(createInterfaceIid(
-                                                            NODE_ID_1, CONNECTOR_ID_1).toString())
+                                                    .setExternalNodeConnector(CONNECTOR_ID_1)
                                                     .build())
                                             .build())
                                     .build()))
@@ -429,8 +428,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                                     .setAbsoluteLocation(new AbsoluteLocationBuilder()
                                             .setLocationType(new ExternalLocationCaseBuilder()
                                                     .setExternalNodeMountPoint(createNetworkElementIid(NODE_ID_1))
-                                                    .setExternalNodeConnector(createInterfaceIid(
-                                                            NODE_ID_1, CONNECTOR_ID_1).toString())
+                                                    .setExternalNodeConnector(CONNECTOR_ID_1)
                                                     .build())
                                             .build())
                                     .build()))
@@ -474,8 +472,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                                     .setAbsoluteLocation(new AbsoluteLocationBuilder()
                                             .setLocationType(new ExternalLocationCaseBuilder()
                                                     .setExternalNodeMountPoint(createNetworkElementIid(NODE_ID_1))
-                                                    .setExternalNodeConnector(createInterfaceIid(
-                                                            NODE_ID_1, CONNECTOR_ID_1).toString())
+                                                    .setExternalNodeConnector(CONNECTOR_ID_1)
                                                     .build())
                                             .build())
                                     .build()))
@@ -521,7 +518,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     }
 
     private Interface createInterface(String node, String iface, String l3c, String prefix) {
-        return new InterfaceBuilder().setIid(createInterfaceIid(node, iface))
+        return new InterfaceBuilder().setIid(iface)
             .setEndpointNetwork(Collections.singletonList(createEndpointNetwork(l3c, prefix)))
             .build();
     }