blob: bbba9838e3dd572d4369f91c6e4a9d451fc63fbf [file] [log] [blame]
yoonseonfe721972017-01-10 17:18:49 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
yoonseonfe721972017-01-10 17:18:49 -08003 *
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 */
16
17package org.onosproject.incubator.net.virtual.event;
18
19import org.onosproject.event.AbstractEvent;
20import org.onosproject.event.Event;
21import org.onosproject.incubator.net.virtual.NetworkId;
22
23/**
24 * Base class for virtual network event that encapsulates a normal event.
25 */
26public class VirtualEvent<E extends Event>
27 extends AbstractEvent<VirtualEvent.Type, E> {
28
29 private NetworkId networkId;
30
31 /**
32 * Type of virtual network events.
33 */
34 public enum Type {
35 /**
36 * A new virtual event has been posted.
37 */
38 POSTED
39 }
40
41 protected VirtualEvent(NetworkId networkId, Type type, E subject) {
42 super(type, subject);
43 this.networkId = networkId;
44 }
45
46 protected VirtualEvent(NetworkId networkId, Type type, E subject, long time) {
47 super(type, subject, time);
48 this.networkId = networkId;
49 }
50
51 public NetworkId networkId() {
52 return networkId;
53 }
54}