Merge from development repository.
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-api / src / main / java / org / opendaylight / controller / sal / core / api / notify / NotificationProviderService.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.Broker;\r
11 import org.opendaylight.controller.sal.core.api.BrokerService;\r
12 import org.opendaylight.controller.sal.core.api.Provider;\r
13 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
14 \r
15 \r
16 /**\r
17  * Notification Publishing Service\r
18  * \r
19  * The simplified process of the notification publishing is following:\r
20  * \r
21  * <ol>\r
22  * <li> {@link Provider} invokes {@link #sendNotification(CompositeNode)}\r
23  * <li> {@link Broker} finds {@link NotificationListener}s which subscribed for\r
24  * the notification type.\r
25  * \r
26  * <li>For each subscriber {@link Broker} invokes\r
27  * {@link NotificationListener#onNotification(CompositeNode)}\r
28  * </ol>\r
29  * \r
30  * \r
31  * \r
32  */\r
33 public interface NotificationProviderService extends BrokerService {\r
34 \r
35     /**\r
36      * Publishes a notification.\r
37      * \r
38      * Notification type is determined by the\r
39      * {@link CompositeNode#getNodeType()} of the\r
40      * <code>notification<code> parameter.\r
41      * \r
42      * @param notification\r
43      *            Notification to publish\r
44      */\r
45     void sendNotification(CompositeNode notification);\r
46 \r
47 }\r