Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.net.group; |
| 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
| 19 | |
| 20 | /** |
Srikanth Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 21 | * Describes group events. |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 22 | */ |
| 23 | public 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 | |
sangho | 7ff0181 | 2015-02-09 16:21:53 -0800 | [diff] [blame] | 44 | /** |
| 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 | |
helenyrwu | 89470f1 | 2016-08-12 13:18:10 -0700 | [diff] [blame] | 59 | /** |
| 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 Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 66 | // 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 Vavilapalli | 0599d51 | 2015-01-30 12:57:56 -0800 | [diff] [blame] | 73 | * Signifies that a request to update Group has been added to the store. |
| 74 | */ |
| 75 | GROUP_UPDATE_REQUESTED, |
| 76 | /* |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 77 | * Signifies that a request to delete Group has been added to the store. |
| 78 | */ |
| 79 | GROUP_REMOVE_REQUESTED, |
sangho | 7ff0181 | 2015-02-09 16:21:53 -0800 | [diff] [blame] | 80 | |
| 81 | |
Srikanth Vavilapalli | 56db94f | 2015-01-22 22:30:17 -0800 | [diff] [blame] | 82 | } |
| 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 | } |