kaos.core.csi.request
Class RequestManagerImpl

java.lang.Object
  extended by kaos.core.csi.request.RequestManagerImpl
All Implemented Interfaces:
FeedbackReceiver, AIDRequestManager, HashMapRequestManager, OWLRequestManager, RequestManager

public class RequestManagerImpl
extends java.lang.Object
implements RequestManager, FeedbackReceiver

This class implements the RequestManager interface, which defines sending requests to entities implementing RequestReceiver interfaces.


Nested Class Summary
protected static class RequestManagerImpl.OperationWaiter
          This class is used as a helper class to block Threads invoking the synchronous 'requestAction' methods.
 
Field Summary
protected  java.util.Hashtable _actionRequestors
           
protected  Locator _myLocator
           
protected  java.lang.String _nickname
           
protected  QueryRegistration _query
           
protected  TransportSupport _transport
           
protected  java.lang.String _transportName
           
protected  java.util.Hashtable _waiters
           
 
Method Summary
 void assertNotLocatable(boolean exp, java.lang.String msg)
           
 boolean equals(java.lang.Object obj)
          Two agents are equal if their respective hash codes are equal.
static RequestManager getInstance(java.lang.String transportName)
          Retrieve a reference to the RequestManager.
 int hashCode()
          Determines the hash code for the AgentUsecase.
static void main(java.lang.String[] args)
           
 void onAborted(java.util.Calendar time, java.lang.Object reason, java.lang.String actionID, java.lang.String actionExecutorID)
          Forward the action aborted info from the given action executor to the feedback receiver associated with the requested action identified by the given actionID.
 void onAccepted(java.util.Calendar time, java.lang.Object acceptInfo, java.lang.String actionID, java.lang.String actionExecutorID)
          Forward the accept info by the action executor to the feedback receiver associated with the requested action identified by the given actionID.
 void onCompleted(java.util.Calendar time, java.lang.Object result, java.lang.String actionID, java.lang.String actionExecutorID)
          Forward the result of the action executed by the given action executor to the feedback receiver associated with the requested action identified by the given actionID.
 void onRefused(java.util.Calendar time, java.lang.Object reason, java.lang.String actionID, java.lang.String actionExecutorID)
          Forward the reason for refusal by the action executor to the feedback receiver associated with the requested action identified by the given actionID.
 void onStarted(java.util.Calendar time, java.lang.Object startedInfo, java.lang.String actionID, java.lang.String actionExecutorID)
          Forward the action started info from the given action executor to the feedback receiver associated with the requested action identified by the given actionID.
protected  void printDebugString(java.lang.String msg, int loggerDisplayLevel)
           
 void receiveKAoSStatus(java.lang.String statusMsg, java.lang.String actionID, java.lang.String robotID)
          Receive a status message describing the execution of the requested action.
 void receiveMessage(TransportMessage tmsg)
          Implements the receiveMessage method mandated by the MessageListener interface.
protected  void removeWaiter(java.lang.String id)
           
protected  MethodCallResultMsg satisfyRequest(MethodCallRequestMsg requestMsg)
          kaos.core.csi.command.FeedbackReceiver interface implementation - end
 java.lang.String sendAIDRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, ActionInstanceDescription aid)
          This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given ActionInstanceDescription.
 java.lang.String sendAIDRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, ActionInstanceDescription aid)
          This method sends a request to an entity identified by the given receiverID to perform an action described by the given ActionInstanceDescription.
 java.lang.Object sendAIDRequest(KAoSEntityDescription receiverDesc, ActionInstanceDescription aid)
          This method sends a request described by an ActionInstanceDescription to perform an action by an entity identified by the KAoSEntityDescription.
 java.lang.Object sendAIDRequest(java.lang.String receiverID, ActionInstanceDescription aid)
          This method sends a request described by an ActionInstanceDescription to perform an action by an entity identified by the receiverID.
 java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, java.lang.String actionName)
          This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String.
 java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, java.lang.String actionName, java.util.HashMap properties)
          This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String and a HashMap containing the action properties.
 java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String actionName)
          This method sends a request to an entity identified by the given receiverID to perform an action described by the given String.
 java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String actionName, java.util.HashMap properties)
          This method sends a request to an entity identified by the given receiverID to perform an action described by the given String and a HashMap containing the action properties.
 java.lang.Object sendHashMapRequest(KAoSEntityDescription receiverDesc, java.lang.String actionName)
          This method sends a request described by a String and a HashMap containing the action properties to perform by an entity identified by the KAoSEntityDescription.
 java.lang.Object sendHashMapRequest(KAoSEntityDescription receiverDesc, java.lang.String actionName, java.util.HashMap properties)
          This method sends a request described by a String and a HashMap containing the action properties to perform by an entity identified by the KAoSEntityDescription.
 java.lang.Object sendHashMapRequest(java.lang.String receiverID, java.lang.String actionName)
          This method sends a request described by the given String containing the action name to perform the action by an entity identified by the receiverID.
 java.lang.Object sendHashMapRequest(java.lang.String receiverID, java.lang.String actionName, java.util.HashMap properties)
          This method sends a request described by the given String and a HashMap containing the action properties to perform an action by an entity identified by the receiverID.
 java.lang.String sendOWLRequest(FeedbackReceiver feedbackReceiver, KAoSEntityDescription receiverDesc, java.lang.String owlActionDescription)
          This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String, which is in the OWL format.
 java.lang.String sendOWLRequest(FeedbackReceiver feedbackReceiver, java.lang.String receiverID, java.lang.String owlActionDescription)
          This method sends a request to an entity identified by the given receiverID to perform an action described by the given String, which is in the OWL format.
 java.lang.Object sendOWLRequest(KAoSEntityDescription receiverDesc, java.lang.String owlActionDescription)
          This method sends a request described by an OWL String to perform an action by an entity identified by the KAoSEntityDescription.
 java.lang.Object sendOWLRequest(java.lang.String receiverID, java.lang.String owlActionDescription)
          This method sends a request described by an OWL String to perform an action by an entity identified by the receiverID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_myLocator

