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 org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.concepts.Registration;
14 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
17 * A {@link DOMNotificationPublishService.Extension} providing a view into which {@link DOMNotification}s the extended
18 * {@link DOMNotificationPublishService} is interested in receiving. This is typically driven by listener registrations
19 * in the {@link DOMNotificationService} consuming published notifications.
23 public interface DOMNotificationPublishDemandExtension extends DOMNotificationPublishService.Extension {
25 * Register a new {@link DemandListener}.
27 * @param listener the listener to register
28 * @return A {@link Registration}
29 * @throws NullPointerException if {@code listener} is {@code null}
31 Registration registerDemandListener(DemandListener listener);
34 * Listener for changes in demand for {@link DOMNotification} types. Changes are communnicated via
35 * {@link #onDemandUpdated(ImmutableSet)}, which reports the delta between last reported and current state.
37 interface DemandListener {
39 * Update the view of what {@link DOMNotification}s are in demand.
41 * @param neededTypes currently-needed notification types
43 void onDemandUpdated(ImmutableSet<Absolute> neededTypes);