tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.net.device; |
| 2 | |
| 3 | import org.onlab.onos.event.AbstractEvent; |
| 4 | import org.onlab.onos.net.Device; |
| 5 | |
| 6 | /** |
| 7 | * Describes infrastructure device event. |
| 8 | */ |
| 9 | public class DeviceEvent extends AbstractEvent<DeviceEvent.Type, Device> { |
| 10 | |
| 11 | /** |
| 12 | * Type of device events. |
| 13 | */ |
| 14 | public enum Type { |
| 15 | /** Signifies that a new device has been detected. */ |
| 16 | DEVICE_ADDED, |
| 17 | |
| 18 | /** Signifies that a device has been removed. */ |
| 19 | DEVICE_REMOVED, |
| 20 | |
| 21 | /** Signifies that a device has been administratively suspended. */ |
| 22 | DEVICE_SUSPENDED, |
| 23 | |
| 24 | /** Signifies that a device has come online or has gone offline. */ |
| 25 | DEVICE_AVAILABILITY_CHANGED, |
| 26 | |
| 27 | /** |
| 28 | * Signifies that the current controller instance relationship has |
| 29 | * changed with respect to a device. |
| 30 | */ |
| 31 | DEVICE_MASTERSHIP_CHANGED |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Creates an event of a given type and for the specified subject and the |
| 36 | * current time. |
| 37 | * |
| 38 | * @param type event type |
| 39 | * @param subject event subject |
| 40 | */ |
| 41 | public DeviceEvent(Type type, Device subject) { |
| 42 | super(type, subject); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Creates an event of a given type and for the specified subject and time. |
| 47 | * |
| 48 | * @param type event type |
| 49 | * @param subject event subject |
| 50 | * @param time occurrence time |
| 51 | */ |
| 52 | public DeviceEvent(Type type, Device subject, long time) { |
| 53 | super(type, subject, time); |
| 54 | } |
| 55 | |
| 56 | } |