blob: 0844858dad5a5a69aa1b0447e4c523aa4eaa3c62 [file] [log] [blame]
sonu gupta1bb37b82016-11-11 16:51:18 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
sonu gupta1bb37b82016-11-11 16:51:18 +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.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.
sonu guptaeff184b2016-11-24 12:43:49 +053067 *
68 * @throws IllegalStateException when user request for traverse to logical
69 * root node parent
sonu gupta1bb37b82016-11-11 16:51:18 +053070 */
sonu guptaeff184b2016-11-24 12:43:49 +053071 void traverseToParentWithoutValidation() throws IllegalStateException;
sonu gupta1bb37b82016-11-11 16:51:18 +053072
73 @Override
74 YdtExtendedContext getRootNode();
janani b9069eb42016-11-24 17:50:08 +053075
76 @Override
77 YdtExtendedContext getCurNode();
sonu gupta1bb37b82016-11-11 16:51:18 +053078}