blob: 2adfb09dbe058f0bb6625e3ace9d32ced320e64e [file] [log] [blame]
tom64b7aac2014-08-26 00:18:21 -07001package org.onlab.onos.net.host;
2
3import org.onlab.onos.event.AbstractEvent;
4import org.onlab.onos.net.Host;
5
6/**
7 * Describes end-station host event.
8 */
9public 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 /**
tom7869ad92014-09-09 14:32:08 -070026 * Signifies that host data changed, e.g. IP address
27 */
28 HOST_UPDATED,
29
30 /**
tom64b7aac2014-08-26 00:18:21 -070031 * 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}