Committed by
Gerrit Code Review
[ONOS-4694] YANG management system outline and YMSM/YDT interfaces
Change-Id: I050ed98ba18edc2c2cea2abafeee6d8c9061b579
Showing
29 changed files
with
1312 additions
and
1 deletions
... | @@ -13,7 +13,9 @@ | ... | @@ -13,7 +13,9 @@ |
13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | ~ See the License for the specific language governing permissions and | 14 | ~ See the License for the specific language governing permissions and |
15 | ~ limitations under the License. | 15 | ~ limitations under the License. |
16 | - --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | 16 | + --> |
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
18 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
17 | <modelVersion>4.0.0</modelVersion> | 19 | <modelVersion>4.0.0</modelVersion> |
18 | 20 | ||
19 | <parent> | 21 | <parent> |
... | @@ -72,6 +74,7 @@ | ... | @@ -72,6 +74,7 @@ |
72 | <module>xosclient</module> | 74 | <module>xosclient</module> |
73 | <module>scalablegateway</module> | 75 | <module>scalablegateway</module> |
74 | <module>bmv2-demo</module> | 76 | <module>bmv2-demo</module> |
77 | + <module>yms</module> | ||
75 | </modules> | 78 | </modules> |
76 | 79 | ||
77 | 80 | ... | ... |
apps/yms/BUCK
0 → 100644
apps/yms/api/BUCK
0 → 100644
apps/yms/api/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2015-present Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <artifactId>onos-yms</artifactId> | ||
24 | + <groupId>org.onosproject</groupId> | ||
25 | + <version>1.7.0-SNAPSHOT</version> | ||
26 | + </parent> | ||
27 | + | ||
28 | + <artifactId>onos-app-yms-api</artifactId> | ||
29 | + <packaging>bundle</packaging> | ||
30 | + | ||
31 | + <url>http://onosproject.org</url> | ||
32 | + | ||
33 | + <description>YANG Management System API</description> | ||
34 | + | ||
35 | +</project> |
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * Provides interfaces to YANG management system. YANG management system | ||
19 | + * is a core of YANG in ONOS. | ||
20 | + * | ||
21 | + * In NBI, it acts as a broker in between the protocol and application, | ||
22 | + * here there is a separate protocol implementation, which does the conversion | ||
23 | + * of protocol representation to abstract data tree. The protocol | ||
24 | + * implementation takes care of the protocol specific actions for | ||
25 | + * e.g. RESTCONF handling the entity-tag / timestamp related operations. | ||
26 | + * | ||
27 | + * In SBI, driver or provider uses YANG codec handler as a utility to translate | ||
28 | + * the request information in java(YANG utils generated) to protocol specific | ||
29 | + * format and vice versa. | ||
30 | + */ | ||
31 | +package org.onosproject.yms; |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ych; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity which provides interfaces to YANG codec handler. | ||
21 | + * | ||
22 | + * In SBI, the provider or driver uses YANG management system as a CODEC | ||
23 | + * utility. These providers/drivers use the YANG codec utility to register | ||
24 | + * the device schema. YANG utils is used to generate the java files | ||
25 | + * corresponding to the device schema. Provider or driver use these classes | ||
26 | + * to seamlessly manage the device as java objects. While sending the request | ||
27 | + * to device, drivers use the utility to translate the objects to protocol | ||
28 | + * specific data representation and then send to the device. | ||
29 | + * Protocol or driver use the same instance of the codec utility across multiple | ||
30 | + * translation request. | ||
31 | + * Protocol or driver should not use the same instance of utility concurrently. | ||
32 | + */ | ||
33 | +public interface YangCodecHandler { | ||
34 | + //TODO | ||
35 | +} |
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * In SBI, the provider or driver uses YANG management system as a CODEC | ||
19 | + * utility. These providers/drivers use the YANG codec utility to register | ||
20 | + * the device schema. YANG utils is used to generate the java files | ||
21 | + * corresponding to the device schema. Provider or driver use these classes | ||
22 | + * to seamlessly manage the device as java objects. While sending the request | ||
23 | + * to device, drivers use the utility to translate the objects to protocol | ||
24 | + * specific data representation and then send to the device. | ||
25 | + * Protocol or driver use the same instance of the codec utility across multiple | ||
26 | + * translation request. | ||
27 | + * Protocol or driver should not use the same instance of utility concurrently. | ||
28 | + */ | ||
29 | +package org.onosproject.yms.ych; |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +import org.onosproject.yms.ymsm.YmsOperationType; | ||
20 | + | ||
21 | +/** | ||
22 | + * Abstraction of an entity which represent YANG data tree. This is used | ||
23 | + * for exchanging information between YANG management system and NBI protocol. | ||
24 | + */ | ||
25 | +public interface Ydt { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns the root context information available in YDT node. This root | ||
29 | + * node is a logical container of a protocol which holds the complete data | ||
30 | + * tree. After building YANG data tree, root node can be obtained from this. | ||
31 | + * | ||
32 | + * @return root YDT context which is logical container of a protocol which | ||
33 | + * is holder of the complete tree | ||
34 | + */ | ||
35 | + YdtContext getRootNode(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Returns YANG management system operation type. It represents type of | ||
39 | + * root level operation for the request. This is used by protocols to | ||
40 | + * specify the root level operation associated with the request. | ||
41 | + * | ||
42 | + * @return YANG management system operation type | ||
43 | + */ | ||
44 | + YmsOperationType getYmsOperationType(); | ||
45 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +import java.util.List; | ||
20 | +import java.util.Map; | ||
21 | +import java.util.Set; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity which provides interfaces to build and obtain YANG | ||
25 | + * data tree which is data (sub)instance representation, abstract of protocol. | ||
26 | + * | ||
27 | + * NBI protocols need to translate the protocol operation request, into a | ||
28 | + * protocol independent abstract tree called the YANG data tree (YDT). In order | ||
29 | + * to enable the protocol in building these abstract data tree, YANG | ||
30 | + * management system provides a utility called the YANG data tree builder. | ||
31 | + */ | ||
32 | +public interface YdtBuilder | ||
33 | + extends Ydt { | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets root node tag attributes. This is used by protocol | ||
37 | + * to specify tag attributes associated with root resource. | ||
38 | + * | ||
39 | + * @param attributeTag map of root tags attribute values indexed by root | ||
40 | + * tag name. | ||
41 | + */ | ||
42 | + void setRootTagAttributeMap(Map<String, String> attributeTag); | ||
43 | + | ||
44 | + /** | ||
45 | + * Returns map of tag attribute list associated with root resource. | ||
46 | + * | ||
47 | + * @return linked hash map of tag name with value | ||
48 | + */ | ||
49 | + Map<String, String> getRootTagAttributeMap(); | ||
50 | + | ||
51 | + /** | ||
52 | + * Adds a last child to YANG data tree, this method is to be used by | ||
53 | + * protocols which are unaware of the nature (single/multiple) of node and | ||
54 | + * also unaware of the operation type at every node(Example: RESTCONF). | ||
55 | + * | ||
56 | + * Add child is used to add module/sub-module nodes also. Request may | ||
57 | + * contain revision number corresponding to Module/sub-module in that | ||
58 | + * case YMS expect revision number to be appended to module/sub-module | ||
59 | + * name in the below mentioned format. | ||
60 | + * module-or-submodule-name ['@' date-arg] | ||
61 | + * date-arg = 4DIGIT "-" 2DIGIT "-" 2DIGIT | ||
62 | + * Example: testModule@2016-10-27. | ||
63 | + * | ||
64 | + * If the revision date is not specified YMS first search for | ||
65 | + * registered module/sub-module without revision date, if still can't obtain | ||
66 | + * then uses registered module/sub-module with latest revision date. | ||
67 | + * | ||
68 | + * @param name name of child to be added | ||
69 | + * @param namespace namespace of child to be added, if it's null, parent's | ||
70 | + * namespace will be applied to child | ||
71 | + */ | ||
72 | + void addChild(String name, String namespace); | ||
73 | + | ||
74 | + /** | ||
75 | + * Adds a last child to YANG data tree, this method is to be used by | ||
76 | + * protocols which are aware of the nature (single/multiple) of node. | ||
77 | + * | ||
78 | + * Add child is used to add module/sub-module nodes also. Request may | ||
79 | + * contain revision number corresponding to Module/sub-module in that | ||
80 | + * case YMS expect revision number to be appended to module/sub-module | ||
81 | + * name in the below mentioned format. | ||
82 | + * module-or-submodule-name ['@' date-arg] | ||
83 | + * date-arg = 4DIGIT "-" 2DIGIT "-" 2DIGIT | ||
84 | + * Example: testModule@2016-10-27. | ||
85 | + * | ||
86 | + * If the revision date is not specified YMS first search for | ||
87 | + * registered module/sub-module without revision date, if still can't obtain | ||
88 | + * then uses registered module/sub-module with latest revision date. | ||
89 | + * | ||
90 | + * @param name name of child to be added | ||
91 | + * @param namespace namespace of child to be added, if it's null, parent's | ||
92 | + * namespace will be applied to child | ||
93 | + * @param ydtType type of YDT node to be added | ||
94 | + */ | ||
95 | + void addChild(String name, String namespace, YdtType ydtType); | ||
96 | + | ||
97 | + /** | ||
98 | + * Adds a last child to YANG data tree, this method is to be used by | ||
99 | + * protocols which are unaware of the nature (single/multiple) of node. | ||
100 | + * This is an overloaded method with operation type. This method can | ||
101 | + * optionally | ||
102 | + * be used when protocol doesn't want to specify operation type by | ||
103 | + * keeping it null. | ||
104 | + * | ||
105 | + * Add child is used to add module/sub-module nodes also. Request may | ||
106 | + * contain revision number corresponding to Module/sub-module in that | ||
107 | + * case YMS expect revision number to be appended to module/sub-module | ||
108 | + * name in the below mentioned format. | ||
109 | + * module-or-submodule-name ['@' date-arg] | ||
110 | + * date-arg = 4DIGIT "-" 2DIGIT "-" 2DIGIT | ||
111 | + * Example: testModule@2016-10-27. | ||
112 | + * | ||
113 | + * If the revision date is not specified YMS first search for | ||
114 | + * registered module/sub-module without revision date, if still can't obtain | ||
115 | + * then uses registered module/sub-module with latest revision date. | ||
116 | + * | ||
117 | + * @param name name of child to be added | ||
118 | + * @param namespace namespace of child to be added, if it's null, parent's | ||
119 | + * namespace will be applied to child | ||
120 | + * @param opType type of requested operation over a node | ||
121 | + */ | ||
122 | + void addChild(String name, String namespace, | ||
123 | + YdtContextOperationType opType); | ||
124 | + | ||
125 | + /** | ||
126 | + * Adds a last child to YANG data tree, this method is to be used by | ||
127 | + * protocols which are aware of the nature (single/multiple) of node. | ||
128 | + * This is an overloaded method with operation type. This method can | ||
129 | + * optionally | ||
130 | + * be used when protocol doesn't want to specify operation type by | ||
131 | + * keeping it null. | ||
132 | + * | ||
133 | + * Add child is used to add module/sub-module nodes also. Request may | ||
134 | + * contain revision number corresponding to Module/sub-module in that | ||
135 | + * case YMS expect revision number to be appended to module/sub-module | ||
136 | + * name in the below mentioned format. | ||
137 | + * module-or-submodule-name ['@' date-arg] | ||
138 | + * date-arg = 4DIGIT "-" 2DIGIT "-" 2DIGIT | ||
139 | + * Example: testModule@2016-10-27. | ||
140 | + * | ||
141 | + * If the revision date is not specified YMS first search for | ||
142 | + * registered module/sub-module without revision date, if still can't obtain | ||
143 | + * then uses registered module/sub-module with latest revision date. | ||
144 | + * | ||
145 | + * @param name name of child to be added | ||
146 | + * @param namespace namespace of child to be added, if it's null, parent's | ||
147 | + * namespace will be applied to child | ||
148 | + * @param ydtType type of YDT node to be added | ||
149 | + * @param opType type of requested operation over a node | ||
150 | + */ | ||
151 | + void addChild(String name, String namespace, YdtType ydtType, | ||
152 | + YdtContextOperationType opType); | ||
153 | + | ||
154 | + | ||
155 | + /** | ||
156 | + * Adds a last leaf with value to YANG data tree. Protocols unaware of | ||
157 | + * nature | ||
158 | + * of leaf (single/multiple) will use it to add both single instance and | ||
159 | + * multi instance node. Protocols aware of nature of node will use it for | ||
160 | + * single instance value node addition. | ||
161 | + * Value of leaf can be null which indicates selection node in get | ||
162 | + * operation. | ||
163 | + * | ||
164 | + * @param name name of child to be added | ||
165 | + * @param namespace namespace of child to be added, if it's null, parent's | ||
166 | + * namespace will be applied to child | ||
167 | + * @param value value of the child | ||
168 | + */ | ||
169 | + void addLeaf(String name, String namespace, String value); | ||
170 | + | ||
171 | + /** | ||
172 | + * Adds a last leaf with list of values to YANG data tree. This method is | ||
173 | + * used by protocols which knows the nature (single/multiple) of node for | ||
174 | + * multi instance node addition. | ||
175 | + * Value of leaf can be null which indicates selection node in get | ||
176 | + * operation. | ||
177 | + * | ||
178 | + * @param name name of child to be added | ||
179 | + * @param namespace namespace of child to be added, if it's null, parent's | ||
180 | + * namespace will be applied to child | ||
181 | + * @param valueSet list of value of the child | ||
182 | + */ | ||
183 | + void addLeaf(String name, String namespace, Set<String> valueSet); | ||
184 | + | ||
185 | + /** | ||
186 | + * Adds YANG list's keys value in the order defined in list's key statement. | ||
187 | + * All the keys must be present any missing key or invalid key will result | ||
188 | + * in exception. | ||
189 | + * | ||
190 | + * @param keysValueList values of the keys in URI in the same order | ||
191 | + * as defined in YANG file | ||
192 | + */ | ||
193 | + void addKeyLeafs(List<String> keysValueList); | ||
194 | + | ||
195 | + /** | ||
196 | + * Traverses up in YANG data tree to the parent node, it is to be used when | ||
197 | + * protocol is using context type "current" and wanted to traverse up the | ||
198 | + * tree. | ||
199 | + */ | ||
200 | + void traverseToParent(); | ||
201 | + | ||
202 | + /** | ||
203 | + * Returns the current context information available in YDT node. | ||
204 | + * | ||
205 | + * @return current YDT context | ||
206 | + */ | ||
207 | + YdtContext getCurNode(); | ||
208 | + | ||
209 | + /** | ||
210 | + * Sets default operation type. This operation type is taken if operation | ||
211 | + * type is not explicitly specified in request. If default operation type | ||
212 | + * is not set, merge will be taken as default operation type. | ||
213 | + * | ||
214 | + * @param ydtContextOperationType default edit operation type | ||
215 | + */ | ||
216 | + void setDefaultEditOperationType( | ||
217 | + YdtContextOperationType ydtContextOperationType); | ||
218 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +import java.util.Set; | ||
20 | + | ||
21 | +/** | ||
22 | + * Abstraction of an entity which represents YANG data tree context | ||
23 | + * information. This context information will be used protocol to obtain | ||
24 | + * the information associated with YDT node. This is used when protocol is | ||
25 | + * walking the data tree in both visitor and listener mechanism. | ||
26 | + */ | ||
27 | +public interface YdtContext { | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns the node name. | ||
31 | + * | ||
32 | + * @return node name | ||
33 | + */ | ||
34 | + String getName(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Returns the node namespace. | ||
38 | + * | ||
39 | + * @return node namespace | ||
40 | + */ | ||
41 | + String getNamespace(); | ||
42 | + | ||
43 | + /** | ||
44 | + * Returns the YDT node extended context information corresponding to YDT | ||
45 | + * node. | ||
46 | + * | ||
47 | + * @param <T> specifies YMS operation specific extended information | ||
48 | + * associated with YDT context. It will be | ||
49 | + * YdtContextOperationType in case extended information type | ||
50 | + * is EDIT_REQUEST and will be YdtContextResponseInfo in case | ||
51 | + * extended information type is RESPONSE. | ||
52 | + * @return YdtContextOperationType YDT node operation type | ||
53 | + */ | ||
54 | + <T> T getYdtContextExtendedInfo(); | ||
55 | + | ||
56 | + /** | ||
57 | + * Returns YANG data tree extended information type. This is used to | ||
58 | + * identify the type of extended information applicable for YDT node. | ||
59 | + * | ||
60 | + * @return type of extended information | ||
61 | + */ | ||
62 | + YdtExtendedInfoType getYdtExtendedInfoType(); | ||
63 | + | ||
64 | + /** | ||
65 | + * Returns the type of YDT entity. This type will be used by protocols to | ||
66 | + * identify the nature of node and can implement it accordingly. | ||
67 | + * | ||
68 | + * @return YDT entity type | ||
69 | + */ | ||
70 | + YdtType getYdtType(); | ||
71 | + | ||
72 | + /** | ||
73 | + * Returns the context of parent node. | ||
74 | + * | ||
75 | + * @return context of parent node | ||
76 | + */ | ||
77 | + YdtContext getParent(); | ||
78 | + | ||
79 | + /** | ||
80 | + * Returns the context of first child. | ||
81 | + * | ||
82 | + * @return context of first child | ||
83 | + */ | ||
84 | + YdtContext getFirstChild(); | ||
85 | + | ||
86 | + /** | ||
87 | + * Returns the context of last child. | ||
88 | + * | ||
89 | + * @return context of last child | ||
90 | + */ | ||
91 | + YdtContext getLastChild(); | ||
92 | + | ||
93 | + /** | ||
94 | + * Returns the context of next sibling. | ||
95 | + * | ||
96 | + * @return context of next sibling | ||
97 | + */ | ||
98 | + YdtContext getNextSibling(); | ||
99 | + | ||
100 | + /** | ||
101 | + * Returns the context of previous sibling. | ||
102 | + * | ||
103 | + * @return context of previous sibling | ||
104 | + */ | ||
105 | + YdtContext getPreviousSibling(); | ||
106 | + | ||
107 | + /** | ||
108 | + * Returns value of node, this is only valid for single instance leaf | ||
109 | + * node, to obtain the nature of the node protocols need to use | ||
110 | + * getYdtType(). | ||
111 | + * | ||
112 | + * @return value of node | ||
113 | + */ | ||
114 | + String getValue(); | ||
115 | + | ||
116 | + /** | ||
117 | + * Returns set of values of a node, this is only valid for multi instance | ||
118 | + * leaf node, to obtain the nature of the node protocols need to use | ||
119 | + * getYdtType(). | ||
120 | + * | ||
121 | + * @return value of YDT leaf | ||
122 | + */ | ||
123 | + Set<String> getValueSet(); | ||
124 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Represents type of YANG data tree node operation. | ||
21 | + * | ||
22 | + * This is used by protocols to specify edit operation associate with the node. | ||
23 | + * YMS data validation and data handling will vary based on the edit operation | ||
24 | + * type, for an instance, default leafs if not present in data should be added | ||
25 | + * if edit operation type is create and shouldn't be added if operation type is | ||
26 | + * delete. | ||
27 | + * Edit operation type is mapped to "operation type" of YANG utils generated | ||
28 | + * classes by YMS. | ||
29 | + * | ||
30 | + * In case of SBI driver/provider creates JAVA object (of YANG utils generated | ||
31 | + * classes) and specifies the edit operation type in "operation type" field. | ||
32 | + * YMS map this operation type to "edit operation type" of YDT, which will be | ||
33 | + * further encoded in corresponding data format. | ||
34 | + * | ||
35 | + * This is only applicable if YANG root level interaction type is EDIT_CONFIG. | ||
36 | + * If edit operation type is not specified when root interaction type is | ||
37 | + * EDIT_CONFIG then default operation type will be selected. | ||
38 | + * By default "default operation type" is "merge" unless explicitly specified | ||
39 | + * by protocol. | ||
40 | + */ | ||
41 | + | ||
42 | +/* | ||
43 | + * Edit operation type mapping with RESTCONF and NETCONF as example: | ||
44 | + * +----------+----------------------------+------------+ | ||
45 | + * | RESTCONF | NETCONF | EditOpType | | ||
46 | + * +----------+----------------------------+------------+ | ||
47 | + * | OPTIONS | none | NA | | ||
48 | + * | HEAD | none | NA | | ||
49 | + * | GET | <get-config>, <get> | NA | | ||
50 | + * | POST | (operation="create") | CREATE | | ||
51 | + * | PUT | (operation="replace") | REPLACE | | ||
52 | + * | PATCH | (operation="merge") | MERGE | | ||
53 | + * | DELETE | (operation="delete") | DELETE | | ||
54 | + * | none | (operation="remove") | REMOVE | | ||
55 | + * +----------+----------------------------+------------+ | ||
56 | + * Note: Additionally RESTCONF must use API resource to figure out whether | ||
57 | + * request contains data resource or it's for data model specific operation. | ||
58 | + * +--rw restconf | ||
59 | + * +--rw data | ||
60 | + * +--rw operations | ||
61 | + * Edit operation type is only applicable for data resource. | ||
62 | + * | ||
63 | + * Additionally protocols has to use operation type NONE to specify the URI | ||
64 | + * path. | ||
65 | + */ | ||
66 | +public enum YdtContextOperationType { | ||
67 | + | ||
68 | + /** | ||
69 | + * Type of YANG data tree action for below action: | ||
70 | + * The configuration data identified by the element | ||
71 | + * containing this attribute is added to the configuration if | ||
72 | + * and only if the configuration data does not already exist in | ||
73 | + * the configuration datastore. If the configuration data | ||
74 | + * exists, an error is returned. | ||
75 | + */ | ||
76 | + CREATE, | ||
77 | + | ||
78 | + /** | ||
79 | + * Type of YANG data tree action for below action: | ||
80 | + * The configuration data identified by the element | ||
81 | + * containing this attribute is deleted from the configuration | ||
82 | + * if and only if the configuration data currently exists in | ||
83 | + * the configuration datastore. If the configuration data does | ||
84 | + * not exist, an error is returned". | ||
85 | + */ | ||
86 | + DELETE, | ||
87 | + | ||
88 | + /** | ||
89 | + * Type of YANG data tree action for below action: | ||
90 | + * The configuration data identified by the element | ||
91 | + * containing this attribute is merged with the configuration | ||
92 | + * at the corresponding level in the configuration datastore. | ||
93 | + */ | ||
94 | + MERGE, | ||
95 | + | ||
96 | + /** | ||
97 | + * Type of YANG data tree action for below action: | ||
98 | + * The configuration data identified by the element | ||
99 | + * containing this attribute replaces any related configuration | ||
100 | + * in the configuration datastore. If no such configuration | ||
101 | + * data exists in the configuration datastore, it is created. | ||
102 | + */ | ||
103 | + REPLACE, | ||
104 | + | ||
105 | + /** | ||
106 | + * Type of YANG data tree action for below action: | ||
107 | + * The configuration data identified by the element | ||
108 | + * containing this attribute is deleted from the configuration | ||
109 | + * if the configuration data currently exists in the | ||
110 | + * configuration datastore. If the configuration data does not | ||
111 | + * exist, the "remove" operation is silently ignored by the | ||
112 | + * server. | ||
113 | + */ | ||
114 | + REMOVE, | ||
115 | + | ||
116 | + /** | ||
117 | + * The node is used as a containment node to reach the child node, | ||
118 | + * There is no change in the data store for the values of this node in the | ||
119 | + * edit request. | ||
120 | + */ | ||
121 | + NONE | ||
122 | +} | ||
123 | + |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Represents YANG context response information. It contains YDT node specific | ||
21 | + * information for operation response like error information, particular node | ||
22 | + * operation result etc. | ||
23 | + */ | ||
24 | +public interface YdtContextResponseInfo { | ||
25 | + //TODO | ||
26 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Represents type of YANG data tree node operation. | ||
21 | + */ | ||
22 | +public enum YdtExtendedInfoType { | ||
23 | + | ||
24 | + /** | ||
25 | + * It specifies operation type edit request for YDT node. It is used to | ||
26 | + * identify the YMS operation specific extended information associated | ||
27 | + * with YDT context. | ||
28 | + */ | ||
29 | + EDIT_REQUEST, | ||
30 | + | ||
31 | + /** | ||
32 | + * It specifies operation type RESPONSE for YDT node. It is used to | ||
33 | + * identify the YMS operation specific extended information associated | ||
34 | + * with YDT context. | ||
35 | + */ | ||
36 | + RESPONSE | ||
37 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity which provide call back methods which are called | ||
21 | + * by YDT walker while walking the YANG data tree. | ||
22 | + * | ||
23 | + * In a response to execute operation YMS returns the YMS operation results | ||
24 | + * with root YDT node. Now, protocols needs to walk through the YDT node and | ||
25 | + * constructs the corresponding data format string. Protocol can opt to use | ||
26 | + * listener or visitor based walking mechanism. | ||
27 | + * | ||
28 | + * This interface needs to be implemented by protocol implementing listener's | ||
29 | + * based call backs while YDT walk. | ||
30 | + */ | ||
31 | +public interface YdtListener { | ||
32 | + | ||
33 | + /** | ||
34 | + * YANG data tree node's entry, it will be called during a node entry. | ||
35 | + * All the related information about the node can be obtain from the YDT | ||
36 | + * context. | ||
37 | + * | ||
38 | + * @param ydtContext YANG data tree context | ||
39 | + */ | ||
40 | + void enterYdtNode(YdtContext ydtContext); | ||
41 | + | ||
42 | + /** | ||
43 | + * YANG data tree node's exit, it will be called during a node exit. | ||
44 | + * All the related information about the node can be obtain from the YDT | ||
45 | + * context. | ||
46 | + * | ||
47 | + * @param ydtContext YANG data tree context | ||
48 | + */ | ||
49 | + void exitYdtNode(YdtContext ydtContext); | ||
50 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Represents YANG management system results. Protocols sends request to | ||
21 | + * YANG management system for execution. YMS returns response in form of | ||
22 | + * YANG data tree response | ||
23 | + */ | ||
24 | +public interface YdtResponse extends Ydt { | ||
25 | + | ||
26 | + /** | ||
27 | + * Returns YANG management system operation result. This status of the | ||
28 | + * operation execution is returned | ||
29 | + * | ||
30 | + * @return YMS operation result | ||
31 | + */ | ||
32 | + YmsOperationExecutionStatus getYmsOperationResult(); | ||
33 | + | ||
34 | + /* | ||
35 | + * TODO: Applications layer error reporting to protocols. | ||
36 | + */ | ||
37 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Represents type of node in YANG data tree. Protocols based on input data | ||
21 | + * format provide this information to YMS during YDT building. YMS use this | ||
22 | + * information to carry out the validation against the schema information | ||
23 | + * obtained as a part of application registration. Also as a part of response | ||
24 | + * YMS encode this information in YDT node, protocol may use this information | ||
25 | + * while construction the data format string. | ||
26 | + * | ||
27 | + * Protocols unaware of node type like NETCONF, may opt not to provide this | ||
28 | + * information. | ||
29 | + */ | ||
30 | +public enum YdtType { | ||
31 | + | ||
32 | + /** | ||
33 | + * Single instance node. | ||
34 | + */ | ||
35 | + SINGLE_INSTANCE_NODE, | ||
36 | + | ||
37 | + /** | ||
38 | + * Multi instance node. | ||
39 | + */ | ||
40 | + MULTI_INSTANCE_NODE, | ||
41 | + | ||
42 | + /** | ||
43 | + * Single instance leaf node. | ||
44 | + */ | ||
45 | + SINGLE_INSTANCE_LEAF_VALUE_NODE, | ||
46 | + | ||
47 | + /** | ||
48 | + * Multi instance leaf node. | ||
49 | + */ | ||
50 | + MULTI_INSTANCE_LEAF_VALUE_NODE | ||
51 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity which provides interfaces for YDT walk. | ||
21 | + * | ||
22 | + * When YANG management system gets data from application to be returned | ||
23 | + * to protocol for any protocol operation or as a part of notification, YANG | ||
24 | + * management system encodes this data in a YANG data tree and sends the same | ||
25 | + * to protocol. | ||
26 | + * Protocols can use the YANG data tree walker utility to have their | ||
27 | + * callbacks to be invoked as per the YANG data tree walking. | ||
28 | + * By this way protocols can encode the data from abstract YANG data tree | ||
29 | + * into a protocol specific representation. | ||
30 | + * | ||
31 | + * YDT walker provides entry and exit callbacks for each node in YANG data | ||
32 | + * tree. | ||
33 | + */ | ||
34 | +public interface YdtWalker { | ||
35 | + | ||
36 | + /** | ||
37 | + * Walks the YANG data tree. Protocols implements YDT listener service | ||
38 | + * and walks YDT tree with input as implemented object. YDT walker provides | ||
39 | + * call backs to implemented methods. | ||
40 | + * | ||
41 | + * @param ydtListener YDT listener implemented by the protocol | ||
42 | + * @param rootNode root node of YDT | ||
43 | + */ | ||
44 | + void walk(YdtListener ydtListener, YdtContext rootNode); | ||
45 | +} |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ydt; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity which represents YANG management system operation | ||
21 | + * result. Once the protocol translates the request information into a abstract | ||
22 | + * YANG data tree, it uses YANG management system as a broker to get the | ||
23 | + * operation executed in ONOS. Protocols uses a request Yang management | ||
24 | + * system to delegate the operation request. | ||
25 | + * | ||
26 | + * YANG management system is responsible to split the protocol operation | ||
27 | + * across application(s) which needs to participate, and collate the | ||
28 | + * response(s) from application(s) and return an effective result of the | ||
29 | + * operation request. The result of the operation request is returned in | ||
30 | + * YMS operation result. | ||
31 | + */ | ||
32 | +public interface YmsOperationExecutionStatus { | ||
33 | + // TODO | ||
34 | +} |
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * Provides interfaces to build and obtain YANG data tree which is data | ||
19 | + * (sub)instance representation, abstract of protocol. | ||
20 | + * | ||
21 | + * NBI protocol implementation takes care of the protocol specific | ||
22 | + * operations. They are abstracted from the intricacies of understanding | ||
23 | + * the application identification or handling the interaction with | ||
24 | + * applications. | ||
25 | + * | ||
26 | + * NBI protocols need to handle the encoding and decoding of data to the | ||
27 | + * protocol specific format. They are unaware of the YANG of applications, | ||
28 | + * i.e. protocols are unaware of the data structure / organization in | ||
29 | + * applications. | ||
30 | + * | ||
31 | + * They need to translate the protocol operation request, into a protocol | ||
32 | + * independent abstract tree called the YANG data tree (YDT). In order to | ||
33 | + * enable the protocol in building these abstract data tree, YANG | ||
34 | + * management system provides a utility called the YANG data tree builder. | ||
35 | + * | ||
36 | + * Using the YANG data tree utility API's protocols are expected to walk | ||
37 | + * the data received in request and pass the information during the walk. | ||
38 | + * YANG data tree builder, identifies the application which supports the | ||
39 | + * request and validates it against the schema defined in YANG, and | ||
40 | + * constructs the abstract YANG data tree. | ||
41 | + */ | ||
42 | +package org.onosproject.yms.ydt; |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ymsm; | ||
18 | + | ||
19 | +/** | ||
20 | + * Represents type of root level operation for the request. | ||
21 | + * | ||
22 | + * This is used by protocols to specify the root level operation associated | ||
23 | + * with the request. YMS data validation and data handling will vary based | ||
24 | + * on the edit operation type, for an instance YANG specified "mandatory" | ||
25 | + * leafs needn't be present for QUERY_CONFIG and QUERY, but they may be | ||
26 | + * mandatory to be present in request for EDIT_CONFIG type. The validation | ||
27 | + * and handling is further dependent on edit operation type. | ||
28 | + * | ||
29 | + * In SBI, driver/provider must provide this information to YMS which needs | ||
30 | + * to encode this information in corresponding data format. | ||
31 | + * | ||
32 | + * YmsOperationType MUST be specified by protocol. | ||
33 | + */ | ||
34 | + | ||
35 | +/* | ||
36 | + * Yang interaction type with RESTCONF and NETCONF as example: | ||
37 | + * +--------------+-------------------+-------------+ | ||
38 | + * | RESTCONF | NETCONF | EditOpType | | ||
39 | + * +--------------+-------------------+-------------+ | ||
40 | + * | OPTIONS | NA | NA | | ||
41 | + * | HEAD | NA | NA | | ||
42 | + * | GET | <get> | QUERY | | ||
43 | + * | none | <get-config> | QUERY_CONFIG| | ||
44 | + * | POST (data) | <edit-config> | EDIT_CONFIG | | ||
45 | + * | PUT | <edit-config> | EDIT_CONFIG | | ||
46 | + * | PATCH | <edit-config> | EDIT_CONFIG | | ||
47 | + * | DELETE | <edit-config> | EDIT_CONFIG | | ||
48 | + * | POST (op) | <rpc> | RPC | | ||
49 | + * +--------------+-------------------+-------------+ | ||
50 | + * | ||
51 | + * Note: Additionally RESTCONF must use API resource to figure out whether | ||
52 | + * request contains data resource or it's for data model specific operation. | ||
53 | + * +--rw restconf | ||
54 | + * +--rw data | ||
55 | + * +--rw operations | ||
56 | + */ | ||
57 | +public enum YmsOperationType { | ||
58 | + /** | ||
59 | + * The YANG based request is to edit a config node / subtree in the data | ||
60 | + * store. | ||
61 | + */ | ||
62 | + EDIT_CONFIG, | ||
63 | + | ||
64 | + /** | ||
65 | + * The YANG based request is to query a config node / subtree in the data | ||
66 | + * store. | ||
67 | + */ | ||
68 | + QUERY_CONFIG, | ||
69 | + | ||
70 | + /** | ||
71 | + * The YANG based request is to query a node / subtree in the data store. | ||
72 | + */ | ||
73 | + QUERY, | ||
74 | + | ||
75 | + /** | ||
76 | + * The YANG based request is to execute an RPC defined in YANG. | ||
77 | + */ | ||
78 | + RPC, | ||
79 | + | ||
80 | + /** | ||
81 | + * The YANG based request is to execute an RPC defined in YANG. | ||
82 | + */ | ||
83 | + NOTIFICATION | ||
84 | +} |
This diff is collapsed. Click to expand it.
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * Provides interfaces to YANG application management system manager. YMSM is | ||
19 | + * manager of the YANG Core. | ||
20 | + * | ||
21 | + * In NBI, it acts as a broker in between the protocol and application, | ||
22 | + * here there is a separate protocol implementation, which does the conversion | ||
23 | + * of protocol representation to abstract data tree. The protocol | ||
24 | + * implementation takes care of the protocol specific actions for | ||
25 | + * e.g. RESTCONF handling the entity-tag / timestamp related operations. | ||
26 | + * | ||
27 | + * In SBI, driver or provider uses YANG codec handler as a utility to translate | ||
28 | + * the request information in java(YANG utils generated) to protocol specific | ||
29 | + * format and vice versa. | ||
30 | + */ | ||
31 | +package org.onosproject.yms.ymsm; |
1 | +/* | ||
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 | + | ||
17 | +package org.onosproject.yms.ynh; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity which provides interfaces to YANG notification | ||
21 | + * service. YNH handles notification from the application/core and provide | ||
22 | + * it to the protocols. | ||
23 | + * <p> | ||
24 | + * NBI Protocols which can support notification delivery for application(s) | ||
25 | + * needs to add themselves as a listeners with YANG notification service. | ||
26 | + * Protocols can use YANG notification service to check if a received | ||
27 | + * notification should be filtered against any of their protocol specific | ||
28 | + * filtering mechanism. | ||
29 | + */ | ||
30 | +public interface YangNotificationService { | ||
31 | + //TODO | ||
32 | +} |
1 | +/* | ||
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 | + | ||
17 | +/** | ||
18 | + * Provides interfaces to YANG notification handler. YNH handles notification | ||
19 | + * from the application and provide it to the protocols. | ||
20 | + */ | ||
21 | + | ||
22 | +/** | ||
23 | + * Provides interfaces to YANG notification service. | ||
24 | + * | ||
25 | + * NBI Protocols which can support notification delivery for application(s) | ||
26 | + * needs to add themselves as a listeners with YANG notification service. | ||
27 | + * Protocols can use YANG notification service to check if a received | ||
28 | + * notification should be filtered against any of their protocol specific | ||
29 | + * filtering mechanism. | ||
30 | + */ | ||
31 | +package org.onosproject.yms.ynh; |
apps/yms/app/BUCK
0 → 100644
apps/yms/app/app.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2015-present Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<app name="org.onosproject.yms" origin="ON.Lab" version="${project.version}" | ||
18 | + category="Utility" url="http://onosproject.org" title="YMS App" | ||
19 | + featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" | ||
20 | + features="${project.artifactId}"> | ||
21 | + <description>${project.description}</description> | ||
22 | + <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact> | ||
23 | + <artifact>mvn:${project.groupId}/onos-app-yms-api/${project.version}</artifact> | ||
24 | +</app> |
apps/yms/app/features.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2015-present Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}"> | ||
18 | + <feature name="${project.artifactId}" version="${project.version}" | ||
19 | + description="${project.description}"> | ||
20 | + <feature>onos-api</feature> | ||
21 | + <bundle>mvn:${project.groupId}/onos-app-yms-api/${project.version}</bundle> | ||
22 | + <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle> | ||
23 | + </feature> | ||
24 | +</features> |
apps/yms/app/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2015-present Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <artifactId>onos-yms</artifactId> | ||
24 | + <groupId>org.onosproject</groupId> | ||
25 | + <version>1.7.0-SNAPSHOT</version> | ||
26 | + </parent> | ||
27 | + | ||
28 | + <artifactId>onos-app-yms</artifactId> | ||
29 | + <packaging>bundle</packaging> | ||
30 | + | ||
31 | + <url>http://onosproject.org</url> | ||
32 | + | ||
33 | + <description>YANG management system application</description> | ||
34 | + | ||
35 | + <dependencies> | ||
36 | + <dependency> | ||
37 | + <groupId>org.onosproject</groupId> | ||
38 | + <artifactId>onos-app-yms-api</artifactId> | ||
39 | + <version>${project.version}</version> | ||
40 | + </dependency> | ||
41 | + | ||
42 | + <dependency> | ||
43 | + <groupId>org.onosproject</groupId> | ||
44 | + <artifactId>onlab-junit</artifactId> | ||
45 | + <scope>test</scope> | ||
46 | + </dependency> | ||
47 | + | ||
48 | + <dependency> | ||
49 | + <groupId>org.onosproject</groupId> | ||
50 | + <artifactId>onos-api</artifactId> | ||
51 | + <classifier>tests</classifier> | ||
52 | + <scope>test</scope> | ||
53 | + </dependency> | ||
54 | + </dependencies> | ||
55 | + | ||
56 | +</project> |
apps/yms/pom.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2015-present Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <groupId>org.onosproject</groupId> | ||
24 | + <artifactId>onos-apps</artifactId> | ||
25 | + <version>1.7.0-SNAPSHOT</version> | ||
26 | + </parent> | ||
27 | + | ||
28 | + <artifactId>onos-yms</artifactId> | ||
29 | + <packaging>pom</packaging> | ||
30 | + | ||
31 | + <description>ONOS YANG management system</description> | ||
32 | + | ||
33 | + <modules> | ||
34 | + <module>api</module> | ||
35 | + <module>app</module> | ||
36 | + </modules> | ||
37 | + | ||
38 | +</project> |
-
Please register or login to post a comment