blob: 1eb1dc34dffb057639983a9d9bac9e8ba51a4da3 [file] [log] [blame]
Sithara Punnassery589fac22016-10-03 11:51:53 -07001/*
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.incubator.elasticcfg;
17
18import org.onosproject.event.AbstractEvent;
19
20/**
21 * Describes a ProprietaryConfig event.
22 */
23public class ElasticConfigEvent extends AbstractEvent<ElasticConfigEvent.Type, ConfigNodePath> {
24
25 private final ConfigNode value;
26
27 /**
28 * Type of configuration events.
29 */
30 public enum Type {
31 /**
32 * Signifies that a prop configuration instance was added.
33 */
34 NODE_ADDED,
35
36 /**
37 * Signifies that prop configuration instance was updated.
38 */
39 NODE_UPDATED,
40
41 /**
42 * Signifies that prop configuration instance was removed.
43 */
44 NODE_REMOVED,
45 /**
46 * Signifies that a prop configuration subtree was added.
47 */
48 SUBTREE_ADDED,
49
50 /**
51 * Signifies that prop configuration subtree was updated.
52 */
53 SUBTREE_UPDATED,
54
55 /**
56 * Signifies that prop configuration subtree was removed.
57 */
58 SUBTREE_REMOVED
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 * @param value config node value
67 */
68 public ElasticConfigEvent(Type type, ConfigNodePath path, ConfigNode value) {
69 super(type, path);
70 this.value = value;
71 }
72
73 /**
74 * Returns the config node value.
75 *
76 * @return ConfigNode value
77 */
78 public ConfigNode value() {
79 return value;
80 }
81}