blob: d078fcb74f1adda3067dcd6b94ba26c5ec4112a7 [file] [log] [blame]
Toshio Koideb8cea262014-08-12 18:45:46 -07001package net.onrc.onos.api.flowmanager;
2
3import static com.google.common.base.Preconditions.checkNotNull;
4
5import java.util.Set;
6
7import com.google.common.collect.ImmutableSet;
8
9/**
10 * The event class which notifies the set of the flow state transitions.
11 */
12public class FlowStatesChangedEvent {
13 private final long time;
14 private final Set<FlowStateChange> changes;
15
16 /**
17 * Creates the {@link FlowStatesChangedEvent} instance.
18 *
19 * @param time the time at which the event was created in milliseconds since start of epoch
20 * @param changes the set of {@link FlowStateChange} objects
21 */
22 FlowStatesChangedEvent(long time, Set<FlowStateChange> changes) {
23 this.time = time;
24 this.changes = ImmutableSet.copyOf(checkNotNull(changes));
25 }
26
27 /**
28 * Gets the time at which the event was created.
29 *
30 * @return the time at which the event was created in milliseconds since start of epoch
31 */
32 public long getTime() {
33 return time;
34 }
35
36 /**
37 * Gets the set of state changes happened at once.
38 *
39 * @return the set of {@link FlowStateChange} objects
40 */
41 public Set<FlowStateChange> getStateChanges() {
42 return changes;
43 }
44}