blob: ea9c9f3d8efff0d94b076524ce1c4595976c3f7f [file] [log] [blame]
sonu gupta1bb37b82016-11-11 16:51:18 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
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.ydt;
18
19import org.onosproject.yangutils.datamodel.YangSchemaNode;
20import org.onosproject.yms.ydt.YdtBuilder;
21import org.onosproject.yms.ydt.YdtContextOperationType;
22
23import java.util.Set;
24
25/**
26 * Abstraction of an entity which represents extension of YDT builder
27 * required by internal sub modules.
28 */
29public interface YdtExtendedBuilder extends YdtBuilder {
30
31 /**
32 * Adds a last child to YANG data tree; this method is to be used by
33 * YANG object builder.
34 *
35 * @param yangSchemaNode schema node from YANG metadata
36 * @param opType type of requested operation over a node
37 * @return YDT context
38 */
39 YdtExtendedContext addChild(YdtContextOperationType opType,
40 YangSchemaNode yangSchemaNode);
41
42 /**
43 * Adds a last leaf list to YANG data tree; this method is to be used by
44 * YANG object builder.
45 *
46 * @param valueSet list of value of the child
47 * @param yangSchemaNode schema node from YANG metadata
48 * @return YDT context
49 */
50 YdtExtendedContext addLeafList(Set<String> valueSet,
51 YangSchemaNode yangSchemaNode);
52
53 /**
54 * Adds a last leaf to YANG data tree; this method is to be used by
55 * YANG object builder.
56 *
57 * @param value value of the child
58 * @param yangSchemaNode schema node from YANG metadata
59 * @return YDT context
60 */
61 YdtExtendedContext addLeaf(String value, YangSchemaNode yangSchemaNode);
62
63 /**
64 * Traverses up in YANG data tree to the parent node, it is to be used when
65 * protocol is using extended context type and wanted to traverse
66 * up the tree without doing any validation.
67 */
68 void traverseToParentWithoutValidation();
69
70 @Override
71 YdtExtendedContext getRootNode();
72}