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;
15 public class NAPTEntryEvent {
16 private final String ipAddress;
17 private final int portNumber;
18 private final Long routerId;
19 private String flowDpn;
20 private final Operation op;
21 private final Protocol protocol;
22 private final PacketReceived packetReceived;
23 private final boolean pktProcessed;
24 private final long objectCreationTime;
25 private final NatPacketProcessingState state;
27 NAPTEntryEvent(String ipAddress, int portNumber, Long routerId, Operation op, Protocol protocol,
28 @Nullable PacketReceived packetReceived, boolean pktProcessed, @Nullable NatPacketProcessingState state) {
29 this.ipAddress = ipAddress;
30 this.portNumber = portNumber;
31 this.routerId = routerId;
33 this.protocol = protocol;
34 this.packetReceived = packetReceived;
35 this.pktProcessed = pktProcessed;
37 this.objectCreationTime = System.currentTimeMillis();
40 NAPTEntryEvent(String ipAddress, int portNumber, String flowDpn, Long routerId, Operation op, Protocol protocol) {
42 this.ipAddress = ipAddress;
43 this.portNumber = portNumber;
44 this.routerId = routerId;
45 this.flowDpn = flowDpn;
46 this.protocol = protocol;
47 this.packetReceived = null;
48 this.pktProcessed = false;
50 this.objectCreationTime = System.currentTimeMillis();
53 public PacketReceived getPacketReceived() {
54 return packetReceived;
57 public boolean isPktProcessed() {
61 public String getIpAddress() {
65 public int getPortNumber() {
69 public Long getRouterId() {
73 public String getFlowDpn() {
77 public Operation getOperation() {
81 public Protocol getProtocol() {
85 public long getObjectCreationTime() {
86 return objectCreationTime;
89 public NatPacketProcessingState getState() {
93 public enum Operation {
97 public enum Protocol {