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.mdsal.dom.api;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableSet;
12 import java.util.EventListener;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.concepts.Registration;
15 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
18 * A {@link DOMNotificationPublishService.Extension} providing a view into which {@link DOMNotification}s the extended
19 * {@link DOMNotificationPublishService} is interested in receiving. This is typically driven by listener registrations
20 * in the {@link DOMNotificationService} consuming published notifications.
24 public interface DOMNotificationPublishDemandExtension extends DOMNotificationPublishService.Extension {
26 * Register a new {@link DemandListener}.
28 * @param listener the listener to register
29 * @return A {@link Registration}
30 * @throws NullPointerException if {@code listener} is {@code null}
32 Registration registerDemandListener(DemandListener listener);
35 * Listener for changes in demand for {@link DOMNotification} types. Changes are communnicated via
36 * {@link #onDemandUpdated(ImmutableSet)}, which reports the delta between last reported and current state.
38 interface DemandListener extends EventListener {
40 * Update the view of what {@link DOMNotification}s are in demand.
42 * @param neededTypes currently-needed notification types
44 void onDemandUpdated(ImmutableSet<Absolute> neededTypes);