2 * Copyright (c) 2013 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.sal.binding.api;
10 import org.opendaylight.controller.md.sal.common.api.notify.NotificationSubscriptionService;
11 import org.opendaylight.yangtools.concepts.ListenerRegistration;
12 import org.opendaylight.yangtools.concepts.Registration;
13 import org.opendaylight.yangtools.yang.binding.Notification;
15 public interface NotificationService extends BindingAwareService {
18 * Deprecated: use {@link #addNotificationListener(Class, NotificationListener)} istead.
23 <T extends Notification> void addNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
27 * Deprecated: use {@link #addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener)} istead.
32 void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener);
35 * Deprecated: use {@link Registration#close()} istead.
39 void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener);
42 * Deprecated: use {@link Registration#close()} istead.
46 <T extends Notification> void removeNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
50 * Register a generic listener for specified notification type only.
52 * @param notificationType
54 * @return Registration for listener. To unregister listener invoke {@link Registration#close()} method.
56 <T extends Notification> Registration<NotificationListener<T>> registerNotificationListener(
57 Class<T> notificationType, NotificationListener<T> listener);
61 * Register a listener which implements generated notification interfaces derived from
62 * {@link org.opendaylight.yangtools.yang.binding.NotificationListener}.
63 * Listener is registered for all notifications present in implemented interfaces.
66 * @return Registration for listener. To unregister listener invoke {@link Registration#close()} method.
68 Registration<org.opendaylight.yangtools.yang.binding.NotificationListener> registerNotificationListener(
69 org.opendaylight.yangtools.yang.binding.NotificationListener listener);