blob: e604e5374064224d8f07fe7a5101a2d05ed330f7 [file] [log] [blame]
Jonathan Hart4f60f982014-10-27 08:11:17 -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 */
16package org.onlab.onos.net.packet;
17
18import org.onlab.onos.event.AbstractEvent;
19
20/**
21 * Describes a packet event.
22 */
23public class PacketEvent extends AbstractEvent<PacketEvent.Type, OutboundPacket> {
24
25 /**
26 * Type of packet events.
27 */
28 public enum Type {
29 /**
30 * Signifies that the packet should be emitted out a local port.
31 */
32 EMIT
33 }
34
35 /**
36 * Creates an event of the given type for the specified packet.
37 *
38 * @param type the type of the event
39 * @param packet the packet the event is about
40 */
41 public PacketEvent(Type type, OutboundPacket packet) {
42 super(type, packet);
43 }
44
45 /**
46 * Creates an event of the given type for the specified packet at the given
47 * time.
48 *
49 * @param type the type of the event
50 * @param packet the packet the event is about
51 * @param time the time of the event
52 */
53 public PacketEvent(Type type, OutboundPacket packet, long time) {
54 super(type, packet, time);
55 }
56}