2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.util.concurrent.MoreExecutors;
12 import java.util.concurrent.Executor;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.concepts.Registration;
15 import org.opendaylight.yangtools.yang.common.QName;
18 * A {@link DOMService} providing access to subscription to YANG 1.1 instance notifications.
22 public interface DOMInstanceNotificationService
23 extends DOMService<DOMInstanceNotificationService, DOMInstanceNotificationService.Extension> {
25 * Marker interface for an extension to {@link DOMInstanceNotificationService}.
27 interface Extension extends DOMService.Extension<DOMInstanceNotificationService, Extension> {
32 * Register a {@link DOMInstanceNotificationListener} for a particular {@code path} and notification {@code type}.
34 * @param path Instance notification's parent path, must not be empty, but may be a wildcard identifier.
35 * @param type Notification type, i.e. its schema node QName
36 * @param listener Listener to deliver notifications to
37 * @param executor Executor to use for invoking
38 * @return Listener's registration object
39 * @throws NullPointerException if any of the arguments is null
40 * @throws IllegalArgumentException if the {@code path} is empty or if the combination of {@code path} and
41 * {@code type} does not identify an instance notification
43 Registration registerNotificationListener(DOMDataTreeIdentifier path, QName type,
44 DOMInstanceNotificationListener listener, Executor executor);
47 * Register a {@link DOMInstanceNotificationListener} for a particular {@code path} and notification {@code type}.
48 * This method is a convenience equivalent to
49 * {@code registerNotificationListener(path, type, listener, MoreExecutors.directExecutor())}.
51 * @param path Instance notification's parent path, must not be empty, but may be a wildcard identifier.
52 * @param type Notification type, i.e. its schema node QName
53 * @param listener Listener to deliver notifications to
54 * @return Listener's registration object
55 * @throws NullPointerException if any of the arguments is null
56 * @throws IllegalArgumentException if the {@code path} is empty or if the combination of {@code path} and
57 * {@code type} does not identify an instance notification
59 default Registration registerNotificationListener(final DOMDataTreeIdentifier path, final QName type,
60 final DOMInstanceNotificationListener listener) {
61 return registerNotificationListener(path, type, listener, MoreExecutors.directExecutor());