import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * Topic registration for notification stream.
+ */
public class StreamNotificationTopicRegistration extends NotificationTopicRegistration {
private static final Logger LOG = LoggerFactory.getLogger(StreamNotificationTopicRegistration.class);
private ConcurrentHashMap<SchemaPath, ListenerRegistration<NetconfEventSource>> notificationRegistrationMap = new ConcurrentHashMap<>();
private ConcurrentHashMap<SchemaPath, ArrayList<TopicId>> notificationTopicMap = new ConcurrentHashMap<>();
+ /**
+ * Creates registration to notification stream.
+ * @param stream stream
+ * @param notificationPrefix notifications namespace
+ * @param netconfEventSource event source
+ */
public StreamNotificationTopicRegistration(final Stream stream, final String notificationPrefix,
NetconfEventSource netconfEventSource) {
super(NotificationSourceType.NetconfDeviceStream, stream.getName().getValue(), notificationPrefix);
LOG.info("StreamNotificationTopicRegistration initialized for {}", getStreamName());
}
+ /**
+ * Subscribes to notification stream associated with this registration.
+ */
void activateNotificationSource() {
if (isActive() == false) {
LOG.info("Stream {} is not active on node {}. Will subscribe.", this.getStreamName(), this.nodeId);
}
}
+ /**
+ * Subscribes to notification stream associated with this registration. If replay is supported, notifications from last
+ * received event time will be requested.
+ */
void reActivateNotificationSource() {
if (isActive()) {
LOG.info("Stream {} is reactivating on node {}.", this.getStreamName(), this.nodeId);