edu.colorado.cs.ns2.agents
Class TCPSink

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

public class TCPSink
extends Agent

This is the implementation of NS2's TCPSink Agent.

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

Field Summary
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
TCPSink(int id, int NodeId)
          Constructor.
 
Method Summary
private  void setAcceptableAgents()
          Set list of acceptable agents that a TCPAgent can connect to
 void setAgentProperties()
          Sets the TCPSink's properties.
 java.lang.String toString()
          A String representation of this 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, canHaveMultipleConnections, 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
Constructor Detail

TCPSink

public TCPSink(int id,
               int NodeId)
Constructor.

Parameters:
id - The next available globally unique identifier.
NodeId - The identifier of the node on which this 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()
A String representation of this object.

Overrides:
toString in class java.lang.Object

setAgentProperties

public void setAgentProperties()
Sets the TCPSink's properties. The TCPSink Agent has no properties, so this method is empty.

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.