blob: 41b36a47061d9fc70db76a87de3e08f5ecba6db4 [file] [log] [blame]
wei wei89ddc322015-03-22 16:29:04 -05001/*
2 * Copyright 2015 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 */
16package org.onosproject.net.tunnel;
17
18import org.onosproject.event.AbstractEvent;
19
20/**
21 * Describes tunnel events.
22 */
23public class TunnelEvent extends AbstractEvent<TunnelEvent.Type, Tunnel> {
24
25 /**
26 * Type of tunnel events.
27 */
28 public enum Type {
29 /**
30 * Signifies that a new tunnel has been added.
31 */
32 TUNNEL_ADDED,
33
34 /**
35 * Signifies that a tunnel has been updated or changed state.
36 */
37 TUNNEL_UPDATED,
38
39 /**
40 * Signifies that a tunnel has been removed.
41 */
42 TUNNEL_REMOVED
43 }
44
45 /**
46 * Creates an event of a given type and for the specified tunnel.
47 *
48 * @param type tunnel event type
49 * @param tunnel event tunnel subject
50 */
51 public TunnelEvent(Type type, Tunnel tunnel) {
52 super(type, tunnel);
53 }
54
55 /**
56 * Creates an event of a given type and for the specified link and
57 * the current time.
58 *
59 * @param type tunnel event type
60 * @param tunnel event tunnel subject
61 * @param time occurrence time
62 */
63 public TunnelEvent(Type type, Tunnel tunnel, long time) {
64 super(type, tunnel, time);
65 }
66
67}