Merge "Do not duplicate OSGi dependencyManagement"
[controller.git] / opendaylight / netconf / netconf-notifications-api / src / main / java / org / opendaylight / controller / netconf / notifications / NetconfNotificationCollector.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.netconf.notifications;
10
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream;
13
14 /**
15  * Collector of all notifications. Base or generic
16  */
17 public interface NetconfNotificationCollector  {
18
19     /**
20      * Add notification publisher for a particular stream
21      *
22      * Implementations should allow for multiple publishers of a single stream
23      * and its up to implementations to decide how to merge metadata (e.g. description)
24      * for the same stream when providing information about available stream
25      *
26      */
27     NotificationPublisherRegistration registerNotificationPublisher(Stream stream);
28
29     /**
30      * Register base notification publisher
31      */
32     BaseNotificationPublisherRegistration registerBaseNotificationPublisher();
33
34     /**
35      * Users of the registry have an option to get notification each time new notification stream gets registered
36      * This allows for a push model in addition to pull model for retrieving information about available streams.
37      *
38      * The listener should receive callbacks for each stream available prior to the registration when its registered
39      */
40     NotificationRegistration registerStreamListener(NetconfNotificationStreamListener listener);
41
42     /**
43      * Simple listener that receives notifications about changes in stream availability
44      */
45     public interface NetconfNotificationStreamListener {
46
47         /**
48          * Stream becomes available in the collector (first publisher is registered)
49          */
50         void onStreamRegistered(Stream stream);
51
52         /**
53          * Stream is not available anymore in the collector (last publisher is unregistered)
54          */
55         void onStreamUnregistered(StreamNameType stream);
56     }
57
58 }