X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fmessagebus-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmessagebus%2Feventsources%2Fnetconf%2FNotificationTopicRegistration.java;fp=opendaylight%2Fmd-sal%2Fmessagebus-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmessagebus%2Feventsources%2Fnetconf%2FNotificationTopicRegistration.java;h=7812bd223d6759a2f767fe5606e36a15154168bb;hp=0000000000000000000000000000000000000000;hb=6c9c88f85589d635e3742cb2557044bf3a006d29;hpb=817fba4cbd618da7f587b3a5c33ac1dd2450e983 diff --git a/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/eventsources/netconf/NotificationTopicRegistration.java b/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/eventsources/netconf/NotificationTopicRegistration.java new file mode 100644 index 0000000000..7812bd223d --- /dev/null +++ b/opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/eventsources/netconf/NotificationTopicRegistration.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.messagebus.eventsources.netconf; + +import java.util.ArrayList; + +import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.TopicId; +import org.opendaylight.yangtools.yang.model.api.SchemaPath; + + +public abstract class NotificationTopicRegistration implements AutoCloseable { + + public enum NotificationSourceType{ + NetconfDeviceStream, + ConnectionStatusChange; + } + + private boolean active; + private final NotificationSourceType notificationSourceType; + private final String sourceName; + private final String notificationUrnPrefix; + private boolean replaySupported; + + protected NotificationTopicRegistration(NotificationSourceType notificationSourceType, String sourceName, String notificationUrnPrefix) { + this.notificationSourceType = notificationSourceType; + this.sourceName = sourceName; + this.notificationUrnPrefix = notificationUrnPrefix; + this.active = false; + this.setReplaySupported(false); + } + + public boolean isActive() { + return active; + } + + protected void setActive(boolean active) { + this.active = active; + } + + public NotificationSourceType getNotificationSourceType() { + return notificationSourceType; + } + + public String getSourceName() { + return sourceName; + } + + public String getNotificationUrnPrefix() { + return notificationUrnPrefix; + } + + abstract void activateNotificationSource(); + + abstract void deActivateNotificationSource(); + + abstract void reActivateNotificationSource(); + + abstract boolean registerNotificationTopic(SchemaPath notificationPath, TopicId topicId); + + abstract void unRegisterNotificationTopic(TopicId topicId); + + abstract ArrayList getNotificationTopicIds(SchemaPath notificationPath); + + public boolean isReplaySupported() { + return replaySupported; + } + + protected void setReplaySupported(boolean replaySupported) { + this.replaySupported = replaySupported; + } + +}