protected Locator _myLocator

_nickname

protected java.lang.String _nickname

_query

protected QueryRegistration _query

_transport

protected TransportSupport _transport

_transportName

protected java.lang.String _transportName

_actionRequestors

protected java.util.Hashtable _actionRequestors

_waiters

protected java.util.Hashtable _waiters
Method Detail

getInstance

public static RequestManager getInstance(java.lang.String transportName)
                                  throws java.lang.Exception
Retrieve a reference to the RequestManager.

Parameters:
transportName - is a String containing the name of the transport to use by the RequestManager.
nickName - is a String containing the nick name of the RequestManager that may be used by certain transport implementations, or null if not required by the transport.
Returns:
a reference to the RequestManager
Throws:
java.lang.Exception

sendHashMapRequest

public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver,
                                           java.lang.String receiverID,
                                           java.lang.String actionName,
                                           java.util.HashMap properties)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request to an entity identified by the given receiverID to perform an action described by the given String and a HashMap containing the action properties. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
actionName - is a String representing the name of the action as defined in the associated ontology.
properties - is a HashMap of ontological Strings representing the desired properties of the action and the associated values.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver,
                                           java.lang.String receiverID,
                                           java.lang.String actionName)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request to an entity identified by the given receiverID to perform an action described by the given String. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
actionName - is a String representing the name of the action as defined in the associated ontology.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver,
                                           KAoSEntityDescription receiverDesc,
                                           java.lang.String actionName,
                                           java.util.HashMap properties)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String and a HashMap containing the action properties. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverDesc - is a KAosEntityDescription of the entity, which is requested to perform the action.
actionName - is a String representing the name of the action as defined in the associated ontology.
properties - is a HashMap of ontological Strings representing the desired properties of the action and the associated values.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of the action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.String sendHashMapRequest(FeedbackReceiver feedbackReceiver,
                                           KAoSEntityDescription receiverDesc,
                                           java.lang.String actionName)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverDesc - is a KAosEntityDescription of the entity, which is requested to perform the action.
actionName - is a String representing the name of the action as defined in the associated ontology.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of the action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.Object sendHashMapRequest(java.lang.String receiverID,
                                           java.lang.String actionName,
                                           java.util.HashMap properties)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request described by the given String and a HashMap containing the action properties to perform an action by an entity identified by the receiverID. The result is returned synchronously to the caller.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
actionName - is a String representing the name of the action as defined in the associated ontology.
properties - is a HashMap of ontological Strings representing the desired properties of the action and the associated values.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.Object sendHashMapRequest(java.lang.String receiverID,
                                           java.lang.String actionName)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request described by the given String containing the action name to perform the action by an entity identified by the receiverID. The result is returned synchronously to the caller.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
actionName - is a String representing the name of the action as defined in the associated ontology.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.Object sendHashMapRequest(KAoSEntityDescription receiverDesc,
                                           java.lang.String actionName,
                                           java.util.HashMap properties)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request described by a String and a HashMap containing the action properties to perform by an entity identified by the KAoSEntityDescription. The result is returned synchronously to the caller.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
receiverDesc - is the KAoSEntityDescription that identifies the entity, which is requested to perform the action.
actionName - is a String representing the name of the action as defined in the associated ontology.
properties - is a HashMap of ontological Strings representing the desired properties of the action and the associated values.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendHashMapRequest

public java.lang.Object sendHashMapRequest(KAoSEntityDescription receiverDesc,
                                           java.lang.String actionName)
                                    throws ActionFailureException,
                                           NotLocatableException,
                                           TransportFailure
