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
9 package org.opendaylight.controller.netconf.notifications;
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;
15 * Collector of all notifications. Base or generic
17 public interface NetconfNotificationCollector {
20 * Add notification publisher for a particular stream
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
27 NotificationPublisherRegistration registerNotificationPublisher(Stream stream);
30 * Register base notification publisher
32 BaseNotificationPublisherRegistration registerBaseNotificationPublisher();
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.
38 * The listener should receive callbacks for each stream available prior to the registration when its registered
40 NotificationRegistration registerStreamListener(NetconfNotificationStreamListener listener);
43 * Simple listener that receives notifications about changes in stream availability
45 public interface NetconfNotificationStreamListener {
48 * Stream becomes available in the collector (first publisher is registered)
50 void onStreamRegistered(Stream stream);
53 * Stream is not available anymore in the collector (last publisher is unregistered)
55 void onStreamUnregistered(StreamNameType stream);