2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.messagebus.eventsources.netconf;
10 import java.util.ArrayList;
12 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.TopicId;
13 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 public abstract class NotificationTopicRegistration implements AutoCloseable {
18 public enum NotificationSourceType{
20 ConnectionStatusChange;
23 private boolean active;
24 private final NotificationSourceType notificationSourceType;
25 private final String sourceName;
26 private final String notificationUrnPrefix;
27 private boolean replaySupported;
29 protected NotificationTopicRegistration(NotificationSourceType notificationSourceType, String sourceName, String notificationUrnPrefix) {
30 this.notificationSourceType = notificationSourceType;
31 this.sourceName = sourceName;
32 this.notificationUrnPrefix = notificationUrnPrefix;
34 this.setReplaySupported(false);
37 public boolean isActive() {
41 protected void setActive(boolean active) {
45 public NotificationSourceType getNotificationSourceType() {
46 return notificationSourceType;
49 public String getSourceName() {
53 public String getNotificationUrnPrefix() {
54 return notificationUrnPrefix;
57 abstract void activateNotificationSource();
59 abstract void deActivateNotificationSource();
61 abstract void reActivateNotificationSource();
63 abstract boolean registerNotificationTopic(SchemaPath notificationPath, TopicId topicId);
65 abstract void unRegisterNotificationTopic(TopicId topicId);
67 abstract ArrayList<TopicId> getNotificationTopicIds(SchemaPath notificationPath);
69 public boolean isReplaySupported() {
70 return replaySupported;
73 protected void setReplaySupported(boolean replaySupported) {
74 this.replaySupported = replaySupported;