jadex.bdi.planlib.protocols
Class InteractionState

java.lang.Object
  extended by jadex.bdi.planlib.protocols.InteractionState

public class InteractionState
extends java.lang.Object

The state of the execution of an interaction.


Field Summary
protected  java.util.Map cancel_response_contents
          The cancel response contents (if any).
protected  java.util.Map cancel_responses
          The received cancel responses (if any).
static java.lang.String CANCELLATION_FAILED
          Constant identifying failed cancellation of interaction (failure explicitly stated by receiver side).
static java.lang.String CANCELLATION_SUCCEEDED
          Constant identifying successful cancellation of interaction.
static java.lang.String CANCELLATION_UNKNOWN
          Constant identifying unknown state of cancellation of interaction (no response from receiver side within timeout).
protected  java.lang.Object failure
          The failure (if any).
static java.lang.String INTERACTION_CANCELLED
          Interaction state cancelled.
static java.lang.String INTERACTION_FINISHED
          Interaction state finished.
static java.lang.String INTERACTION_INITIAL
          Interaction state initial (not yet started).
static java.lang.String INTERACTION_RUNNING
          Interaction state running.
protected  java.lang.String interaction_state
          The interaction state.
 
Constructor Summary
InteractionState()
          Create a new interaction state in default initial state "running".
 
Method Summary
 void addCancelResponse(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.String getCancelResponse(IComponentIdentifier responder)
          Get the cancel response of an agent.
 java.lang.Object getCancelResponseContent(IComponentIdentifier responder)
          Get the details of a cancel response of a given agent.
 java.lang.Object getFailure()
          Get the failure description.
 java.lang.String getInteractionState()
          Get the interaction state.
 void setFailure(java.lang.Object failure)
          Set the failure description.
 void setInteractionState(java.lang.String interaction_state)
          Set the interaction state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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).

Constructor Detail

InteractionState

public InteractionState()
Create a new interaction state in default initial state "running".

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.



Copyright © 2010. All Rights Reserved.