blob: 05ed0c42d6db90d512aa8926bd530d864f0f0fa2 [file] [log] [blame]
Sithara Punnasseryff114552017-01-10 11:40:55 -08001/*
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 */
16package org.onosproject.config;
17
18
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080019import org.onosproject.config.model.ResourceId;
Sithara Punnasseryff114552017-01-10 11:40:55 -080020import org.onosproject.event.AbstractEvent;
21
22/**
23 * Describes a DynamicConfig change event.
24 */
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080025public class DynamicConfigEvent extends AbstractEvent<DynamicConfigEvent.Type, ResourceId> {
Sithara Punnasseryff114552017-01-10 11:40:55 -080026
27 /**
28 * Type of configuration events.
29 * A configuration instance could be a leaf node or a subtree,
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080030 * identified by the subject, ResourceId.
Sithara Punnasseryff114552017-01-10 11:40:55 -080031 */
32 public enum Type {
33 /**
34 * Signifies that a dynamic configuration instance was added.
35 */
36 NODE_ADDED,
37
38 /**
39 * Signifies that dynamic configuration instance was updated.
40 */
41 NODE_UPDATED,
42
43 /**
44 * Signifies that dynamic configuration instance was replaced.
45 */
46 NODE_REPLACED,
47
48 /**
49 * Signifies that dynamic configuration instance was removed.
50 */
51 NODE_DELETED
52 }
53
54 /**
55 * Creates an event of a given type, config node value and config node path.
56 *
57 * @param type config node type
58 * @param path config node path
59 */
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080060 public DynamicConfigEvent(Type type, ResourceId path) {
Sithara Punnasseryff114552017-01-10 11:40:55 -080061 super(type, path);
62 }
63}