Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.packet; |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.event.AbstractEvent; |
Jonathan Hart | 4f60f98 | 2014-10-27 08:11:17 -0700 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * Describes a packet event. |
| 22 | */ |
| 23 | public 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 | } |