blob: 33c1a52f0ae96de467a0d722adfda1ae556fac23 [file] [log] [blame]
Gaurav Agrawalb102b012016-08-02 12:52:48 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Gaurav Agrawalb102b012016-08-02 12:52:48 +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.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.
VinodKumarS-Huawei7b1733c2016-10-25 13:44:26 +053022 * <p>
Gaurav Agrawalb102b012016-08-02 12:52:48 +053023 * 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.
VinodKumarS-Huawei7b1733c2016-10-25 13:44:26 +053027 * <p>
Gaurav Agrawalb102b012016-08-02 12:52:48 +053028 * This interface needs to be implemented by protocol implementing listener's
29 * based call backs while YDT walk.
30 */
31public 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}