public class Flow
extends java.lang.Object
Flow represents a network flow based on 5-tuple: | Modifier and Type | Field and Description |
|---|---|
private long |
flowEndTime
Timestamp of end of the flow.
|
private int |
flowID
Identifier of the flow.
|
private long |
flowStartTime
Timestamp of start of the flow.
|
private long |
lastUpdatedTime
Timestamp showing when the flow was updated last time.
|
private java.util.ArrayList<CapturedPacket> |
listOfPackets
List of packets assigned to the flow.
|
private java.lang.String |
localIP
Local IP address of the flow.
|
private int |
localPort
Local transport layer port of the flow.
|
private static org.apache.log4j.Logger |
log
Used to log different events.
|
private static int |
MAX_NO_PACKETS
Maximum number of packets in flow.
|
private java.lang.String |
protocolName
Transport layer protocol name of the flow.
|
private java.lang.String |
remoteIP
Remote IP address of the flow.
|
private int |
remotePort
Remote transport layer port of the flow.
|
private java.lang.String |
socketAppName
Application name taken from system socket associated with the flow.
|
| Constructor and Description |
|---|
Flow(CapturedPacket newCapturedPacket)
Constructs the object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPacket(CapturedPacket newCapturedPacket)
Adds packet to the flow.
|
long |
getFlowEndTime()
Gets end time of the flow.
|
int |
getFlowID()
Gets the identifier of the flow.
|
long |
getFlowStartTime()
Gets start time of the flow.
|
long |
getLastUpdatedTime()
Sets timestamp when the flow was updated last time.
|
java.lang.String |
getLocalIP()
Gets local IP address of the flow.
|
int |
getLocalPort()
Gets local transport layer port of the flow.
|
int |
getNoPackets()
Gets number of packets associated with this flow.
|
java.util.ArrayList<CapturedPacket> |
getPackets()
Gets all the packets associated with the flow.
|
java.lang.String |
getProtocolName()
Gets transport layer protocol name.
|
java.lang.String |
getRemoteIP()
Gets remote IP address of the flow.
|
int |
getRemotePort()
Gets remote transport layer port of the flow.
|
java.lang.String |
getSocketAppName()
Gets application name associated with the flow.
|
void |
setFlowEndTime(long flowEndTime)
Sets end time of the flow.
|
private void |
setFlowID(int flowID)
Sets identifier of the flow.
|
void |
setFlowStartTime(long flowStartTime)
Sets start time of the flow.
|
private void |
setLocalIP(java.lang.String localIP)
Sets local IP address of the flow.
|
private void |
setLocalPort(int localPort)
Sets local transport layer port of the flow.
|
private void |
setProtocolName(java.lang.String protocolName)
Set transport layer protocol name.
|
private void |
setRemoteIP(java.lang.String remoteIP)
Sets remote IP address of the flow.
|
private void |
setRemotePort(int remotePort)
Sets remote transport layer port of the flow.
|
void |
setSocketAppName(java.lang.String socketAppName)
Sets application name associated with the flow.
|
private static org.apache.log4j.Logger log
private static final int MAX_NO_PACKETS
private int flowID
private long flowStartTime
private long flowEndTime
private java.lang.String localIP
private java.lang.String remoteIP
private int localPort
private int remotePort
private java.lang.String protocolName
private java.lang.String socketAppName
private java.util.ArrayList<CapturedPacket> listOfPackets
private long lastUpdatedTime
public Flow(CapturedPacket newCapturedPacket)
newCapturedPacket - the first packet, based on which the flow will be createdpublic int getFlowID()
public java.lang.String getLocalIP()
public java.lang.String getRemoteIP()
public int getLocalPort()
public int getRemotePort()
public java.lang.String getProtocolName()
private void setLocalIP(java.lang.String localIP)
localIP - local IP addressprivate void setRemoteIP(java.lang.String remoteIP)
remoteIP - remote IP addressprivate void setLocalPort(int localPort)
localPort - local tranport layer portprivate void setRemotePort(int remotePort)
remotePort - remote transport layer portprivate void setProtocolName(java.lang.String protocolName)
protocolName - transport layer protocol namepublic int getNoPackets()
public long getFlowStartTime()
public long getFlowEndTime()
public java.lang.String getSocketAppName()
public java.util.ArrayList<CapturedPacket> getPackets()
public void setSocketAppName(java.lang.String socketAppName)
socketAppName - application namepublic void setFlowStartTime(long flowStartTime)
flowStartTime - timestamp in microsecondspublic void setFlowEndTime(long flowEndTime)
flowEndTime - timestamp in microsecondspublic long getLastUpdatedTime()
public boolean addPacket(CapturedPacket newCapturedPacket)
newCapturedPacket - packet, which is supposed to be added to the flowtrue if the packet was added, false otherwiseprivate void setFlowID(int flowID)
flowID - identifier of the flow