X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fpacket%2FRawPacket.java;h=a7956d81b3d178ffa5b0a06052e000de1a389fa3;hp=d5189021830b30fb98bdf0b3390a9f86a3f1c7d4;hb=e2f7aaa41e482815ca1d4495eb85c8653cd903ab;hpb=f9348fbdc543a48ac7575b6f9498bdeb23691561 diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/RawPacket.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/RawPacket.java index d518902183..a7956d81b3 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/RawPacket.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/RawPacket.java @@ -31,10 +31,10 @@ import org.opendaylight.controller.sal.core.TimeStamp; */ public class RawPacket { private byte[] packetData; - private LinkEncap encap; - private TimeStamp incomingTime; - private TimeStamp copyTime; - private Map props; + private final LinkEncap encap; + private final TimeStamp incomingTime; + private final TimeStamp copyTime; + private Map props; private NodeConnector incomingNodeConnector; private NodeConnector outgoingNodeConnector; @@ -103,7 +103,7 @@ public class RawPacket { */ public void setProps(Object key, Object value) { if (this.props == null) { - this.props = new HashMap(); + this.props = new HashMap(); } this.props.put(key, value); @@ -157,7 +157,8 @@ public class RawPacket { this.incomingTime = src.getIncomingTime(); this.incomingNodeConnector = src.getIncomingNodeConnector(); this.outgoingNodeConnector = src.getOutgoingNodeConnector(); - this.props = (src.props == null ? null : new HashMap(src.props)); + this.props = (src.props == null ? null : new HashMap( + src.props)); this.copyTime = new TimeStamp(System.currentTimeMillis(), "CopyTime"); } @@ -173,9 +174,9 @@ public class RawPacket { } /** - * Read the timestamp when the packet has entered the system + * Read the time stamp when the packet has entered the system * - * @return The timestamp when the packet has entered the system + * @return The time stamp when the packet has entered the system */ public TimeStamp getIncomingTime() { return this.incomingTime; @@ -199,4 +200,15 @@ public class RawPacket { public byte[] getPacketData() { return this.packetData; } + + /** + * Returns the time at which the current instance of RawPacket was created + * as a copy of the original one. + * + * @return The time stamp at which this RawPacket instance was created. null + * if this is the original instance. + */ + public TimeStamp getCopyTime() { + return this.copyTime; + } }