fipaos.platform.df
Class DFTask

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

public class DFTask
extends Task

TODO: Write a description of the class

$Revision: 1.9 $ $Date: 2001/04/04 22:48:19 $ $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  Conversation _conv
          Reference to the Conversation we are answering
protected  Database _df_db
          Reference to the DF's Database
 
Fields inherited from class fipaos.agent.task.Task
_children, _lock, _owner, _tm
 
Constructor Summary
DFTask(Conversation conv, AgentManagementAction ama, Database db)
          Initialise DFTask
 
Method Summary
protected  boolean deregister(DFAgentDescription dfad)
          Removes the given DFAgentDescription from the DF's Databas
protected  DFAgentDescription getRegistered(AgentID aid)
          Gets the DFAgentDescription associated with the Agent
protected  boolean isRegistered(AgentID aid)
          Indicates if the given Agent is already registered
protected  boolean isRegistered(DFAgentDescription dfad)
          Indicates if the Agent the DFAgentDescription relates to is registered
protected  boolean register(DFAgentDescription dfad)
          Adds the given DFAgentDescription into the DF 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 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

_df_db

protected Database _df_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

DFTask

public DFTask(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(DFAgentDescription dfad)
Indicates if the Agent the DFAgentDescription relates to is registered
Parameters:
dfad -  
Returns:
True if the Agent is registered with this DF

isRegistered

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

getRegistered

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

register

protected boolean register(DFAgentDescription dfad)
Adds the given DFAgentDescription into the DF Database
Parameters:
dfad -  
Returns:
True if the operation was successful

deregister

protected boolean deregister(DFAgentDescription dfad)
Removes the given DFAgentDescription from the DF's Databas
Parameters:
dfad -  
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 -  
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:
 

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