blob: 24d32213989e983f78f46cbf07f630fb8f6b3da7 [file] [log] [blame]
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -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.net.group;
17
18import org.onosproject.event.AbstractEvent;
19
20/**
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080021 * Describes group events.
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080022 */
23public class GroupEvent extends AbstractEvent<GroupEvent.Type, Group> {
24
25 /**
26 * Type of flow rule events.
27 */
28 public enum Type {
29 /**
30 * Signifies that a new Group has been detected.
31 */
32 GROUP_ADDED,
33
34 /**
35 * Signifies that a Group has been removed.
36 */
37 GROUP_REMOVED,
38
39 /**
40 * Signifies that a Group has been updated.
41 */
42 GROUP_UPDATED,
43
sangho7ff01812015-02-09 16:21:53 -080044 /**
45 * Signifies that a request to create Group has failed.
46 */
47 GROUP_ADD_FAILED,
48
49 /**
50 * Signifies that a request to remove Group has failed.
51 */
52 GROUP_REMOVE_FAILED,
53
54 /**
55 * Signifies that a request to update Group has failed.
56 */
57 GROUP_UPDATE_FAILED,
58
helenyrwu89470f12016-08-12 13:18:10 -070059 /**
60 * Signifies change in the first live bucket in failover group
61 * (i.e. change in which bucket is in use).
62 * Only to be used with failover Group.
63 */
64 GROUP_BUCKET_FAILOVER,
65
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080066 // internal event between Manager <-> Store
67
68 /*
69 * Signifies that a request to create Group has been added to the store.
70 */
71 GROUP_ADD_REQUESTED,
72 /*
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080073 * Signifies that a request to update Group has been added to the store.
74 */
75 GROUP_UPDATE_REQUESTED,
76 /*
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080077 * Signifies that a request to delete Group has been added to the store.
78 */
79 GROUP_REMOVE_REQUESTED,
sangho7ff01812015-02-09 16:21:53 -080080
81
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080082 }
83
84 /**
85 * Creates an event of a given type and for the specified Group and the
86 * current time.
87 *
88 * @param type Group event type
89 * @param group event subject
90 */
91 public GroupEvent(Type type, Group group) {
92 super(type, group);
93 }
94
95 /**
96 * Creates an event of a given type and for the specified Group and time.
97 *
98 * @param type Group event type
99 * @param group event subject
100 * @param time occurrence time
101 */
102 public GroupEvent(Type type, Group group, long time) {
103 super(type, group, time);
104 }
105
106}