Package jadex.bdi.planlib.protocols
Class InteractionState
- java.lang.Object
-
- jadex.bdi.planlib.protocols.InteractionState
-
public class InteractionState extends java.lang.ObjectThe state of the execution of an interaction.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Mapcancel_response_contentsThe cancel response contents (if any).protected java.util.Mapcancel_responsesThe received cancel responses (if any).static java.lang.StringCANCELLATION_FAILEDConstant identifying failed cancellation of interaction (failure explicitly stated by receiver side).static java.lang.StringCANCELLATION_SUCCEEDEDConstant identifying successful cancellation of interaction.static java.lang.StringCANCELLATION_UNKNOWNConstant identifying unknown state of cancellation of interaction (no response from receiver side within timeout).protected java.lang.ObjectfailureThe failure (if any).static java.lang.StringINTERACTION_CANCELLEDInteraction state cancelled.static java.lang.StringINTERACTION_FINISHEDInteraction state finished.static java.lang.StringINTERACTION_INITIALInteraction state initial (not yet started).static java.lang.StringINTERACTION_RUNNINGInteraction state running.protected java.lang.Stringinteraction_stateThe interaction state.
-
Constructor Summary
Constructors Constructor Description InteractionState()Create a new interaction state in default initial state "running".
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCancelResponse(IComponentIdentifier responder, java.lang.String response, java.lang.Object content)Add a cancel response.IComponentIdentifier[]getCancelResponders(java.lang.String response)Get all agents with a specific cancel response.java.lang.StringgetCancelResponse(IComponentIdentifier responder)Get the cancel response of an agent.java.lang.ObjectgetCancelResponseContent(IComponentIdentifier responder)Get the details of a cancel response of a given agent.java.lang.ObjectgetFailure()Get the failure description.java.lang.StringgetInteractionState()Get the interaction state.voidsetFailure(java.lang.Object failure)Set the failure description.voidsetInteractionState(java.lang.String interaction_state)Set the interaction state.
-
-
-
Field Detail
-
INTERACTION_INITIAL
public static final java.lang.String INTERACTION_INITIAL
Interaction state initial (not yet started).- See Also:
- Constant Field Values
-
INTERACTION_RUNNING
public static final java.lang.String INTERACTION_RUNNING
Interaction state running.- See Also:
- Constant Field Values
-
INTERACTION_CANCELLED
public static final java.lang.String INTERACTION_CANCELLED
Interaction state cancelled.- See Also:
- Constant Field Values
-
INTERACTION_FINISHED
public static final java.lang.String INTERACTION_FINISHED
Interaction state finished.- See Also:
- Constant Field Values
-
CANCELLATION_SUCCEEDED
public static final java.lang.String CANCELLATION_SUCCEEDED
Constant identifying successful cancellation of interaction.- See Also:
- Constant Field Values
-
CANCELLATION_FAILED
public static final java.lang.String CANCELLATION_FAILED
Constant identifying failed cancellation of interaction (failure explicitly stated by receiver side).- See Also:
- Constant Field Values
-
CANCELLATION_UNKNOWN
public static final java.lang.String CANCELLATION_UNKNOWN
Constant identifying unknown state of cancellation of interaction (no response from receiver side within timeout).- See Also:
- Constant Field Values
-
interaction_state
protected java.lang.String interaction_state
The interaction state.
-
failure
protected java.lang.Object failure
The failure (if any).
-
cancel_responses
protected java.util.Map cancel_responses
The received cancel responses (if any).
-
cancel_response_contents
protected java.util.Map cancel_response_contents
The cancel response contents (if any).
-
-
Method Detail
-
getFailure
public java.lang.Object getFailure()
Get the failure description.- Returns:
- The failure description (if any).
-
setFailure
public void setFailure(java.lang.Object failure)
Set the failure description.- Parameters:
failure- The failure description to set.
-
getInteractionState
public java.lang.String getInteractionState()
Get the interaction state.- Returns:
- The interaction state.
-
setInteractionState
public void setInteractionState(java.lang.String interaction_state)
Set the interaction state.- Parameters:
interaction- state The interaction state to set.
-
addCancelResponse
public void addCancelResponse(IComponentIdentifier responder, java.lang.String response, java.lang.Object content)
Add a cancel response.
-
getCancelResponders
public IComponentIdentifier[] getCancelResponders(java.lang.String response)
Get all agents with a specific cancel response.
-
getCancelResponse
public java.lang.String getCancelResponse(IComponentIdentifier responder)
Get the cancel response of an agent.
-
getCancelResponseContent
public java.lang.Object getCancelResponseContent(IComponentIdentifier responder)
Get the details of a cancel response of a given agent. This will be any information that the agent sent as content of the cancel response.
-
-