es.upv.dsic.gti_ia.core
Class AgentID

java.lang.Object
  extended by es.upv.dsic.gti_ia.core.AgentID
All Implemented Interfaces:
Serializable, Cloneable

public final class AgentID
extends Object
implements Serializable, Cloneable

Represents an identifier used to univocally recognize an agent.

See Also:
Serialized Form

Field Summary
 String host
           
 String name
           
 String port
           
 String protocol
           
 
Constructor Summary
AgentID()
          Empty constructor.
AgentID(String id)
          Constructor allows a input like http://nombreagente@localhost:8080 or a input like AgentName, in this case there are defaults options, like protocol = "qpid", host="localhost", port="8080".
AgentID(String __name, String __protocol, String __host, String __port)
          Constructor for the ID.
 
Method Summary
 String addresses_all()
          Builds a string identifying this agent.
 String getLocalName()
          Builds a string identifying this agent.
 String name_all()
          Builds a string identifying this agent.
 String toString()
          Creates a String containing the ID as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public String name

protocol

public String protocol

host

public String host

port

public String port
Constructor Detail

AgentID

public AgentID()
Empty constructor.


AgentID

public AgentID(String __name,
               String __protocol,
               String __host,
               String __port)
Constructor for the ID.

Parameters:
__name - The name of the agent.
__protocol - The protocol being used.
__host - The host where the agent is located.
__port - The port in the host where the agent can listen for messages.
See Also:
AgentID(String)

AgentID

public AgentID(String id)
Constructor allows a input like http://nombreagente@localhost:8080 or a input like AgentName, in this case there are defaults options, like protocol = "qpid", host="localhost", port="8080".

Parameters:
id - The String containing the ID coded as the example.
Method Detail

toString

public String toString()
Creates a String containing the ID as a String.

Overrides:
toString in class Object
See Also:
AgentID(String)

name_all

public String name_all()
Builds a string identifying this agent. The string is similar to the identifiers used in Jade.

Returns:
The name, host and port coded in a similar fashion as the ToString method
See Also:
toString()

addresses_all

public String addresses_all()
Builds a string identifying this agent. This string is of the form of an URL.

Returns:
The protocol, host and port of this ID, similar to an URL.

getLocalName

public String getLocalName()
Builds a string identifying this agent. The string is valid inside the local domain, since it does not qualify the machine where the agent is located.

Returns:
Returns only the name of the agent.
See Also:
AgentID(String, String, String, String)


Copyright © 2012 GTI-IA. All Rights Reserved.