blob: 72ab5bfe5e18be77fd23f75a87b4ffa68eb44ced [file] [log] [blame]
VinodKumarS-Huaweiaf9c7a72016-08-30 19:43:39 +05301/*
Brian O'Connor0a4e6742016-09-15 23:03:10 -07002 * Copyright 2016-present Open Networking Laboratory
VinodKumarS-Huaweiaf9c7a72016-08-30 19:43:39 +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.ynh;
18
19import org.onosproject.yms.ydt.YdtContext;
20
21/**
22 * Represents YANG notification which is a subject of YANG based event.
23 *
24 * YMS add themselves as a listener to applications. Application sends
25 * their notification in YANG utils generated notification. YMS obtains
26 * the module/sub-module schema tree in which this notification is contained
27 * and then convert this data to an abstract tree notation (YDT) with root
28 * node as the logical node with name "yangnotification" it contains
29 * module/sub-module node in which notification is contained.
30 * It sends the same to all the protocol who has added them as a listener
31 * as a YANG notification.
32 *
33 * This class represents YANG notification which contains the
34 * notification context in abstract tree notation.
35 */
36public class YangNotification {
37
38 /**
39 * YANG notification in form of abstract tree notation (YDT)
40 * Root node of notification root context will be logical node with
41 * name as "yangnotification", it contains module/sub-module node
42 * in which notification is contained.
43 */
44 YdtContext notificationRootContext;
45
46 /**
47 * Creates an instance of YANG notification subject.
48 *
49 * @param notificationContext logical root node with name as
50 * "yangnotification"
51 */
52 public YangNotification(YdtContext notificationContext) {
53 this.notificationRootContext = notificationContext;
54 }
55
56 /**
57 * Assign the YANG modeled notification data.
58 *
59 * @param notificationRootContext YANG data tree containing the data for
60 * the notification
61 */
62 public void setNotificationRootContext(YdtContext notificationRootContext) {
63 this.notificationRootContext = notificationRootContext;
64 }
65
66 /**
67 * Returns YANG notification data.
68 *
69 * @return YANG data tree containing the data for the notification
70 */
71 public YdtContext getNotificationRootContext() {
72 return notificationRootContext;
73 }
74}