blob: 75b4497fc899b4f6699c3939b5a8bd0ae6da64d1 [file] [log] [blame]
wei wei89ddc322015-03-22 16:29:04 -05001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
wei wei89ddc322015-03-22 16:29:04 -05003 *
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 */
Thomas Vachuskabf916ea2015-05-20 18:24:34 -070016
17package org.onosproject.incubator.net.tunnel;
wei wei89ddc322015-03-22 16:29:04 -050018
Brian O'Connor2bed5ce2015-06-25 15:10:28 -040019import com.google.common.annotations.Beta;
wei wei89ddc322015-03-22 16:29:04 -050020import org.onosproject.event.AbstractEvent;
21
22/**
23 * Describes tunnel events.
24 */
Brian O'Connor2bed5ce2015-06-25 15:10:28 -040025@Beta
jcc4a20a5f2015-04-30 15:43:39 +080026public final class TunnelEvent extends AbstractEvent<TunnelEvent.Type, Tunnel> {
wei wei89ddc322015-03-22 16:29:04 -050027
28 /**
29 * Type of tunnel events.
30 */
31 public enum Type {
32 /**
33 * Signifies that a new tunnel has been added.
34 */
35 TUNNEL_ADDED,
36
37 /**
38 * Signifies that a tunnel has been updated or changed state.
39 */
40 TUNNEL_UPDATED,
41
42 /**
43 * Signifies that a tunnel has been removed.
44 */
45 TUNNEL_REMOVED
46 }
47
48 /**
49 * Creates an event of a given type and for the specified tunnel.
50 *
51 * @param type tunnel event type
52 * @param tunnel event tunnel subject
53 */
54 public TunnelEvent(Type type, Tunnel tunnel) {
55 super(type, tunnel);
56 }
57
58 /**
59 * Creates an event of a given type and for the specified link and
60 * the current time.
61 *
62 * @param type tunnel event type
63 * @param tunnel event tunnel subject
64 * @param time occurrence time
65 */
66 public TunnelEvent(Type type, Tunnel tunnel, long time) {
67 super(type, tunnel, time);
68 }
69
70}