import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor;
import org.opendaylight.controller.cluster.datastore.messages.DataChanged;
import org.opendaylight.controller.cluster.datastore.messages.DataChangedReply;
+import org.opendaylight.controller.cluster.datastore.messages.DataTreeListenerInfo;
import org.opendaylight.controller.cluster.datastore.messages.EnableNotification;
+import org.opendaylight.controller.cluster.datastore.messages.GetInfo;
import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
private final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener;
private final YangInstanceIdentifier registeredPath;
private boolean notificationsEnabled = false;
+ private long notificationCount;
public DataChangeListener(AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener,
final YangInstanceIdentifier registeredPath) {
dataChanged(message);
} else if (message instanceof EnableNotification) {
enableNotification((EnableNotification) message);
+ } else if (message instanceof GetInfo) {
+ getSender().tell(new DataTreeListenerInfo(listener.toString(), registeredPath.toString(),
+ notificationsEnabled, notificationCount), getSelf());
} else {
unknownMessage(message);
}
LOG.debug("Sending change notification {} to listener {}", change, listener);
+ notificationCount++;
+
try {
this.listener.onDataChanged(change);
} catch (RuntimeException e) {