[ONOS-5081] YANG tree builder.
Change-Id: Id47015d0cec1a446efcae6c4f3e2ffe87a0f0e0e
diff --git a/apps/yms/app/src/main/java/org/onosproject/yms/app/ytb/YangTreeBuilder.java b/apps/yms/app/src/main/java/org/onosproject/yms/app/ytb/YangTreeBuilder.java
new file mode 100644
index 0000000..2c1df67
--- /dev/null
+++ b/apps/yms/app/src/main/java/org/onosproject/yms/app/ytb/YangTreeBuilder.java
@@ -0,0 +1,74 @@
+/*
+ * 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.app.ytb;
+
+import org.onosproject.yms.app.ydt.YangRequestWorkBench;
+import org.onosproject.yms.app.ydt.YdtExtendedBuilder;
+import org.onosproject.yms.app.ysr.YangSchemaRegistry;
+import org.onosproject.yms.ydt.YdtContext;
+import org.onosproject.yms.ydt.YmsOperationType;
+
+import java.util.List;
+
+/**
+ * Abstraction of an entity which provides interfaces to build YANG data tree
+ * from the object received from YNH, YAB or YCH.
+ */
+public interface YangTreeBuilder {
+
+    /**
+     * Returns the YDT builder after building the tree corresponding to the
+     * response YANG object received from any of the protocol such as YAB or
+     * YCH.
+     *
+     * @param moduleObj     application module object
+     * @param rootName      root node name
+     * @param rootNameSpace root node namespace
+     * @param opType        root node operation type
+     * @param registry      application schema registry
+     * @return YDT builder from the tree
+     */
+    YdtExtendedBuilder getYdtBuilderForYo(List<Object> moduleObj,
+                                          String rootName,
+                                          String rootNameSpace,
+                                          YmsOperationType opType,
+                                          YangSchemaRegistry registry);
+
+    /**
+     * Returns the YDT context after building the tree received from the
+     * protocol YNH.
+     *
+     * @param object   application notification object
+     * @param rootName root node name
+     * @param registry application schema registry
+     * @return YDT context from the tree
+     */
+    YdtContext getYdtForNotification(Object object, String rootName,
+                                     YangSchemaRegistry registry);
+
+    /**
+     * Returns the YDT context after building the RPC response tree. The input
+     * for building the tree is RPC request workbench, RPC output java object.
+     * These are received from the YSB protocol.
+     *
+     * @param outputObj application output object
+     * @param workBench RPC request workbench from YDT
+     * @return YDT builder where RPC response tree is created
+     */
+    YdtExtendedBuilder getYdtForRpcResponse(Object outputObj,
+                                            YangRequestWorkBench workBench);
+}