Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [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 | |
Claudine Chiu | 31ad527 | 2016-02-17 20:56:24 +0000 | [diff] [blame] | 17 | package org.onosproject.net.key; |
Brian Stanke | aa6211a | 2016-02-04 18:22:54 -0500 | [diff] [blame] | 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onosproject.event.AbstractEvent; |
| 21 | |
| 22 | /** |
| 23 | * Describes device key events. |
| 24 | */ |
| 25 | @Beta |
| 26 | public class DeviceKeyEvent extends AbstractEvent<DeviceKeyEvent.Type, DeviceKey> { |
| 27 | |
| 28 | /** |
| 29 | * Type of device key events. |
| 30 | */ |
| 31 | public enum Type { |
| 32 | /** |
| 33 | * Signals that a new device key has been added. |
| 34 | */ |
| 35 | DEVICE_KEY_ADDED, |
| 36 | |
| 37 | /** |
| 38 | * Signals that a device key has been updated or changed state. |
| 39 | */ |
| 40 | DEVICE_KEY_UPDATED, |
| 41 | |
| 42 | /** |
| 43 | * Signals that a device key has been removed. |
| 44 | */ |
| 45 | DEVICE_KEY_REMOVED |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Creates an event of a given type, and for the specified device key. |
| 50 | * |
| 51 | * @param type device key event type |
| 52 | * @param deviceKey event device key subject |
| 53 | */ |
| 54 | public DeviceKeyEvent(Type type, DeviceKey deviceKey) { |
| 55 | super(type, deviceKey); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Creates an event of a given type, for the specified device key, and |
| 60 | * the current time. |
| 61 | * |
| 62 | * @param type device key event type |
| 63 | * @param deviceKey event device key subject |
| 64 | * @param time occurrence time |
| 65 | */ |
| 66 | public DeviceKeyEvent(Type type, DeviceKey deviceKey, long time) { |
| 67 | super(type, deviceKey, time); |
| 68 | } |
| 69 | } |