BUG-5280: move DataTreeCandidate serialization to its own class
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DataChangeListener.java
index 1bc835f1e3c6883196d4a9a6b1f334bb16f9dca7..7f985263c371c8dcfc669251c43dd705b2466704 100644 (file)
@@ -22,23 +22,28 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * @Deprecated Replaced by {@link DataTreeChangeListener}
+ */
+@Deprecated
 public class DataChangeListener extends AbstractUntypedActor {
     private static final Logger LOG = LoggerFactory.getLogger(DataChangeListener.class);
 
     private final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener;
     private boolean notificationsEnabled = false;
 
-    public DataChangeListener(AsyncDataChangeListener<YangInstanceIdentifier,
-                                                      NormalizedNode<?, ?>> listener) {
+    public DataChangeListener(AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener) {
         this.listener = Preconditions.checkNotNull(listener, "listener should not be null");
     }
 
     @Override
-    public void handleReceive(Object message) throws Exception {
-        if(message instanceof DataChanged){
+    public void handleReceive(Object message) {
+        if (message instanceof DataChanged){
             dataChanged(message);
-        } else if(message instanceof EnableNotification){
+        } else if (message instanceof EnableNotification){
             enableNotification((EnableNotification) message);
+        } else {
+            unknownMessage(message);
         }
     }
 
@@ -52,8 +57,7 @@ public class DataChangeListener extends AbstractUntypedActor {
 
         // Do nothing if notifications are not enabled
         if(!notificationsEnabled) {
-            LOG.debug("Notifications not enabled for listener {} - dropping change notification",
-                    listener);
+            LOG.debug("Notifications not enabled for listener {} - dropping change notification", listener);
             return;
         }