Merge "BUG-614: introduce AbstractRuntimeCodeGenerator"
[controller.git] / opendaylight / md-sal / sal-dom-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.concepts.Registration;
15 import org.opendaylight.yangtools.yang.common.QName;
16
17
18 /**
19  * NotificationService provides access to the notification functionality of the
20  * SAL.
21  *
22  * NotificationService allows for consumption of notifications by registering
23  * implementations of NotificationListener.
24  *
25  * The registration of notification listeners could be done by:
26  * <ul>
27  * <li>returning an instance of implementation in the return value of
28  * {@link Provider#getProviderFunctionality()}
29  * <li>passing an instance of implementation and {@link QName} of rpc as an
30  * arguments to the
31  * {@link ProviderSession#addRpcImplementation(QName, RpcImplementation)}
32  * </ul>
33  *
34  *
35  */
36 public interface NotificationService extends BrokerService {
37
38     /**
39      * Registers a notification listener for supplied notification type.
40      *
41      * @param notification
42      * @param listener
43      */
44     Registration<NotificationListener> addNotificationListener(QName notification,
45             NotificationListener listener);
46 }