Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-api / src / main / java / org / opendaylight / controller / sal / core / api / notify / NotificationProviderService.java
diff --git a/opendaylight/sal/yang-prototype/sal/sal-core-api/src/main/java/org/opendaylight/controller/sal/core/api/notify/NotificationProviderService.java b/opendaylight/sal/yang-prototype/sal/sal-core-api/src/main/java/org/opendaylight/controller/sal/core/api/notify/NotificationProviderService.java
new file mode 100644 (file)
index 0000000..9367645
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.controller.sal.core.api.notify;\r
+\r
+import org.opendaylight.controller.sal.core.api.Broker;\r
+import org.opendaylight.controller.sal.core.api.BrokerService;\r
+import org.opendaylight.controller.sal.core.api.Provider;\r
+import org.opendaylight.controller.yang.data.api.CompositeNode;\r
+\r
+\r
+/**\r
+ * Notification Publishing Service\r
+ * \r
+ * The simplified process of the notification publishing is following:\r
+ * \r
+ * <ol>\r
+ * <li> {@link Provider} invokes {@link #sendNotification(CompositeNode)}\r
+ * <li> {@link Broker} finds {@link NotificationListener}s which subscribed for\r
+ * the notification type.\r
+ * \r
+ * <li>For each subscriber {@link Broker} invokes\r
+ * {@link NotificationListener#onNotification(CompositeNode)}\r
+ * </ol>\r
+ * \r
+ * \r
+ * \r
+ */\r
+public interface NotificationProviderService extends BrokerService {\r
+\r
+    /**\r
+     * Publishes a notification.\r
+     * \r
+     * Notification type is determined by the\r
+     * {@link CompositeNode#getNodeType()} of the\r
+     * <code>notification<code> parameter.\r
+     * \r
+     * @param notification\r
+     *            Notification to publish\r
+     */\r
+    void sendNotification(CompositeNode notification);\r
+\r
+}\r