X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-notifications-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnotifications%2Fimpl%2FNetconfNotificationManager.java;h=2bddb096901b52953059dbb25a363c61c1229fd5;hb=refs%2Fchanges%2F13%2F23413%2F26;hp=d2dbcaf4162f76b5802b509dd8bdf2ea2a06770e;hpb=bfd413d87f82ee3ffed67a141a980805950a0f06;p=controller.git diff --git a/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/NetconfNotificationManager.java b/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/NetconfNotificationManager.java index d2dbcaf416..2bddb09690 100644 --- a/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/NetconfNotificationManager.java +++ b/opendaylight/netconf/netconf-notifications-impl/src/main/java/org/opendaylight/controller/netconf/notifications/impl/NetconfNotificationManager.java @@ -77,7 +77,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, @Override public synchronized void onNotification(final StreamNameType stream, final NetconfNotification notification) { LOG.debug("Notification of type {} detected", stream); - if(LOG.isTraceEnabled()) { + if (LOG.isTraceEnabled()) { LOG.debug("Notification of type {} detected: {}", stream, notification); } @@ -129,7 +129,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, return new NotificationRegistration() { @Override public void close() { - synchronized(NetconfNotificationManager.this) { + synchronized (NetconfNotificationManager.this) { streamListeners.remove(listener); } } @@ -160,11 +160,11 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, final StreamNameType streamName = stream.getName(); LOG.debug("Notification publisher registered for stream: {}", streamName); - if(LOG.isTraceEnabled()) { + if (LOG.isTraceEnabled()) { LOG.trace("Notification publisher registered for stream: {}", stream); } - if(streamMetadata.containsKey(streamName)) { + if (streamMetadata.containsKey(streamName)) { LOG.warn("Notification stream {} already registered as: {}. Will be reused", streamName, streamMetadata.get(streamName)); } else { streamMetadata.put(streamName, stream); @@ -206,6 +206,7 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, streamListener.onStreamRegistered(stream); } } + private synchronized void notifyStreamRemoved(final StreamNameType stream) { for (final NetconfNotificationStreamListener streamListener : streamListeners) { streamListener.onStreamUnregistered(stream); @@ -254,13 +255,14 @@ public class NetconfNotificationManager implements NetconfNotificationCollector, baseRegistration.close(); } + private static NetconfNotification serializeNotification(final NetconfCapabilityChange capabilityChange) { + return NotificationsTransformUtil.transform(capabilityChange); + } + @Override public void onCapabilityChanged(final NetconfCapabilityChange capabilityChange) { baseRegistration.onNotification(BASE_STREAM_NAME, serializeNotification(capabilityChange)); - } - - private static NetconfNotification serializeNotification(final NetconfCapabilityChange capabilityChange) { - return NotificationsTransformUtil.transform(capabilityChange); +// baseRegistration.onNotification(BASE_STREAM_NAME, serializeNotification(computeDiff(removed, added))); } }