fipaos.platform.ams
Class AMSTask

java.lang.Object
  |
  +--fipaos.agent.task.Task
        |
        +--fipaos.platform.ams.AMSTask
Direct Known Subclasses:
DeregisterTask, GetDescriptionTask, ModifyTask, RegisterTask, SearchTask

public class AMSTask
extends Task

TODO: Write a description of the class

$Revision: 1.8 $ $Date: 2001/05/24 18:07:38 $ $Author: alantreadway $


Field Summary
protected  ACL _acl
          Original ACL message containing the request
protected  AgentManagementAction _ama
          Reference to the AMA that this Task is attempting to carry out
protected  Database _ams_db
          Reference to the DF's Database
protected  Conversation _conv
          Reference to the Conversation we are answering
 
Fields inherited from class fipaos.agent.task.Task
_children, _lock, _owner, _tm
 
Constructor Summary
AMSTask(Conversation conv, AgentManagementAction ama, Database db)
          Initialise DFTask
 
Method Summary
protected  void clearMessageFlags()
          Clears all message flags.
protected  boolean deregister(AMSAgentDescription amsad)
          Removes the given AMSAgentDescription from the AMS's Databas
protected  AMSAgentDescription getRegistered(AgentID aid)
          Gets the AMSAgentDescription associated with the Agent
protected  boolean isRegistered(AgentID aid)
          Indicates if the given Agent is already registered
protected  boolean isRegistered(AMSAgentDescription amsad)
          Indicates if the Agent the AMSAgentDescription relates to is registered
protected  boolean register(AMSAgentDescription amsad)
          Adds the given AMSAgentDescription into the AMS Database
protected  boolean sendAgree()
          Send an agree message back to the originator of the request for this Task
protected  boolean sendFailure(java.lang.String reason)
          Sends a failure back to the originator of the request for this Task
protected  boolean sendInformDone()
          Sends an inform (with associated "done" term in content) back to originator of request for this Task
protected  boolean sendInformResult(java.util.Set results)
          This method would be called when this df would like to send a result message
protected  boolean sendPlatformProfile()
          This method would be called when this ams wants to send a platform profile
protected  boolean sendRefuse(java.lang.String reason)
          Sends a refuse message back to the originator of the request for this Task
 
Methods inherited from class fipaos.agent.task.Task
DFSearchResults, done, done, doneDFSearchTask, errorDFSearchTask, forward, forward, getContext, getNewConversation, getState, handleAcceptProposal, handleAgree, handleCfp, handleConfirm, handleDisconfirm, handleFailure, handleInform, handleInformIf, handleInformRef, handleLateMessage, handleNotUnderstood, handleOther, handlePropagate, handlePropose, handleProxy, handleQueryIf, handleQueryRef, handleRefuse, handleRejectProposal, handleRequest, handleRequestWhen, handleRequestWhenever, handleSubscribe, handleUndeliverableMessage, newTask, newTask, newTask, newTask, newTask, newTask, newTask, newTask, notify, notifyDone, notifyError, notifyMessageFailure, notifyMessageForEndedConversation, notifyTimeout, searchDF, searchDF, searchDF, searchDF, searchDF, sendNotUnderstood, setContext, startTask, timeoutDFSearchTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_acl

protected ACL _acl
Original ACL message containing the request

_ams_db

protected Database _ams_db
Reference to the DF's Database

_conv

protected Conversation _conv
Reference to the Conversation we are answering

_ama

protected AgentManagementAction _ama
Reference to the AMA that this Task is attempting to carry out
Constructor Detail

AMSTask

public AMSTask(Conversation conv,
               AgentManagementAction ama,
               Database db)
Initialise DFTask
Parameters:
conv - Conversation associated with this Task
ama - AgentManagementAction contained within the given Conversation
db - Database associated with the DF
Method Detail

isRegistered

protected boolean isRegistered(AMSAgentDescription amsad)
Indicates if the Agent the AMSAgentDescription relates to is registered
Parameters:
amsad - AMSAgentDescription
Returns:
True if the Agent is registered with this AMS

isRegistered

protected boolean isRegistered(AgentID aid)
Indicates if the given Agent is already registered
Parameters:
aid - Agent ID
Returns:
True if the Agent is registered

getRegistered

protected AMSAgentDescription getRegistered(AgentID aid)
Gets the AMSAgentDescription associated with the Agent
Parameters:
aid - Agent ID
Returns:
The AMSAgentDescription for the given Agent, or null

register

protected boolean register(AMSAgentDescription amsad)
Adds the given AMSAgentDescription into the AMS Database
Parameters:
amsad - AMSAgentDescription
Returns:
True if the operation was successful

deregister

protected boolean deregister(AMSAgentDescription amsad)
Removes the given AMSAgentDescription from the AMS's Databas
Parameters:
amsad - AMSAgentDescription
Returns:
True if it was removed OK

sendAgree

protected boolean sendAgree()
Send an agree message back to the originator of the request for this Task
Returns:
True if everything went OK

sendRefuse

protected boolean sendRefuse(java.lang.String reason)
Sends a refuse message back to the originator of the request for this Task
Parameters:
reason - Failure reason
Returns:
True if everything went OK

sendFailure

protected boolean sendFailure(java.lang.String reason)
Sends a failure back to the originator of the request for this Task
Parameters:
reason - reason for failure
Returns:
Returns True if everything went OK

sendInformDone

protected boolean sendInformDone()
Sends an inform (with associated "done" term in content) back to originator of request for this Task
Returns:
boolean whether successful or not

sendInformResult

protected boolean sendInformResult(java.util.Set results)
This method would be called when this df would like to send a result message
Parameters:
results - The set of results to propogate back
Returns:
boolean whether successful or not

sendPlatformProfile

protected boolean sendPlatformProfile()
This method would be called when this ams wants to send a platform profile
Returns:
boolean whether it is successful

clearMessageFlags

protected void clearMessageFlags()
Clears all message flags. Use before handling a new message.