Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.flowmanager; |
| 2 | |
| 3 | /** |
| 4 | * Event class which notifies the state change of flow batch operation. |
| 5 | */ |
| 6 | public class FlowBatchStateChangedEvent { |
| 7 | private final long time; |
| 8 | private final FlowBatchHandle handle; |
| 9 | private final FlowBatchState current; |
| 10 | private final FlowBatchState previous; |
| 11 | |
| 12 | /** |
| 13 | * Creates the {@link FlowBatchStateChangedEvent} instance. |
| 14 | * |
| 15 | * @param time the time at which the event was created in milliseconds since |
| 16 | * start of epoch |
| 17 | * @param handle the handle for the flow batch operation |
| 18 | * @param current the current state of the flow batch operation |
| 19 | * @param previous the previous state of the flow batch operation |
| 20 | */ |
| 21 | FlowBatchStateChangedEvent(long time, FlowBatchHandle handle, |
| 22 | FlowBatchState current, FlowBatchState previous) { |
| 23 | this.time = time; |
| 24 | this.handle = handle; |
| 25 | this.current = current; |
| 26 | this.previous = previous; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Gets the time at which the event was created. |
| 31 | * |
| 32 | * @return the time in milliseconds since start of epoch |
| 33 | */ |
| 34 | public long getTime() { |
| 35 | return time; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Gets the handle for the flow batch operation. |
| 40 | * |
| 41 | * @return the handle for the flow batch operation |
| 42 | */ |
| 43 | public FlowBatchHandle getFlowBatchHandle() { |
| 44 | return handle; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Gets the current state of the flow batch operation. |
| 49 | * |
| 50 | * @return the current state of the flow batch operation |
| 51 | */ |
| 52 | public FlowBatchState getCurrentState() { |
| 53 | return current; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Gets the previous state of the flow batch operation. |
| 58 | * |
| 59 | * @return the previous state of the flow batch operation |
| 60 | */ |
| 61 | public FlowBatchState getPreviousState() { |
| 62 | return previous; |
| 63 | } |
| 64 | } |