Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.link; |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.event.AbstractEvent; |
| 19 | import org.onosproject.net.Link; |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * Describes infrastructure link event. |
| 23 | */ |
| 24 | public class LinkEvent extends AbstractEvent<LinkEvent.Type, Link> { |
| 25 | |
| 26 | /** |
| 27 | * Type of link events. |
| 28 | */ |
| 29 | public enum Type { |
| 30 | /** |
| 31 | * Signifies that a new link has been detected. |
| 32 | */ |
| 33 | LINK_ADDED, |
| 34 | |
| 35 | /** |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 36 | * Signifies that a link has been updated or changed state. |
tom | d176fc4 | 2014-09-08 00:12:30 -0700 | [diff] [blame] | 37 | */ |
| 38 | LINK_UPDATED, |
| 39 | |
| 40 | /** |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 41 | * Signifies that a link has been removed. |
| 42 | */ |
| 43 | LINK_REMOVED |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Creates an event of a given type and for the specified link and the |
| 48 | * current time. |
| 49 | * |
| 50 | * @param type link event type |
| 51 | * @param link event link subject |
| 52 | */ |
| 53 | public LinkEvent(Type type, Link link) { |
| 54 | super(type, link); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Creates an event of a given type and for the specified link and time. |
| 59 | * |
| 60 | * @param type link event type |
| 61 | * @param link event link subject |
| 62 | * @param time occurrence time |
| 63 | */ |
| 64 | public LinkEvent(Type type, Link link, long time) { |
| 65 | super(type, link, time); |
| 66 | } |
| 67 | |
| 68 | } |