Sithara Punnassery | ff11455 | 2017-01-10 11:40:55 -0800 | [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 | package org.onosproject.config; |
| 17 | |
| 18 | |
Sithara Punnassery | 0620879 | 2017-02-10 16:25:29 -0800 | [diff] [blame] | 19 | import com.google.common.annotations.Beta; |
Sithara Punnassery | 4b091dc | 2017-03-02 17:22:40 -0800 | [diff] [blame] | 20 | import org.onosproject.yang.model.ResourceId; |
Sithara Punnassery | ff11455 | 2017-01-10 11:40:55 -0800 | [diff] [blame] | 21 | import org.onosproject.event.AbstractEvent; |
| 22 | |
| 23 | /** |
| 24 | * Describes a DynamicConfig change event. |
| 25 | */ |
Sithara Punnassery | 0620879 | 2017-02-10 16:25:29 -0800 | [diff] [blame] | 26 | @Beta |
Sithara Punnassery | 9306e6b | 2017-02-06 15:38:19 -0800 | [diff] [blame] | 27 | public class DynamicConfigEvent extends AbstractEvent<DynamicConfigEvent.Type, ResourceId> { |
Sithara Punnassery | ff11455 | 2017-01-10 11:40:55 -0800 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Type of configuration events. |
| 31 | * A configuration instance could be a leaf node or a subtree, |
Sithara Punnassery | 9306e6b | 2017-02-06 15:38:19 -0800 | [diff] [blame] | 32 | * identified by the subject, ResourceId. |
Sithara Punnassery | ff11455 | 2017-01-10 11:40:55 -0800 | [diff] [blame] | 33 | */ |
| 34 | public enum Type { |
| 35 | /** |
| 36 | * Signifies that a dynamic configuration instance was added. |
| 37 | */ |
| 38 | NODE_ADDED, |
| 39 | |
| 40 | /** |
| 41 | * Signifies that dynamic configuration instance was updated. |
| 42 | */ |
| 43 | NODE_UPDATED, |
| 44 | |
| 45 | /** |
| 46 | * Signifies that dynamic configuration instance was replaced. |
| 47 | */ |
| 48 | NODE_REPLACED, |
| 49 | |
| 50 | /** |
| 51 | * Signifies that dynamic configuration instance was removed. |
| 52 | */ |
Sithara Punnassery | 44e2a70 | 2017-03-06 15:38:10 -0800 | [diff] [blame] | 53 | NODE_DELETED, |
| 54 | |
| 55 | /** |
| 56 | * Signifies an unknown and hence invalid store opeartion. |
| 57 | */ |
| 58 | UNKNOWN_OPRN |
Sithara Punnassery | ff11455 | 2017-01-10 11:40:55 -0800 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Creates an event of a given type, config node value and config node path. |
| 63 | * |
| 64 | * @param type config node type |
| 65 | * @param path config node path |
| 66 | */ |
Sithara Punnassery | 9306e6b | 2017-02-06 15:38:19 -0800 | [diff] [blame] | 67 | public DynamicConfigEvent(Type type, ResourceId path) { |
Sithara Punnassery | ff11455 | 2017-01-10 11:40:55 -0800 | [diff] [blame] | 68 | super(type, path); |
| 69 | } |
| 70 | } |