tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.link; |
| 2 | |
| 3 | import org.onlab.onos.event.AbstractEvent; |
| 4 | import org.onlab.onos.net.Link; |
| 5 | |
| 6 | /** |
| 7 | * Describes infrastructure link event. |
| 8 | */ |
| 9 | public class LinkEvent extends AbstractEvent<LinkEvent.Type, Link> { |
| 10 | |
| 11 | /** |
| 12 | * Type of link events. |
| 13 | */ |
| 14 | public enum Type { |
| 15 | /** |
| 16 | * Signifies that a new link has been detected. |
| 17 | */ |
| 18 | LINK_ADDED, |
| 19 | |
| 20 | /** |
tom | d176fc4 | 2014-09-08 00:12:30 -0700 | [diff] [blame] | 21 | * Signifies that a link has been updated. |
| 22 | */ |
| 23 | LINK_UPDATED, |
| 24 | |
| 25 | /** |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 26 | * Signifies that a link has been removed. |
| 27 | */ |
| 28 | LINK_REMOVED |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Creates an event of a given type and for the specified link and the |
| 33 | * current time. |
| 34 | * |
| 35 | * @param type link event type |
| 36 | * @param link event link subject |
| 37 | */ |
| 38 | public LinkEvent(Type type, Link link) { |
| 39 | super(type, link); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Creates an event of a given type and for the specified link and time. |
| 44 | * |
| 45 | * @param type link event type |
| 46 | * @param link event link subject |
| 47 | * @param time occurrence time |
| 48 | */ |
| 49 | public LinkEvent(Type type, Link link, long time) { |
| 50 | super(type, link, time); |
| 51 | } |
| 52 | |
| 53 | } |