2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netvirt.natservice.internal;
11 import javax.annotation.Nullable;
12 import org.opendaylight.netvirt.natservice.internal.NaptPacketInHandler.NatPacketProcessingState;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
15 public class NAPTEntryEvent {
16 private final String ipAddress;
17 private final int portNumber;
18 private final Long routerId;
19 private final Operation op;
20 private final Protocol protocol;
21 private final PacketReceived packetReceived;
22 private final boolean pktProcessed;
23 private final long objectCreationTime;
24 private final NatPacketProcessingState state;
26 NAPTEntryEvent(String ipAddress, int portNumber, Long routerId, Operation op, Protocol protocol,
27 @Nullable PacketReceived packetReceived, boolean pktProcessed, @Nullable NatPacketProcessingState state) {
28 this.ipAddress = ipAddress;
29 this.portNumber = portNumber;
30 this.routerId = routerId;
32 this.protocol = protocol;
33 this.packetReceived = packetReceived;
34 this.pktProcessed = pktProcessed;
36 this.objectCreationTime = System.currentTimeMillis();
39 NAPTEntryEvent(String ipAddress, int portNumber, Long routerId, Operation op, Protocol protocol) {
41 this.ipAddress = ipAddress;
42 this.portNumber = portNumber;
43 this.routerId = routerId;
44 this.protocol = protocol;
45 this.packetReceived = null;
46 this.pktProcessed = false;
48 this.objectCreationTime = System.currentTimeMillis();
51 public PacketReceived getPacketReceived() {
52 return packetReceived;
55 public boolean isPktProcessed() {
59 public String getIpAddress() {
63 public int getPortNumber() {
67 public Long getRouterId() {
71 public Operation getOperation() {
75 public Protocol getProtocol() {
79 public long getObjectCreationTime() {
80 return objectCreationTime;
83 public NatPacketProcessingState getState() {
87 public enum Operation {
91 public enum Protocol {