VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Foundation |
VinodKumarS-Huawei | af9c7a7 | 2016-08-30 19:43:39 +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 | package org.onosproject.yms.ynh; |
| 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
| 19 | |
| 20 | /** |
| 21 | * Represents YANG notification event. |
| 22 | * |
| 23 | * YANG notification handler listens for the notification from the application. |
| 24 | * It convert the received notification in YANG notification events. |
| 25 | * |
| 26 | * YangNotificationEvent represents event generated by YANG management system |
| 27 | * in response to the YANG defined application notification. The applications |
| 28 | * notification information is in abstract YANG data tree. |
| 29 | */ |
| 30 | public class YangNotificationEvent |
| 31 | extends AbstractEvent<YangNotificationEvent.Type, YangNotification> { |
| 32 | |
| 33 | /** |
| 34 | * Event type is the notification as defined in the YANG file. |
| 35 | */ |
| 36 | public enum Type { |
| 37 | /** |
| 38 | * Indicates a YANG notification. |
| 39 | */ |
| 40 | YANG_NOTIFICATION |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * YANG notification information shared to NBI protocol in YANG data tree |
| 45 | * using the registered callback. |
| 46 | * |
| 47 | * @param subject notification information in YANG data tree. |
| 48 | */ |
| 49 | public YangNotificationEvent(YangNotification subject) { |
| 50 | super(Type.YANG_NOTIFICATION, subject); |
| 51 | } |
| 52 | } |