blob: 8df19c7a507d62782f94a21a259e2b11b786c261 [file] [log] [blame]
janani b05614f12016-10-04 12:55:43 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
janani b05614f12016-10-04 12:55:43 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yms.app.ytb;
18
janani b05614f12016-10-04 12:55:43 +053019import org.onosproject.yms.app.ydt.YdtExtendedBuilder;
janani b9069eb42016-11-24 17:50:08 +053020import org.onosproject.yms.app.ydt.YdtExtendedContext;
janani b05614f12016-10-04 12:55:43 +053021import org.onosproject.yms.app.ysr.YangSchemaRegistry;
janani b05614f12016-10-04 12:55:43 +053022import org.onosproject.yms.ydt.YmsOperationType;
23
24import java.util.List;
25
26/**
27 * Abstraction of an entity which provides interfaces to build YANG data tree
28 * from the object received from YNH, YAB or YCH.
29 */
30public interface YangTreeBuilder {
31
32 /**
33 * Returns the YDT builder after building the tree corresponding to the
34 * response YANG object received from any of the protocol such as YAB or
35 * YCH.
36 *
37 * @param moduleObj application module object
janani b9069eb42016-11-24 17:50:08 +053038 * @param rootName logical root node name
39 * @param rootNameSpace logical root node namespace
janani b05614f12016-10-04 12:55:43 +053040 * @param opType root node operation type
41 * @param registry application schema registry
42 * @return YDT builder from the tree
43 */
44 YdtExtendedBuilder getYdtBuilderForYo(List<Object> moduleObj,
45 String rootName,
46 String rootNameSpace,
47 YmsOperationType opType,
48 YangSchemaRegistry registry);
49
50 /**
51 * Returns the YDT context after building the tree received from the
52 * protocol YNH.
53 *
54 * @param object application notification object
janani b9069eb42016-11-24 17:50:08 +053055 * @param rootName logical root node name
janani b05614f12016-10-04 12:55:43 +053056 * @param registry application schema registry
57 * @return YDT context from the tree
58 */
janani b9069eb42016-11-24 17:50:08 +053059 YdtExtendedContext getYdtForNotification(Object object, String rootName,
60 YangSchemaRegistry registry);
janani b05614f12016-10-04 12:55:43 +053061
62 /**
63 * Returns the YDT context after building the RPC response tree. The input
janani b9069eb42016-11-24 17:50:08 +053064 * for building the tree is RPC request builder, RPC output java object.
janani b05614f12016-10-04 12:55:43 +053065 * These are received from the YSB protocol.
66 *
janani b9069eb42016-11-24 17:50:08 +053067 * @param outputObj application output object
68 * @param reqBuilder RPC request builder from YDT
janani b05614f12016-10-04 12:55:43 +053069 * @return YDT builder where RPC response tree is created
70 */
71 YdtExtendedBuilder getYdtForRpcResponse(Object outputObj,
janani b9069eb42016-11-24 17:50:08 +053072 YdtExtendedBuilder reqBuilder);
janani b05614f12016-10-04 12:55:43 +053073}