blob: b164b9ea34fd16ad5f2410e7f66b397790d9682c [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 */
tom64b7aac2014-08-26 00:18:21 -070016package org.onlab.onos.net.link;
17
18import org.onlab.onos.event.AbstractEvent;
19import org.onlab.onos.net.Link;
20
21/**
22 * Describes infrastructure link event.
23 */
24public 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 /**
tomd176fc42014-09-08 00:12:30 -070036 * Signifies that a link has been updated.
37 */
38 LINK_UPDATED,
39
40 /**
tom64b7aac2014-08-26 00:18:21 -070041 * 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}