blob: 23aa97b56643ad33159f42106a43e82f7ea6fe59 [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
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080059 // internal event between Manager <-> Store
60
61 /*
62 * Signifies that a request to create Group has been added to the store.
63 */
64 GROUP_ADD_REQUESTED,
65 /*
Srikanth Vavilapalli0599d512015-01-30 12:57:56 -080066 * Signifies that a request to update Group has been added to the store.
67 */
68 GROUP_UPDATE_REQUESTED,
69 /*
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080070 * Signifies that a request to delete Group has been added to the store.
71 */
72 GROUP_REMOVE_REQUESTED,
sangho7ff01812015-02-09 16:21:53 -080073
74
Srikanth Vavilapalli56db94f2015-01-22 22:30:17 -080075 }
76
77 /**
78 * Creates an event of a given type and for the specified Group and the
79 * current time.
80 *
81 * @param type Group event type
82 * @param group event subject
83 */
84 public GroupEvent(Type type, Group group) {
85 super(type, group);
86 }
87
88 /**
89 * Creates an event of a given type and for the specified Group and time.
90 *
91 * @param type Group event type
92 * @param group event subject
93 * @param time occurrence time
94 */
95 public GroupEvent(Type type, Group group, long time) {
96 super(type, group, time);
97 }
98
99}