blob: a03125fb364a55ca55a9306124b202c63083dad3 [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 Punnassery06208792017-02-10 16:25:29 -080019import com.google.common.annotations.Beta;
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080020import org.onosproject.config.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 */
53 NODE_DELETED
54 }
55
56 /**
57 * Creates an event of a given type, config node value and config node path.
58 *
59 * @param type config node type
60 * @param path config node path
61 */
Sithara Punnassery9306e6b2017-02-06 15:38:19 -080062 public DynamicConfigEvent(Type type, ResourceId path) {
Sithara Punnasseryff114552017-01-10 11:40:55 -080063 super(type, path);
64 }
65}