tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 1 | package org.onlab.onos.event; |
| 2 | |
| 3 | /** |
tom | 96dfcab | 2014-08-28 09:26:03 -0700 | [diff] [blame] | 4 | * Abstraction of an of a time-stamped event pertaining to an arbitrary subject. |
tom | e33cc1a | 2014-08-25 21:59:41 -0700 | [diff] [blame] | 5 | */ |
| 6 | public interface Event<T extends Enum, S extends Object> { |
| 7 | |
| 8 | /** |
| 9 | * Returns the timestamp of when the event occurred, given in milliseconds |
| 10 | * since the start of epoch. |
| 11 | * |
| 12 | * @return timestamp in milliseconds |
| 13 | */ |
| 14 | long time(); |
| 15 | |
| 16 | /** |
| 17 | * Returns the type of the event. |
| 18 | * |
| 19 | * @return event type |
| 20 | */ |
| 21 | T type(); |
| 22 | |
| 23 | /** |
| 24 | * Returns the subject of the event. |
| 25 | * |
| 26 | * @return subject to which this event pertains |
| 27 | */ |
| 28 | S subject(); |
| 29 | |
| 30 | } |