Change Location Resolver DS to Configuration 82/39882/2
authorMichal Cmarada <mcmarada@cisco.com>
Mon, 6 Jun 2016 11:57:04 +0000 (13:57 +0200)
committerMartin Sunal <msunal@cisco.com>
Mon, 6 Jun 2016 14:29:40 +0000 (14:29 +0000)
Change-Id: I06c48db6f50ccb77246296d341905de0f42e39b5
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/location/resolver/LocationResolver.java
groupbasedpolicy/src/test/java/org/opendaylight/groupbasedpolicy/location/resolver/LocationResolverTest.java
location-providers/ne-location-provider/src/main/java/org/opendaylight/groupbasedpolicy/ne/location/provider/NeLocationProvider.java
location-providers/ne-location-provider/src/test/java/org/opendaylight/groupbasedpolicy/ne/location/provider/NeLocationProviderTest.java

index e4b00dc8b14b245b3a6476ff227685e9fe939d60..32addda168cc937f7be85c97956e07f453dfb007 100644 (file)
@@ -55,7 +55,7 @@ public class LocationResolver implements DataTreeChangeListener<LocationProvider
         this.dataBroker = dataBroker;
         this.realLocations = new HashMap<>();
         this.listenerRegistation = dataBroker.registerDataTreeChangeListener(
-                new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
+                new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
                         InstanceIdentifier.builder(LocationProviders.class).child(LocationProvider.class).build()),
                 this);
     }
index 1e068f558bf49e7cdd85f9144cd34a731b766617..890e9f012a69cc97b52b12a9ce1c30bc400393a0 100644 (file)
@@ -115,7 +115,7 @@ public class LocationResolverTest extends CustomDataBrokerTest {
             .child(LocationProvider.class, provider.getKey())
             .build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
-        wtx.put(LogicalDatastoreType.OPERATIONAL, iid, provider);
+        wtx.put(LogicalDatastoreType.CONFIGURATION, iid, provider);
         wtx.submit().get();
 
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
@@ -164,7 +164,7 @@ public class LocationResolverTest extends CustomDataBrokerTest {
             .child(LocationProvider.class, provider.getKey())
             .build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
-        wtx.put(LogicalDatastoreType.OPERATIONAL, iid, provider);
+        wtx.put(LogicalDatastoreType.CONFIGURATION, iid, provider);
         wtx.submit().get();
 
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
@@ -191,7 +191,7 @@ public class LocationResolverTest extends CustomDataBrokerTest {
             .child(LocationProvider.class, new LocationProviderKey(new ProviderName(PROVIDER_NAME)))
             .build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
-        wtx.delete(LogicalDatastoreType.OPERATIONAL, iid);
+        wtx.delete(LogicalDatastoreType.CONFIGURATION, iid);
         wtx.submit().get();
 
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
@@ -229,7 +229,7 @@ public class LocationResolverTest extends CustomDataBrokerTest {
             .child(AbsoluteLocation.class)
             .build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
-        wtx.put(LogicalDatastoreType.OPERATIONAL, iid, absoluteLocation);
+        wtx.put(LogicalDatastoreType.CONFIGURATION, iid, absoluteLocation);
         wtx.submit().get();
 
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
index 97153e2766bc02535179f55e8cd39835c129c30c..29583bf1779af387a3ab6cbdd3d820cfd4aeff17 100644 (file)
@@ -117,7 +117,7 @@ public class NeLocationProvider implements DataTreeChangeListener<NetworkElement
                             .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class,
                                     endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId())
                             .child(AbsoluteLocation.class);
-                        wtx.put(LogicalDatastoreType.OPERATIONAL, iid, createRealLocation(ne.getIid(), iface.getIid()),
+                        wtx.put(LogicalDatastoreType.CONFIGURATION, iid, createRealLocation(ne.getIid(), iface.getIid()),
                                 true);
                         LOG.debug("New location created for endpoint {}", endpoint);
                         return;
@@ -139,7 +139,7 @@ public class NeLocationProvider implements DataTreeChangeListener<NetworkElement
                             .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class,
                                     endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId())
                             .child(AbsoluteLocation.class);
-                        wtx.delete(LogicalDatastoreType.OPERATIONAL, iid);
+                        wtx.delete(LogicalDatastoreType.CONFIGURATION, iid);
                         LOG.debug("Location deleted for endpoint {}", endpoint);
                         return;
                     }
@@ -381,7 +381,7 @@ public class NeLocationProvider implements DataTreeChangeListener<NetworkElement
                     .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class,
                             endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId())
                     .child(AbsoluteLocation.class);
-                wtx.put(LogicalDatastoreType.OPERATIONAL, iid, createRealLocation(nodeIID, connectorIID), true);
+                wtx.put(LogicalDatastoreType.CONFIGURATION, iid, createRealLocation(nodeIID, connectorIID), true);
                 LOG.debug("New location created for endpoint {}", endpoint);
                 return;
             }
@@ -398,7 +398,7 @@ public class NeLocationProvider implements DataTreeChangeListener<NetworkElement
                     .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class,
                             endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId())
                     .child(AbsoluteLocation.class);
-                wtx.delete(LogicalDatastoreType.OPERATIONAL, iid);
+                wtx.delete(LogicalDatastoreType.CONFIGURATION, iid);
                 LOG.debug("Location deleted for endpoint {}", endpoint);
                 return;
             }
index 22ac33844ea08b14fc876cc4939773585fe1ea72..08c0053d7cce17d6d4a7623733175f53f51d92fe 100644 (file)
@@ -369,7 +369,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
         InstanceIdentifier<LocationProviders> locationIid = InstanceIdentifier.builder(LocationProviders.class).build();
         CheckedFuture<Optional<LocationProviders>, ReadFailedException> read =
-                rtx.read(LogicalDatastoreType.OPERATIONAL, locationIid);
+                rtx.read(LogicalDatastoreType.CONFIGURATION, locationIid);
         assertTrue(read.get().isPresent());
         rtx.close();
         LocationProviders locations = read.get().get();
@@ -412,7 +412,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
         InstanceIdentifier<LocationProviders> locationIid = InstanceIdentifier.builder(LocationProviders.class).build();
         CheckedFuture<Optional<LocationProviders>, ReadFailedException> read =
-                rtx.read(LogicalDatastoreType.OPERATIONAL, locationIid);
+                rtx.read(LogicalDatastoreType.CONFIGURATION, locationIid);
         assertTrue(read.get().isPresent());
         rtx.close();
         LocationProviders locations = read.get().get();
@@ -457,7 +457,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         ReadOnlyTransaction rtx = dataBroker.newReadOnlyTransaction();
         InstanceIdentifier<LocationProviders> locationIid = InstanceIdentifier.builder(LocationProviders.class).build();
         CheckedFuture<Optional<LocationProviders>, ReadFailedException> read =
-                rtx.read(LogicalDatastoreType.OPERATIONAL, locationIid);
+                rtx.read(LogicalDatastoreType.CONFIGURATION, locationIid);
         assertTrue(read.get().isPresent());
         rtx.close();
         LocationProviders locations = read.get().get();