This method sends a request described by a String and a HashMap containing the action properties to perform by an entity identified by the KAoSEntityDescription. The result is returned synchronously to the caller.

Specified by:
sendHashMapRequest in interface HashMapRequestManager
Parameters:
receiverDesc - is the KAoSEntityDescription that identifies the entity, which is requested to perform the action.
actionName - is a String representing the name of the action as defined in the associated ontology.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendAIDRequest

public java.lang.String sendAIDRequest(FeedbackReceiver feedbackReceiver,
                                       java.lang.String receiverID,
                                       ActionInstanceDescription aid)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request to an entity identified by the given receiverID to perform an action described by the given ActionInstanceDescription. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendAIDRequest in interface AIDRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
aid - is an ActionInstanceDescription that describes the action. It includes the action name and all action properties and their values.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendAIDRequest

public java.lang.String sendAIDRequest(FeedbackReceiver feedbackReceiver,
                                       KAoSEntityDescription receiverDesc,
                                       ActionInstanceDescription aid)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given ActionInstanceDescription. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendAIDRequest in interface AIDRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverDesc - is a KAosEntityDescription of the entity, which is requested to perform the action.
aid - is an ActionInstanceDescription that describes the action. It includes the action name and all action properties and their values.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of the action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendAIDRequest

public java.lang.Object sendAIDRequest(java.lang.String receiverID,
                                       ActionInstanceDescription aid)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request described by an ActionInstanceDescription to perform an action by an entity identified by the receiverID. The result is returned synchronously to the caller.

Specified by:
sendAIDRequest in interface AIDRequestManager
Parameters:
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
aid - is an ActionInstanceDescription that describes the action. It includes the action name and all action properties and their values.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendAIDRequest

public java.lang.Object sendAIDRequest(KAoSEntityDescription receiverDesc,
                                       ActionInstanceDescription aid)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request described by an ActionInstanceDescription to perform an action by an entity identified by the KAoSEntityDescription. The result is returned synchronously to the caller.

Specified by:
sendAIDRequest in interface AIDRequestManager
Parameters:
receiverDesc - is the KAoSEntityDescription that identifies the entity, which is requested to perform the action.
aid - is an ActionInstanceDescription that describes the action. It includes the action name and all action properties and their values.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendOWLRequest

public java.lang.String sendOWLRequest(FeedbackReceiver feedbackReceiver,
                                       java.lang.String receiverID,
                                       java.lang.String owlActionDescription)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request to an entity identified by the given receiverID to perform an action described by the given String, which is in the OWL format. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendOWLRequest in interface OWLRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
owlActionDescription - is an OWL String that describes the action. It includes the action name and all action properties and their values.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendOWLRequest

public java.lang.String sendOWLRequest(FeedbackReceiver feedbackReceiver,
                                       KAoSEntityDescription receiverDesc,
                                       java.lang.String owlActionDescription)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request to an entity identified by the given receiverDesc to perform an action described by the given String, which is in the OWL format. Feedback from the action execution is sent to the given feedbackReceiver.

Specified by:
sendOWLRequest in interface OWLRequestManager
Parameters:
feedbackReceiver - is the FeedbackReceiver requesting the action. All feedback from the action execution will be sent to it.
receiverDesc - is a KAosEntityDescription of the entity, which is requested to perform the action.
owlActionDescription - is an OWL String that describes the action. It includes the action name and all action properties and their values.
Returns:
String containing the unique id of the requested action. This id may be used by the FeedbackReceiver to track the status of the action execution.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendOWLRequest

public java.lang.Object sendOWLRequest(java.lang.String receiverID,
                                       java.lang.String owlActionDescription)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request described by an OWL String to perform an action by an entity identified by the receiverID. The result is returned synchronously to the caller.

Specified by:
sendOWLRequest in interface OWLRequestManager
Parameters:
receiverID - is the String that identifies the entity, which is requested to perform the action. The receiverID is the one that the action executor has registered with KAoS.
owlActionDescription - is an OWL String that describes the action. It includes the action name and all action properties and their values.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

sendOWLRequest

public java.lang.Object sendOWLRequest(KAoSEntityDescription receiverDesc,
                                       java.lang.String owlActionDescription)
                                throws ActionFailureException,
                                       NotLocatableException,
                                       TransportFailure
This method sends a request described by an OWL String to perform an action by an entity identified by the KAoSEntityDescription. The result is returned synchronously to the caller.

Specified by:
sendOWLRequest in interface OWLRequestManager
Parameters:
receiverDesc - is the KAoSEntityDescription that identifies the entity, which is requested to perform the action.
owlActionDescription - is an OWL String that describes the action. It includes the action name and all action properties and their values.
Returns:
Object containing the final result of the action.
Throws:
ActionFailureException - containing the reason for failure. See ontology to determine specific reasons available for a given action
NotLocatableException - when the entity reqested to perform the action cannot be located.
TransportFailure - when the request cannot be sent due to transport failure.

