|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.dacopan.model.TransferUnit
public class TransferUnit
A unit of transfer (packet, segment etc) for a specific protocol.
Field Summary | |
---|---|
protected java.util.List |
children
units that this unit consists of (can be null) |
protected Host |
destination
destination host |
protected boolean |
dropped
whether this unit was dropped or not |
protected Flow |
flow
the flow this units belongs to (might be null) |
protected long |
id
unique identifier |
protected TransferUnit |
parent
parent unit, which this unit is a part of (can be null) |
protected Protocol |
protocol
the protocol this unit belongs to |
protected float |
receiveEnd
time when unit was fully received |
protected float |
receiveStart
time when receiving this unit started |
protected float |
sendEnd
time when unit was fully sent |
protected float |
sendStart
time when sending of unit started |
protected Host |
source
source host |
protected java.util.Map |
values
protocol fields and other values associated with this unit, mapped by name |
Constructor Summary | |
---|---|
protected |
TransferUnit(long id,
java.util.Map values,
Protocol protocol,
Flow flow,
Host source,
Host destination,
boolean dropped)
|
|
TransferUnit(long id,
java.util.Map values,
Protocol protocol,
Flow flow,
Host source,
Host destination,
float sendStart,
float receiveEnd,
boolean dropped)
Constructor for lower-level units with their own timestamps. |
|
TransferUnit(long id,
java.util.Map values,
Protocol protocol,
Flow flow,
Host source,
Host destination,
java.util.List children,
boolean dropped)
Constructor for higher level units with children. |
Method Summary | |
---|---|
protected void |
addInitialValues(java.util.Map values)
Called from the constructor, adds all the values in the map given by the user to the actual value map (makes the values not specific to any host). |
void |
addVariableValue(java.lang.String name,
Host host,
java.lang.String value)
Adds a variable value to this unit. |
void |
addVariableValue(VariableDefinition def,
Host host,
java.lang.String value)
|
protected void |
assignChildren()
Assigns itself as the parent of its children. |
protected void |
calculateTimestamps()
Calculates the timestamps of this unit by looking at its children. |
int |
compareTo(java.lang.Object o)
TransferUnits are ordered primarily by sendStart, then by receiveEnd. |
boolean |
equals(java.lang.Object o)
|
java.util.List |
getChildren()
Returns the children units of this unit (ordered by default ordering ). |
Host |
getDestination()
Returns the destination host of this unit. |
Flow |
getFlow()
Returns the flow this unit belongs to (may be null). |
long |
getId()
Returns the unique identifier of this object. |
TransferUnit |
getParent()
Returns the parent of this unit (may be null) |
int |
getPayloadSize()
Calculates the payload data length in this transfer unit. |
Protocol |
getProtocol()
Returns the protocol of this unit. |
float |
getReceiveEnd()
Returns the time this unit was fully received. |
float |
getReceiveStart()
Returns the time the destination host started to receive this unit. |
TransferUnit |
getRoot()
Returns the root of the TransferUnit tree this unit belongs to. |
float |
getSendEnd()
Returns the time the sending of this unit was completed. |
float |
getSendStart()
Returns the time this unit was sent. |
Host |
getSource()
Returns the source host of this unit. |
java.lang.String |
getValue(VariableDefinition variable)
Gets the value of the given variable (ignoring if it's host-specific). |
java.lang.String |
getValue(VariableDefinition variable,
Host host)
Returns the value of the given variable. |
java.lang.String |
getValueReceive(VariableDefinition variable)
Gets the value of the given variable (specific to the destination host). |
java.lang.String |
getValueSend(VariableDefinition variable)
Gets the value of the given variable (specific to the source host). |
boolean |
isDropped()
Returns true if this unit was dropped. |
boolean |
isOneUnit()
Returns true if unit's sending and receiving are both just points in time and not time intervals where start and end times are not equal. |
void |
setParent(TransferUnit parent)
Sets the parent unit of this unit. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected long id
protected TransferUnit parent
protected java.util.List children
protected java.util.Map values
protected Protocol protocol
protected Flow flow
protected Host source
protected Host destination
protected float sendStart
protected float sendEnd
protected float receiveStart
protected float receiveEnd
protected boolean dropped
Constructor Detail |
---|
protected TransferUnit(long id, java.util.Map values, Protocol protocol, Flow flow, Host source, Host destination, boolean dropped)
TransferUnit(long, Map, Protocol, Flow, Host, Host, float, float, boolean)
public TransferUnit(long id, java.util.Map values, Protocol protocol, Flow flow, Host source, Host destination, float sendStart, float receiveEnd, boolean dropped)
id
- unique id of the unitvalues
- map (String->String) of variable names and values of this unit (not specific to any host)protocol
- of the unitflow
- (protocol-specific connection) of the unitsource
- hostdestination
- hostsendStart
- time when sending of unit startedreceiveEnd
- time when unit was fully receiveddropped
- whether the unit was droppedpublic TransferUnit(long id, java.util.Map values, Protocol protocol, Flow flow, Host source, Host destination, java.util.List children, boolean dropped)
children
- list of children unitsTransferUnit(long, Map, Protocol, Flow, Host, Host, float, float, boolean)
Method Detail |
---|
public long getId()
Identifiable
getId
in interface Identifiable
public void addVariableValue(java.lang.String name, Host host, java.lang.String value)
name
- name of the variablehost
- the value's specific to, use null
if nonevalue
- of the variablepublic void addVariableValue(VariableDefinition def, Host host, java.lang.String value)
addVariableValue(String, Host, String)
public java.lang.String getValue(VariableDefinition variable)
public java.lang.String getValueSend(VariableDefinition variable)
public java.lang.String getValueReceive(VariableDefinition variable)
public java.lang.String getValue(VariableDefinition variable, Host host)
variable
- whose value to returnhost
- to whom the value is specific (if any)
public Protocol getProtocol()
public Flow getFlow()
public Host getSource()
public Host getDestination()
public java.util.List getChildren()
default ordering
).
public float getSendStart()
public float getReceiveEnd()
public float getSendEnd()
getSendStart()
.
public float getReceiveStart()
public TransferUnit getParent()
public TransferUnit getRoot()
this
if parent is nullpublic void setParent(TransferUnit parent)
public int getPayloadSize()
Calculates the payload data length in this transfer unit. Calculation is based on protocol specific header variables and uses the following formulas:
ipv4: tot_len - 4 * ihlOther protocols are not supported.
public boolean isDropped()
public boolean isOneUnit()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected void calculateTimestamps()
protected void assignChildren()
protected void addInitialValues(java.util.Map values)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |