blob: a2e513e8d2289e0fa2bdbe8b98777a8f6694e857 [file] [log] [blame]
Sithara Punnasseryff114552017-01-10 11:40:55 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Sithara Punnasseryff114552017-01-10 11:40:55 -08003 *
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 */
16package org.onosproject.config;
17
18
Sithara Punnassery06208792017-02-10 16:25:29 -080019import com.google.common.annotations.Beta;
Sithara Punnassery4b091dc2017-03-02 17:22:40 -080020import org.onosproject.yang.model.ResourceId;
Sithara Punnasseryff114552017-01-10 11:40:55 -080021import org.onosproject.event.AbstractEvent;
22
23/**
24 * Describes a DynamicConfig change event.
25 */
Sithara Punnassery06208792017-02-10 16:25:29 -080026@Beta
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080027public class DynamicConfigEvent extends AbstractEvent<DynamicConfigEvent.Type, ResourceId> {
Sithara Punnasseryff114552017-01-10 11:40:55 -080028
29 /**
30 * Type of configuration events.
31 * A configuration instance could be a leaf node or a subtree,
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080032 * identified by the subject, ResourceId.
Sithara Punnasseryff114552017-01-10 11:40:55 -080033 */
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 Punnassery44e2a702017-03-06 15:38:10 -080053 NODE_DELETED,
54
55 /**
Yuta HIGUCHI24057822017-08-02 15:03:51 -070056 * Signifies an unknown and hence invalid store operation.
Sithara Punnassery44e2a702017-03-06 15:38:10 -080057 */
58 UNKNOWN_OPRN
Sithara Punnasseryff114552017-01-10 11:40:55 -080059 }
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 Punnassery9306e6b2017-02-06 15:38:19 -080067 public DynamicConfigEvent(Type type, ResourceId path) {
Sithara Punnasseryff114552017-01-10 11:40:55 -080068 super(type, path);
69 }
70}