tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.host; |
| 2 | |
| 3 | import org.onlab.onos.event.AbstractEvent; |
| 4 | import org.onlab.onos.net.Host; |
| 5 | |
| 6 | /** |
| 7 | * Describes end-station host event. |
| 8 | */ |
| 9 | public class HostEvent extends AbstractEvent<HostEvent.Type, Host> { |
| 10 | |
| 11 | /** |
| 12 | * Type of host events. |
| 13 | */ |
| 14 | public enum Type { |
| 15 | /** |
| 16 | * Signifies that a new host has been detected. |
| 17 | */ |
| 18 | HOST_ADDED, |
| 19 | |
| 20 | /** |
| 21 | * Signifies that a host has been removed. |
| 22 | */ |
| 23 | HOST_REMOVED, |
| 24 | |
| 25 | /** |
tom | 7869ad9 | 2014-09-09 14:32:08 -0700 | [diff] [blame] | 26 | * Signifies that host data changed, e.g. IP address |
| 27 | */ |
| 28 | HOST_UPDATED, |
| 29 | |
| 30 | /** |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 31 | * Signifies that a host location has changed. |
| 32 | */ |
| 33 | HOST_MOVED |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Creates an event of a given type and for the specified host and the |
| 38 | * current time. |
| 39 | * |
| 40 | * @param type host event type |
| 41 | * @param host event host subject |
| 42 | */ |
| 43 | public HostEvent(Type type, Host host) { |
| 44 | super(type, host); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Creates an event of a given type and for the specified host and time. |
| 49 | * |
| 50 | * @param type host event type |
| 51 | * @param host event host subject |
| 52 | * @param time occurrence time |
| 53 | */ |
| 54 | public HostEvent(Type type, Host host, long time) { |
| 55 | super(type, host, time); |
| 56 | } |
| 57 | |
| 58 | } |