edu.colorado.cs.ns2.agents
Class UDPAgent

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

public class UDPAgent
extends Agent

This is the implementation of the UDP Agent.

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

Nested Class Summary
private  class UDPAgent.UDPAgentPropertiesDialog
          A nested class for creating and displaying a dialog box in which to retrieve the properties for a UDP Agent.
 
Field Summary
private  int class_
          NS2's UDP class_ TCL variable.
private  int fid_
          NS2's UDP fid_ (flow identifier) 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
UDPAgent(int nextId, int nodeId)
          Constructor.
 
Method Summary
 boolean canHaveMultipleConnections()
          Returns True if the current Agent may have multiple connections.
 int getClass_()
          Returns the value of the class_ TCL variable.
 int getFid_()
          Returns the flow identifier.
private  void setAcceptableAgents()
          Sets the list of acceptable agents to which a UDPAgent may connect.
 void setAgentProperties()
          Sets the Agents properties via a dialog box.
 void setClass_(java.lang.String class_)
          Sets the value of the TCL class_ variable.
 void setFid_(java.lang.String fid_)
          Sets the flow identifier.
 java.lang.String toString()
          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

fid_

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


class_

private int class_
NS2's UDP class_ TCL variable.

Constructor Detail

UDPAgent

public UDPAgent(int nextId,
                int nodeId)
Constructor.

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

setAcceptableAgents

private void setAcceptableAgents()
Sets the list of acceptable agents to which a UDPAgent may connect.


toString

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

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

canHaveMultipleConnections

public boolean canHaveMultipleConnections()
Returns True if the current Agent may have multiple connections. Always returns True for type UDPAgent.

Overrides:
canHaveMultipleConnections in class Agent
Returns:
True if the current Agent may have multiple connections. Always returns True for type UDPAgent.

getClass_

public int getClass_()
Returns the value of the class_ TCL variable.

Returns:
The value of the class_ TCL variable.

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.

setAgentProperties

public void setAgentProperties()
Sets the Agents properties via a dialog box.

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.