receiveMessage

public void receiveMessage(TransportMessage tmsg)
Implements the receiveMessage method mandated by the MessageListener interface. This method prints the incoming TransportMessage to System.out.

See Also:
MessageListener, TransportMessage, "JAS Specification, Section(s) 3.4.2, 4.7.2"

equals

public boolean equals(java.lang.Object obj)
Two agents are equal if their respective hash codes are equal.

Overrides:
equals in class java.lang.Object
Returns:
true if obj equals this AgentUsecase.
See Also:
hashCode(), "JAS Specification, Section(s) 4.7.2"

hashCode

public int hashCode()
Determines the hash code for the AgentUsecase. The AgentUsecase hash code is simply the hash code of the represented agents AgentName. If the AgentName field has not yet been set, then the hash code is found from super.hashCode() .

Overrides:
hashCode in class java.lang.Object
Returns:
int the hashCode for this AgentUsecase.
See Also:
AgentName#hashCode, Object.hashCode(), "JAS Specification, Section(s) 4.7.2"

onAccepted

public void onAccepted(java.util.Calendar time,
                       java.lang.Object acceptInfo,
                       java.lang.String actionID,
                       java.lang.String actionExecutorID)
Forward the accept info by the action executor to the feedback receiver associated with the requested action identified by the given actionID.

Specified by:
onAccepted in interface FeedbackReceiver
Parameters:
time - Calendar time of acceptance.
acceptInfo - Object containing additional (optional) info about the acceptance.
actionID - String containing the id of the requested action/information.
actionExecutorID - String containing the name of the entity performing the action.

onRefused

public void onRefused(java.util.Calendar time,
                      java.lang.Object reason,
                      java.lang.String actionID,
                      java.lang.String actionExecutorID)
Forward the reason for refusal by the action executor to the feedback receiver associated with the requested action identified by the given actionID.

Specified by:
onRefused in interface FeedbackReceiver
Parameters:
time - Calendar time of refusal.
reason - Object containing the reason for refusing the request.
actionID - String containing the id of the requested action/information.
actionExecutorID - String containing the name of the entity performing the action.

onCompleted

public void onCompleted(java.util.Calendar time,
                        java.lang.Object result,
                        java.lang.String actionID,
                        java.lang.String actionExecutorID)
Forward the result of the action executed by the given action executor to the feedback receiver associated with the requested action identified by the given actionID.

Specified by:
onCompleted in interface FeedbackReceiver
Parameters:
time - Calendar time of information/action completion.
result - Object containing the result of the requested action.
actionID - String containing the id of the requested action/information.
actionExecutorID - String containing the name of the robot performing the action.

onStarted

public void onStarted(java.util.Calendar time,
                      java.lang.Object startedInfo,
                      java.lang.String actionID,
                      java.lang.String actionExecutorID)
Forward the action started info from the given action executor to the feedback receiver associated with the requested action identified by the given actionID.

Specified by:
onStarted in interface FeedbackReceiver
Parameters:
time - Calendar time of starting an action.
startedInfo - Object containing additional (optional) info about the start of the action.
actionID - String containing the id of the requested action/information.
actionExecutorID - String containing the name of the entity performing the action.

onAborted

public void onAborted(java.util.Calendar time,
                      java.lang.Object reason,
                      java.lang.String actionID,
                      java.lang.String actionExecutorID)
Forward the action aborted info from the given action executor to the feedback receiver associated with the requested action identified by the given actionID.

Specified by:
onAborted in interface FeedbackReceiver
Parameters:
time - Calendar time of aborting an action.
reason - Object containing the reason for aborting an action.
actionID - String containing the id of the requested action/information.
actionExecutorID - String containing the name of the robot performing the action.

receiveKAoSStatus

public void receiveKAoSStatus(java.lang.String statusMsg,
                              java.lang.String actionID,
                              java.lang.String robotID)
Receive a status message describing the execution of the requested action. There maybe several status messages sent during action execution.

Specified by:
receiveKAoSStatus in interface FeedbackReceiver
Parameters:
statusMsg - Object containing the result of the requested action/information.
actionID - String containing the id of the requested action/information.
robotID - String containing the name of the robot performing the action.

satisfyRequest

protected MethodCallResultMsg satisfyRequest(MethodCallRequestMsg requestMsg)
kaos.core.csi.command.FeedbackReceiver interface implementation - end


assertNotLocatable

public void assertNotLocatable(boolean exp,
                               java.lang.String msg)
                        throws NotLocatableException
Throws:
NotLocatableException - if exp is true.

removeWaiter

protected void removeWaiter(java.lang.String id)

printDebugString

protected void printDebugString(java.lang.String msg,
                                int loggerDisplayLevel)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception