2 * Copyright (c) 2016 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.restconf.nb.rfc8040.streams;
13 * Base interface for both listeners({@link ListenerAdapter}, {@link NotificationListenerAdapter}).
15 public interface BaseListenerInterface extends AutoCloseable {
17 * Return all subscribers of listener.
19 * @return Set of all subscribers.
21 Set<StreamSessionHandler> getSubscribers();
24 * Checks if exists at least one {@link StreamSessionHandler} subscriber.
26 * @return {@code true} if exist at least one {@link StreamSessionHandler} subscriber, {@code false} otherwise.
28 boolean hasSubscribers();
33 * @return Stream name.
35 String getStreamName();
40 * @return Output type (JSON or XML).
42 String getOutputType();
45 * Registers {@link StreamSessionHandler} subscriber.
47 * @param subscriber SSE or WS session handler.
49 void addSubscriber(StreamSessionHandler subscriber);
52 * Removes {@link StreamSessionHandler} subscriber.
54 * @param subscriber SSE or WS session handler.
56 void removeSubscriber(StreamSessionHandler subscriber);