fipaos.ont.fipa.fipaman
Class AMSAgentDescription


public class AMSAgentDescription
implements DatabaseObject

FIPA defined AMS Agent Description class for the FIPA agent management ontology. See FIPA 2000 6.1.5. e.g. a parseable string into the object is:
(ams-agent-description :name (agent-identifier :name CameraProxy@foo.com :addresses (sequence iiop://foo.com/acc)) :ownership Ann :state active)


Constructor Summary
AMSAgentDescription(String ams_string)
          This constructor takes an AMSAgentDescription String as a parameter and uses the SL Parser to parse it into a Content Object.
AMSAgentDescription(Content content)
          This constructor takes a Content Object as the parameter and parses it into an AMSAgentDescription object.
AMSAgentDescription()
          Empty constructor which can either be populated using the parse() method or the set methods.

Method Summary
 booleancanDeregister()
          Indicates whether this AMS Agent Description is suitable for use in the deregister action.
 booleancanModify()
          Indicates whether this AMS Agent description is suitable for use in the modify action.
 booleancanRegister()
          Indicates whether this AMS Agent Description is suitable for use in the register action.
 AgentIDgetAgentID()
          This method returns the agent ID
 StringgetAgentName()
          This method returns the name of the agent ID
 StringgetObjectID()
          This method is required for the DatabaseObject interface for storage.
 StringgetOwnership()
          This method returns the ownership
 StringgetState()
          This method returns the state of the agent
 booleanhasAgentID()
          Indicates whether the agent name was present in the AMS Agent Description
 booleanhasState()
          Indicates whether the agent state was present in the AMS Agent Description
 static voidmain(String[] args)
          This method is for testing only.
 voidsetAgentID(AgentID agent_id)
          This method sets the agent ID.
 voidsetOwnership(String ownership)
          This method sets the ownership
 voidsetState(String state)
          This method sets the state of the agent
 StringtoString()
          This method returns an AMS-Agent Description as a string

Constructor Detail

AMSAgentDescription

public AMSAgentDescription(String ams_string)
throws fipaos.parser.ParserException
This constructor takes an AMSAgentDescription String as a parameter and uses the SL Parser to parse it into a Content Object.
Parameters:
ams_string - the AMS-Agent Description component of an ACL string
Throws:
ParserException - if the SL parser fails to parse the String

AMSAgentDescription

public AMSAgentDescription(Content content)
throws fipaos.parser.ParserException
This constructor takes a Content Object as the parameter and parses it into an AMSAgentDescription object.
Parameters:
content - the content object representing the AMSAgentDescription
Throws:
ParserException - if the String is not valid

AMSAgentDescription

public AMSAgentDescription()
Empty constructor which can either be populated using the parse() method or the set methods.
Method Detail

canDeregister

public boolean canDeregister()
Indicates whether this AMS Agent Description is suitable for use in the deregister action.
Returns: True if the mandatory fields are present for a deregister action, false otherwise

canModify

public boolean canModify()
Indicates whether this AMS Agent description is suitable for use in the modify action.
Returns: True if the mandatory fields are present for a modify action, false otherwise

canRegister

public boolean canRegister()
Indicates whether this AMS Agent Description is suitable for use in the register action.
Returns: True if the mandatory fields are present for a register action, false otherwise

getAgentID

public AgentID getAgentID()
This method returns the agent ID
Returns: AgentID AgentID stored in the Description

getAgentName

public String getAgentName()
This method returns the name of the agent ID
Returns: String name part of the AgentID

getObjectID

public String getObjectID()
This method is required for the DatabaseObject interface for storage.
Returns: id the key for the database

getOwnership

public String getOwnership()
This method returns the ownership
Returns: ownership of the description

getState

public String getState()
This method returns the state of the agent
Returns: String state of the AMS Agent Description

hasAgentID

public boolean hasAgentID()
Indicates whether the agent name was present in the AMS Agent Description
Returns: True if the field is present, false otherwise

hasState

public boolean hasState()
Indicates whether the agent state was present in the AMS Agent Description
Returns: True if the field is present, false otherwise

main

public static void main(String[] args)
This method is for testing only.
Parameters:
args - Arguments array

setAgentID

public void setAgentID(AgentID agent_id)
This method sets the agent ID.
Parameters:
agent_id - the AgentID of the Description

setOwnership

public void setOwnership(String ownership)
This method sets the ownership
Parameters:
ownership - Ownership stored in the description

setState

public void setState(String state)
This method sets the state of the agent
Parameters:
state - state of the agent

toString

public String toString()
This method returns an AMS-Agent Description as a string
Returns: String AMS Agent Description

Association Links

to Class fipaos.ont.fipa.fipaman.AgentID

The identifier of the agent

to Class java.lang.String

The life cycle of the agent

seeAlso FIPAMANCONSTANTS.initiated, FIPAMANCONSTANTS.active, FIPAMANCONSTANTS.suspended, FIPAMANCONSTANTS.waiting, FIPAMANCONSTANTS.transit

to Class java.lang.String

The owner of the agent