Gaurav Agrawal | b102b01 | 2016-08-02 12:52:48 +0530 | [diff] [blame] | 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 | } |