is.lill.acre.conversation
Class Conversation

java.lang.Object
  extended by java.util.Observable
      extended by is.lill.acre.conversation.Conversation

public class Conversation
extends java.util.Observable


Constructor Summary
Conversation(Protocol p, ConversationManager manager)
          Constructor
 
Method Summary
 boolean advance(IACREMessage message)
          Advance this conversation by matching one of its transitions against the given message
 boolean advancedBy(IACREMessage message)
          Determine whether the given message is capable of advancing this conversation.
 java.lang.String getConversationId()
          Get the unique Conversation ID associated with this conversation
 State getCurrentState()
          Get the current state of this conversation
 java.util.Set<IACREAgentID> getParticipants()
          Get the participants in this conversation
 Protocol getProtocol()
          Get the underlying protocol behind this conversation
 State getState()
           
 ConversationStatus getStatus()
           
 void setStatus(ConversationStatus status)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conversation

public Conversation(Protocol p,
                    ConversationManager manager)
Constructor

Parameters:
p - The underlying Protocol
manager - The ConversationManager tasked with managing this conversation
Method Detail

advancedBy

public boolean advancedBy(IACREMessage message)
Determine whether the given message is capable of advancing this conversation.

Parameters:
message - A message against which to match the conversation's active transitions
Returns:
true if the conversation can be advanced by the given message, false otherwise

setStatus

public void setStatus(ConversationStatus status)

getStatus

public ConversationStatus getStatus()

advance

public boolean advance(IACREMessage message)
Advance this conversation by matching one of its transitions against the given message

Parameters:
message - A message to trigger a transition TODO: this assumes only one transition matches

getConversationId

public java.lang.String getConversationId()
Get the unique Conversation ID associated with this conversation

Returns:
The conversation id

getParticipants

public java.util.Set<IACREAgentID> getParticipants()
Get the participants in this conversation

Returns:
A set of the agent ids associated with the conversation participants.

getCurrentState

public State getCurrentState()
Get the current state of this conversation

Returns:
The current state of the conversation

getProtocol

public Protocol getProtocol()
Get the underlying protocol behind this conversation

Returns:

getState

public State getState()