Mahesh Poojary Huawei | a330c58 | 2016-08-26 10:38:10 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Mahesh Poojary Huawei | a330c58 | 2016-08-26 10:38:10 +0530 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.yms.ypm; |
| 18 | |
| 19 | /** |
| 20 | * Abstraction of an entity which represents YANG protocol metadata context |
| 21 | * information. |
| 22 | */ |
| 23 | public interface YpmContext { |
| 24 | |
| 25 | /** |
| 26 | * Returns the node name. |
| 27 | * |
| 28 | * @return node name |
| 29 | */ |
| 30 | String getName(); |
| 31 | |
| 32 | /** |
| 33 | * Sets the nodes name. |
| 34 | * |
| 35 | * @param name nodes name |
| 36 | */ |
| 37 | void setName(String name); |
| 38 | |
| 39 | /** |
| 40 | * Returns the context of parent node. |
| 41 | * |
| 42 | * @return context of parent node |
| 43 | */ |
| 44 | YpmContext getParent(); |
| 45 | |
| 46 | /** |
| 47 | * Sets the context of parent node. |
| 48 | * |
| 49 | * @param parent node parent |
| 50 | */ |
| 51 | void setParent(YpmContext parent); |
| 52 | |
| 53 | /** |
| 54 | * Retrieves the first child of a node. |
| 55 | * |
| 56 | * @return first child of a node |
| 57 | */ |
| 58 | YpmContext getFirstChild(); |
| 59 | |
| 60 | /** |
| 61 | * Retrieves the child of a node for corresponding ydt node. |
| 62 | * |
| 63 | * @param name ypm node |
| 64 | * @return child of a node |
| 65 | */ |
| 66 | YpmContext getChild(String name); |
| 67 | |
| 68 | /** |
| 69 | * Adds child to a node by ydt name. |
| 70 | * |
| 71 | * @param name ypm name |
| 72 | */ |
| 73 | void addChild(String name); |
| 74 | |
| 75 | /** |
| 76 | * Retrieves sibling of a child by (ydt) name. |
| 77 | * |
| 78 | * @param name ypm name |
| 79 | * @return sibling of a child |
| 80 | */ |
| 81 | YpmContext getSibling(String name); |
| 82 | |
| 83 | /** |
| 84 | * Adds new sibling to a child. |
| 85 | * |
| 86 | * @param name ypm name |
| 87 | */ |
| 88 | void addSibling(String name); |
| 89 | |
| 90 | /** |
| 91 | * Returns the context of next sibling. |
| 92 | * |
| 93 | * @return context of next sibling |
| 94 | */ |
| 95 | YpmContext getNextSibling(); |
| 96 | |
| 97 | /** |
| 98 | * Sets the next sibling of node. |
| 99 | * |
| 100 | * @param sibling ypm node |
| 101 | */ |
| 102 | void setNextSibling(DefaultYpmNode sibling); |
| 103 | |
| 104 | /** |
| 105 | * Returns the previous sibling of a node. |
| 106 | * |
| 107 | * @return previous sibling of a node |
| 108 | */ |
| 109 | DefaultYpmNode getPreviousSibling(); |
| 110 | |
| 111 | /** |
| 112 | * Sets the previous sibling. |
| 113 | * |
| 114 | * @param previousSibling points to predecessor sibling |
| 115 | */ |
| 116 | void setPreviousSibling(DefaultYpmNode previousSibling); |
| 117 | |
| 118 | /** |
| 119 | * Retrieves protocol metadata. |
| 120 | * |
| 121 | * @return metadata |
| 122 | */ |
| 123 | Object getMetaData(); |
| 124 | |
| 125 | /** |
| 126 | * Sets the protocol metadata. |
| 127 | * |
| 128 | * @param data metadata |
| 129 | */ |
| 130 | void setMetaData(Object data); |
| 131 | } |