DataChangeListener cleanup
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / provider / src / main / java / org / opendaylight / controller / clustering / it / provider / CarProvider.java
index ea9f7b1d762e3dde09cb24a36d18dd4b397494e6..803d3b76525aea6a64b6f8773ca5fbf7f8d0d640 100644 (file)
@@ -27,7 +27,6 @@ import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipChange;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
@@ -244,20 +243,6 @@ public class CarProvider implements CarService {
         }
     }
 
-    @Override
-    public Future<RpcResult<java.lang.Void>> registerLoggingDcl() {
-        LOG_CAR_PROVIDER.info("Registering a new CarDataChangeListener");
-        final ListenerRegistration carsDclRegistration = dataProvider.registerDataChangeListener(
-                LogicalDatastoreType.CONFIGURATION, CARS_IID, new CarDataChangeListener(),
-                AsyncDataBroker.DataChangeScope.SUBTREE);
-
-        if (carsDclRegistration != null) {
-            carsDclRegistrations.add(carsDclRegistration);
-            return RpcResultBuilder.<Void>success().buildFuture();
-        }
-        return RpcResultBuilder.<Void>failed().buildFuture();
-    }
-
     @Override
     public Future<RpcResult<java.lang.Void>> registerLoggingDtcl() {
         LOG_CAR_PROVIDER.info("Registering a new CarDataTreeChangeListener");
@@ -271,21 +256,6 @@ public class CarProvider implements CarService {
         return RpcResultBuilder.<Void>failed().buildFuture();
     }
 
-    @Override
-    public Future<RpcResult<java.lang.Void>> unregisterLoggingDcls() {
-        LOG_CAR_PROVIDER.info("Unregistering the CarDataChangeListener(s)");
-        synchronized (carsDclRegistrations) {
-            int numListeners = 0;
-            for (ListenerRegistration<?> carsDclRegistration : carsDclRegistrations) {
-                carsDclRegistration.close();
-                numListeners++;
-            }
-            carsDclRegistrations.clear();
-            LOG_CAR_PROVIDER.info("Unregistered {} CarDataChangeListener(s)", numListeners);
-        }
-        return RpcResultBuilder.<Void>success().buildFuture();
-    }
-
     @Override
     public Future<RpcResult<java.lang.Void>> unregisterLoggingDtcls() {
         LOG_CAR_PROVIDER.info("Unregistering the CarDataTreeChangeListener(s)");