3bf10546e50fc70331e943514defbad6999189a5
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-api / src / main / java / org / opendaylight / controller / sal / core / api / notify / NotificationService.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.core.api.notify;
9
10 import org.opendaylight.controller.sal.core.api.BrokerService;
11 import org.opendaylight.controller.sal.core.api.Provider;
12 import org.opendaylight.controller.sal.core.api.RpcImplementation;
13 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
14 import org.opendaylight.yangtools.yang.common.QName;
15
16
17 /**
18  * NotificationService provides access to the notification functionality of the
19  * SAL.
20  * 
21  * NotificationService allows for consumption of notifications by registering
22  * implementations of NotificationListener.
23  * 
24  * The registration of notification listeners could be done by:
25  * <ul>
26  * <li>returning an instance of implementation in the return value of
27  * {@link Provider#getProviderFunctionality()}
28  * <li>passing an instance of implementation and {@link QName} of rpc as an
29  * arguments to the
30  * {@link ProviderSession#addRpcImplementation(QName, RpcImplementation)}
31  * </ul>
32  * 
33  * 
34  */
35 public interface NotificationService extends BrokerService {
36
37     /**
38      * Registers a notification listener for supplied notification type.
39      * 
40      * @param notification
41      * @param listener
42      */
43     void addNotificationListener(QName notification,
44             NotificationListener listener);
45
46     /**
47      * Removes a notification listener for supplied notification type.
48      * 
49      * @param notification
50      * @param listener
51      */
52     void removeNotificationListener(QName notification,
53             NotificationListener listener);
54 }