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.netconf.notifications;
10 import org.eclipse.jdt.annotation.NonNull;
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 import org.opendaylight.yangtools.concepts.Registration;
16 * Collector of all notifications. Base or generic.
18 public interface NetconfNotificationCollector {
20 * Add notification publisher for a particular stream.
23 * Implementations should allow for multiple publishers of a single stream and its up to implementations to decide
24 * how to merge metadata (e.g. description) for the same stream when providing information about available stream.
26 NotificationPublisherRegistration registerNotificationPublisher(Stream stream);
29 * Register base notification publisher.
31 BaseNotificationPublisherRegistration registerBaseNotificationPublisher();
34 * Register yang-library publisher.
36 YangLibraryPublisherRegistration registerYangLibraryPublisher();
39 * Users of the registry have an option to get notification each time new notification stream gets registered
40 * This allows for a push model in addition to pull model for retrieving information about available streams.
43 * The listener should receive callbacks for each stream available prior to the registration when its registered.
45 @NonNull Registration registerStreamListener(@NonNull NetconfNotificationStreamListener listener);
48 * Simple listener that receives notifications about changes in stream availability.
50 interface NetconfNotificationStreamListener {
52 * Stream becomes available in the collector (first publisher is registered).
54 void onStreamRegistered(Stream stream);
57 * Stream is not available anymore in the collector (last publisher is unregistered).
59 void onStreamUnregistered(StreamNameType stream);