fipaos.skill.wrapper
Class FIPAWrapperTask
java.lang.Object
|
+--fipaos.agent.task.Task
|
+--fipaos.skill.wrapper.FIPAWrapperTask
- public abstract class FIPAWrapperTask
- extends Task
This is a default implementation of a FIPA Wrapper. It will respond to
all valid incoming FIPA-Wrapper messages with a default refuse for that message type.
It will also respond to other messages with a not-understood. To implement a working
FIPA Wrapper agent simply subclass this Task in the agent state that will
contain the wrapper functionality in your agent. Your agent can either subclass
this state for it's IDLE listener state, or it can pass incoming wrapper requests
on to a dedicated wrapper state that subclasses this object.
Implementation notes:
- Query-if and query-ref messages are currently not handled further than saying
not-understood - they need support for iota queries,
predicates and assertions in the relevant parts of FIPA-OS.
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, handleRefuse, handleRejectProposal, 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 |
FIPAWrapperTask
public FIPAWrapperTask(FIPAOSAgent owner,
TaskManager sm)
- FIPA Wrapper constructor creates the wrapper state and makes the calls
to the API to start everything going. Your state's constructor should
mirror the parameters of this method and just make a call to
super
.
- Parameters:
owner
- The owner agent of this statesm
- The Task Manager that will control this state
handleRequest
public void handleRequest(Conversation conv)
- Handler ACL messages with a
request
performative.
These are the starting messages of the fipa-request protocol.
- Overrides:
handleRequest
in class Task
- Parameters:
conv
- The conversation containing the new message
handleQueryRef
public void handleQueryRef(Conversation conv)
- Handler ACL messages with a
query-ref
performative.
These are the starting messages of the fipa-query protocol.
- Overrides:
handleQueryRef
in class Task
- Parameters:
conv
- The conversation containing the new message
handleQueryIf
public void handleQueryIf(Conversation conv)
- Handler ACL messages with a
query-if
performative.
These are the starting messages of the fipa-query protocol.
- Overrides:
handleQueryIf
in class Task
- Parameters:
conv
- The conversation containing the new message
generateServiceID
protected java.lang.String generateServiceID(java.lang.String prefix)
- Returns a unique service instance ID for a wrapper session.
If your wrapper needs to provide a different ID then you should
override this method.
- Parameters:
prefix
- An optional string prefix for the service instance ID -
if you do not wish to use the prefix pass in a null parameter
handleOtherCommand
protected void handleOtherCommand(Conversation conv)
- Replies back to the sender with a default error.
If your wrapper needs to handle unknown/incorrect wrapper commands in a
different way then you will need to override this method.
- Parameters:
conv
- The conversation to reply into