Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-api / src / main / java / org / opendaylight / controller / sal / core / api / notify / NotificationService.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.controller.sal.core.api.notify;\r
9 \r
10 import org.opendaylight.controller.sal.core.api.BrokerService;\r
11 import org.opendaylight.controller.sal.core.api.Provider;\r
12 import org.opendaylight.controller.sal.core.api.RpcImplementation;\r
13 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;\r
14 import org.opendaylight.controller.yang.common.QName;\r
15 \r
16 \r
17 /**\r
18  * NotificationService provides access to the notification functionality of the\r
19  * SAL.\r
20  * \r
21  * NotificationService allows for consumption of notifications by registering\r
22  * implementations of NotificationListener.\r
23  * \r
24  * The registration of notification listeners could be done by:\r
25  * <ul>\r
26  * <li>returning an instance of implementation in the return value of\r
27  * {@link Provider#getProviderFunctionality()}\r
28  * <li>passing an instance of implementation and {@link QName} of rpc as an\r
29  * arguments to the\r
30  * {@link ProviderSession#addRpcImplementation(QName, RpcImplementation)}\r
31  * </ul>\r
32  * \r
33  * \r
34  */\r
35 public interface NotificationService extends BrokerService {\r
36 \r
37     /**\r
38      * Registers a notification listener for supplied notification type.\r
39      * \r
40      * @param notification\r
41      * @param listener\r
42      */\r
43     void addNotificationListener(QName notification,\r
44             NotificationListener listener);\r
45 \r
46     /**\r
47      * Removes a notification listener for supplied notification type.\r
48      * \r
49      * @param notification\r
50      * @param listener\r
51      */\r
52     void removeNotificationListener(QName notification,\r
53             NotificationListener listener);\r
54 }\r