blob: 6737f686d2169a6c75a441883e06da143c537335 [file] [log] [blame]
tom73d6d1e2014-09-17 20:08:01 -07001package org.onlab.onos.cluster;
2
3import org.onlab.onos.event.AbstractEvent;
4
5/**
6 * Describes cluster-related event.
7 */
8public class ClusterEvent extends AbstractEvent<ClusterEvent.Type, ControllerInstance> {
9
10 /**
11 * Type of device events.
12 */
13 public enum Type {
14 /**
15 * Signifies that a new cluster instance has been administratively added.
16 */
17 INSTANCE_ADDED,
18
19 /**
20 * Signifies that a cluster instance has been administratively removed.
21 */
22 INSTANCE_REMOVED,
23
24 /**
25 * Signifies that a cluster instance became active.
26 */
27 INSTANCE_ACTIVE,
28
29 /**
30 * Signifies that a cluster instance became inactive.
31 */
32 INSTANCE_INACTIVE
33 }
34 // TODO: do we need to fix the verv/adjective mix? discuss
35
36 /**
37 * Creates an event of a given type and for the specified instance and the
38 * current time.
39 *
40 * @param type cluster event type
41 * @param instance cluster device subject
42 */
43 public ClusterEvent(Type type, ControllerInstance instance) {
44 super(type, instance);
45 }
46
47 /**
48 * Creates an event of a given type and for the specified device and time.
49 *
50 * @param type device event type
51 * @param instance event device subject
52 * @param time occurrence time
53 */
54 public ClusterEvent(Type type, ControllerInstance instance, long time) {
55 super(type, instance, time);
56 }
57
58}