2 * Copyright (c) 2014 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.controller.md.sal.dom.api;
10 import java.util.Collection;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.concepts.ListenerRegistration;
13 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 * A {@link DOMService} which allows its users to subscribe to receive
17 * {@link DOMNotification}s.
19 * @deprecated Use {@link org.opendaylight.mdsal.dom.api.DOMNotificationService} instead
21 @Deprecated(forRemoval = true)
22 public interface DOMNotificationService extends DOMService {
24 * Register a {@link DOMNotificationListener} to receive a set of notifications. As with
25 * other ListenerRegistration-based interfaces, registering an instance multiple times
26 * results in notifications being delivered for each registration.
28 * @param listener Notification instance to register
29 * @param types Notification types which should be delivered to the listener. Duplicate
30 * entries are processed only once, null entries are ignored.
31 * @return Registration handle. Invoking {@link ListenerRegistration#close()}
32 * will stop the delivery of notifications to the listener
33 * @throws IllegalArgumentException if types is empty or contains an invalid element, such as
34 * null or a SchemaPath which does not represent a valid {@link DOMNotification} type.
35 * @throws NullPointerException if either of the arguments is null
37 <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(
38 @NonNull T listener, @NonNull Collection<SchemaPath> types);
41 * Register a {@link DOMNotificationListener} to receive a set of notifications. As with
42 * other ListenerRegistration-based interfaces, registering an instance multiple times
43 * results in notifications being delivered for each registration.
45 * @param listener Notification instance to register
46 * @param types Notification types which should be delivered to the listener. Duplicate
47 * entries are processed only once, null entries are ignored.
48 * @return Registration handle. Invoking {@link ListenerRegistration#close()}
49 * will stop the delivery of notifications to the listener
50 * @throws IllegalArgumentException if types is empty or contains an invalid element, such as
51 * null or a SchemaPath which does not represent a valid {@link DOMNotification} type.
52 * @throws NullPointerException if listener is null
54 // FIXME: Java 8: provide a default implementation of this method.
55 <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(
56 @NonNull T listener, SchemaPath... types);