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 org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.netvirt.natservice.internal.NaptPacketInHandler.NatPacketProcessingState;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
14 import org.opendaylight.yangtools.yang.common.Uint32;
16 public class NAPTEntryEvent {
17 private final String ipAddress;
18 private final int portNumber;
19 private final Uint32 routerId;
20 private String flowDpn;
21 private final Operation op;
22 private final Protocol protocol;
23 private final PacketReceived packetReceived;
24 private final boolean pktProcessed;
25 private final long objectCreationTime;
26 private final NatPacketProcessingState state;
28 NAPTEntryEvent(String ipAddress, int portNumber, Uint32 routerId, Operation op, Protocol protocol,
29 @Nullable PacketReceived packetReceived, boolean pktProcessed, @Nullable NatPacketProcessingState state) {
30 this.ipAddress = ipAddress;
31 this.portNumber = portNumber;
32 this.routerId = routerId;
34 this.protocol = protocol;
35 this.packetReceived = packetReceived;
36 this.pktProcessed = pktProcessed;
38 this.objectCreationTime = System.currentTimeMillis();
41 NAPTEntryEvent(String ipAddress, int portNumber, String flowDpn, Uint32 routerId, Operation op, Protocol protocol) {
43 this.ipAddress = ipAddress;
44 this.portNumber = portNumber;
45 this.routerId = routerId;
46 this.flowDpn = flowDpn;
47 this.protocol = protocol;
48 this.packetReceived = null;
49 this.pktProcessed = false;
51 this.objectCreationTime = System.currentTimeMillis();
54 public PacketReceived getPacketReceived() {
55 return packetReceived;
58 public boolean isPktProcessed() {
62 public String getIpAddress() {
66 public int getPortNumber() {
70 public Uint32 getRouterId() {
74 public String getFlowDpn() {
78 public Operation getOperation() {
82 public Protocol getProtocol() {
86 public long getObjectCreationTime() {
87 return objectCreationTime;
90 public NatPacketProcessingState getState() {
94 public enum Operation {
98 public enum Protocol {