edu.colorado.cs.ns2.agents
Class TCPAgent

java.lang.Object
  extended by edu.colorado.cs.ns2.agents.Agent
      extended by edu.colorado.cs.ns2.agents.TCPAgent
All Implemented Interfaces:
java.io.Serializable

public class TCPAgent
extends Agent

This is the implementation of NS2's TCP (Source) Agent.

Author:
Kevin Bauer, Pushkar Sambhoos
See Also:
Serialized Form

Nested Class Summary
private  class TCPAgent.TCPAgentPropertiesDialog
          This nested class creates and displays a dialog box allowing the user to interactively set the TCP Agent's properties.
 
Field Summary
private  int class_
          NS2's TCP class_ TCL variable.
private  int fid_
          NS2's TCP fid_ (flow identifier) TCL variable.
private  int packetSize_
          NS2's packetSize_ TCL variable.
private static long serialVersionUID
          Generated serial version UID.
 
Fields inherited from class edu.colorado.cs.ns2.agents.Agent
acceptableConnectAgents, agentId, agentName, applications, isConnected, nodeId, variableName
 
Constructor Summary
TCPAgent(int nextId, int NodeId)
          Constructor.
 
Method Summary
 boolean canHaveMultipleConnections()
          Returns True if the TCPAgent can have multiple connections.
 int getClass_()
          Returns the TCL class_ variabile's value.
 int getFid_()
          Returns the flow identifier.
 int getPacketSize_()
          Returns the packet size.
private  void setAcceptableAgents()
          Set list of acceptable agents that a TCPAgent can connect to
 void setAgentProperties()
          Allows the user to interactively set the TCP Agent's properties.
 void setClass_(java.lang.String class_)
          Sets the value of the TCL class_ variable.
 void setFid_(java.lang.String fid_)
          Sets the flow identifier.
 void setPacketSize_(java.lang.String packetSize)
          Sets the packet size.
 java.lang.String toString()
          Returns a String representation of the current object.
 java.lang.String writeAgentProperties()
          Returns a TCP representation of the Agent's properties.
 
Methods inherited from class edu.colorado.cs.ns2.agents.Agent
addAgentToScript, canConnectToAgent, getAgentId, getAgentName, getApplications, getApplicationsElementAt, getNodeId, getVariableName, isConnected, removeApplicationsElement, removeApplicationsElementAt, setAgentId, setApplications, setConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated serial version UID.

See Also:
Constant Field Values

class_

private int class_
NS2's TCP class_ TCL variable.


fid_

private int fid_
NS2's TCP fid_ (flow identifier) TCL variable.


packetSize_

private int packetSize_
NS2's packetSize_ TCL variable.

Constructor Detail

TCPAgent

public TCPAgent(int nextId,
                int NodeId)
Constructor.

Parameters:
nextId - The next available globally unique identifier.
NodeId - The node identifier for the node on which the Agent resides.
Method Detail

setAcceptableAgents

private void setAcceptableAgents()
Set list of acceptable agents that a TCPAgent can connect to


toString

public java.lang.String toString()
Returns a String representation of the current object.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of the current object.

getClass_

public int getClass_()
Returns the TCL class_ variabile's value.

Returns:
the TCL class_ variable's value.

setClass_

public void setClass_(java.lang.String class_)
Sets the value of the TCL class_ variable.

Parameters:
class_ - A new class value.

getFid_

public int getFid_()
Returns the flow identifier.

Returns:
The flow identifier.

setFid_

public void setFid_(java.lang.String fid_)
Sets the flow identifier.

Parameters:
fid_ - A new flow identifier.

getPacketSize_

public int getPacketSize_()
Returns the packet size.

Returns:
The packet size.

setPacketSize_

public void setPacketSize_(java.lang.String packetSize)
Sets the packet size.

Parameters:
packetSize - A new packet size.

canHaveMultipleConnections

public boolean canHaveMultipleConnections()
Returns True if the TCPAgent can have multiple connections. This method always returns True.

Overrides:
canHaveMultipleConnections in class Agent
Returns:
Returns true if the current Agent can support multiple connections.

setAgentProperties

public void setAgentProperties()
Allows the user to interactively set the TCP Agent's properties.

Specified by:
setAgentProperties in class Agent

writeAgentProperties

public java.lang.String writeAgentProperties()
Description copied from class: Agent
Returns a TCP representation of the Agent's properties.

Specified by:
writeAgentProperties in class Agent
Returns:
Returns a TCP representation of the Agent's properties.