YMS broker and Notification handler

Change-Id: Ic3659b2c2ad26ea2db1f03725b4883f19db2cc41
diff --git a/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleIdentifier.java b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleIdentifier.java
new file mode 100644
index 0000000..6b02720
--- /dev/null
+++ b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleIdentifier.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yms.ysr;
+
+/**
+ * Abstraction of an entity which provides YANG module identifiers.
+ * Reference RFC 7895
+ * YANG library provides information about all the YANG modules
+ * used by a network management server
+ */
+public interface YangModuleIdentifier {
+    /**
+     * retrieves the name of the YANG module.
+     *
+     * @return the name of the YANG module
+     */
+    String getModuleName();
+
+    /**
+     * Retrieves revision of the YANG module.
+     *
+     * Reference RFC 7895
+     * Each YANG module and submodule within the library has a
+     * revision.  This is derived from the most recent revision statement
+     * within the module or submodule.  If no such revision statement
+     * exists, the module's or submodule's revision is the zero-length
+     * string.
+     *
+     * @return revision of the YANG module
+     */
+    String getRevision();
+}
diff --git a/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleInformation.java b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleInformation.java
new file mode 100644
index 0000000..f9c3114
--- /dev/null
+++ b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleInformation.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yms.ysr;
+
+import java.util.List;
+
+/**
+ * Abstraction of an entity which provides YANG module information.
+ *
+ * Reference RFC 7895
+ * The following information is needed by a client application (for each
+ * YANG module in the library) to fully utilize the YANG data modeling
+ * language:
+ *
+ * o  name: The name of the YANG module.
+ *
+ * o  revision: Each YANG module and submodule within the library has a
+ * revision.  This is derived from the most recent revision statement
+ * within the module or submodule.  If no such revision statement
+ * exists, the module's or submodule's revision is the zero-length
+ * string.
+ *
+ * o  submodule list: The name and revision of each submodule used by
+ * the module MUST be identified.
+ *
+ * o  feature list: The name of each YANG feature supported by the
+ * server MUST be identified.
+ *
+ * o  deviation list: The name of each YANG module used for deviation
+ * statements MUST be identified.
+ */
+public interface YangModuleInformation {
+    /**
+     * Retrieves the YANG modules identifier.
+     *
+     * @return YANG modules identifier
+     */
+    YangModuleIdentifier getModuleIdentifier();
+
+    /**
+     * Retrieves the YANG modules namespace.
+     * The XML namespace identifier for this module.
+     *
+     * @return YANG modules namespace
+     */
+    String getNamespace();
+
+    /**
+     * Reference RFC 7895
+     * Retrieves the list of YANG feature names from this module that are
+     * supported by the server, regardless of whether they are
+     * defined in the module or any included submodule.
+     *
+     * @return list of YANG features
+     */
+    List<String> getFeatureList();
+
+    /**
+     * Retrieves the list of submodules in the module.
+     * The name and revision of each submodule used by
+     * the module MUST be identified.
+     *
+     * Each entry represents one submodule within the
+     * parent module.
+     *
+     * @return list of submodules in the module
+     */
+    List<YangModuleIdentifier> getSubModuleIdentifier();
+}
diff --git a/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleLibrary.java b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleLibrary.java
new file mode 100644
index 0000000..284ae86
--- /dev/null
+++ b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/YangModuleLibrary.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.yms.ysr;
+
+/*-
+ * Abstraction of an entity which provides the servers YANG library information.
+ *
+ * Reference RFC 7895
+ * The "ietf-yang-library" module provides information about the YANG
+ * library used by a server.  This module is defined using YANG version
+ * 1, but it supports the description of YANG modules written in any
+ * revision of YANG.
+ *
+ * Following is the YANG Tree Diagram for the "ietf-yang-library"
+ * module:
+ *
+ *     +--ro modules-state
+ *        +--ro module-set-id    string
+ *        +--ro module* [name revision]
+ *           +--ro name                yang:yang-identifier
+ *           +--ro revision            union
+ *           +--ro schema?             inet:uri
+ *           +--ro namespace           inet:uri
+ *           +--ro feature*            yang:yang-identifier
+ *           +--ro deviation* [name revision]
+ *           |  +--ro name        yang:yang-identifier
+ *           |  +--ro revision    union
+ *           +--ro conformance-type    enumeration
+ *           +--ro submodule* [name revision]
+ *              +--ro name        yang:yang-identifier
+ *              +--ro revision    union
+ *              +--ro schema?     inet:uri
+ */
+
+import java.util.List;
+
+public interface YangModuleLibrary {
+    /**
+     * Retrieves the current module set id of the YANG library.
+     *
+     * Reference RFC7895.
+     * modules-state/module-set-id
+     *
+     * This mandatory leaf contains a unique implementation-specific
+     * identifier representing the current set of modules and submodules on
+     * a specific server.  The value of this leaf MUST change whenever the
+     * set of modules and submodules in the YANG library changes.  There is
+     * no requirement that the same set always results in the same "module-
+     * set-id" value.
+     *
+     * @return module set id of the YANG library
+     */
+    String getModuleSetId();
+
+    /**
+     * Retrieves the current list of YANG modules supported in the server.
+     *
+     * Reference RFC 7895.
+     * modules-state/module
+     *
+     * This mandatory list contains one entry for each YANG data model
+     * module supported by the server.  There MUST be an entry in this list
+     * for each revision of each YANG module that is used by the server.  It
+     * is possible for multiple revisions of the same module to be imported,
+     * in addition to an entry for the revision that is implemented by the
+     * server.
+     *
+     * @return the current list of YANG modules supported in the server
+     */
+    List<YangModuleInformation> getYangModuleList();
+}
diff --git a/apps/yms/api/src/main/java/org/onosproject/yms/ysr/package-info.java b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/package-info.java
new file mode 100644
index 0000000..4c19a5b
--- /dev/null
+++ b/apps/yms/api/src/main/java/org/onosproject/yms/ysr/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * YANG schema registry (YSR) is responsible to maintain all the applications
+ * schemas defined in YANG. The YANG data tree builder depends on the schema
+ * registry to validate the tree building according to schema.
+ * YANG codec handler using the schema registry to maintain device schema.
+ */
+package org.onosproject.yms.ysr;