private final String nodeId;
private final NetconfEventSource netconfEventSource;
private final NetconfEventSourceMount mountPoint;
- private final ConcurrentHashMap<SchemaPath, ListenerRegistration<DOMNotificationListener>> notificationRegistrationMap = new ConcurrentHashMap<>();
+ private final ConcurrentHashMap<SchemaPath, ListenerRegistration<DOMNotificationListener>>
+ notificationRegistrationMap = new ConcurrentHashMap<>();
private final Stream stream;
/**
* Creates registration to notification stream.
- * @param stream stream
+ *
+ * @param stream stream
* @param notificationPrefix notifications namespace
* @param netconfEventSource event source
*/
- public StreamNotificationTopicRegistration(final Stream stream, final String notificationPrefix,
- NetconfEventSource netconfEventSource) {
+ StreamNotificationTopicRegistration(final Stream stream, final String notificationPrefix,
+ NetconfEventSource netconfEventSource) {
super(NotificationSourceType.NetconfDeviceStream, stream.getName().getValue(), notificationPrefix);
this.netconfEventSource = netconfEventSource;
this.mountPoint = netconfEventSource.getMount();
}
/**
- * Subscribes to notification stream associated with this registration. If replay is supported, notifications from last
+ * Subscribes to notification stream associated with this registration. If replay is supported, notifications
+ * from last
* received event time will be requested.
*/
void reActivateNotificationSource() {
}
}
- @Override void deActivateNotificationSource() {
+ @Override
+ void deActivateNotificationSource() {
// no operations need
}
return getSourceName();
}
- @Override boolean registerNotificationTopic(SchemaPath notificationPath, TopicId topicId) {
+ @Override
+ boolean registerNotificationTopic(SchemaPath notificationPath, TopicId topicId) {
if (!checkNotificationPath(notificationPath)) {
LOG.debug("Bad SchemaPath for notification try to register");
return false;
activateNotificationSource();
if (!isActive()) {
LOG.warn("Stream {} is not active, listener for notification {} is not registered.", getStreamName(),
- notificationPath.toString());
+ notificationPath.toString());
return false;
}
- ListenerRegistration<DOMNotificationListener> registration = mountPoint.registerNotificationListener(netconfEventSource, notificationPath);
+ ListenerRegistration<DOMNotificationListener> registration =
+ mountPoint.registerNotificationListener(netconfEventSource, notificationPath);
notificationRegistrationMap.put(notificationPath, registration);
Set<TopicId> topicIds = getTopicsForNotification(notificationPath);
topicIds.add(topicId);
return true;
}
- @Override synchronized void unRegisterNotificationTopic(TopicId topicId) {
+ @Override
+ synchronized void unRegisterNotificationTopic(TopicId topicId) {
List<SchemaPath> notificationPathToRemove = new ArrayList<>();
for (SchemaPath notifKey : notificationTopicMap.keySet()) {
Set<TopicId> topicList = notificationTopicMap.get(notifKey);
}
}
- @Override public void close() throws Exception {
+ @Override
+ public void close() throws Exception {
closeStream();
}