|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fipaos.agent.conversation.standard.ConversationManagerImpl
This class embodies the core functionality of the ConversationManagerImpl.
Constructor Summary | |
ConversationManagerImpl(ConversationListener cl,
MessageSender ms,
FIPAOSAgent agent,
DatabaseProfile db_profile,
ProtocolProfile protocol_profile)
Create and initalise the CM. |
Method Summary | |
Conversation |
addConversation(java.lang.String protocol)
Method to create a new conversation given a protcol, and add it to the active list |
boolean |
addProtocol(java.lang.String protocol_name,
java.lang.String protocol_defn)
Adds a new protocol to the CM - the CM will attempt to learn the protocol and will cache it for future use. |
Conversation |
getConversation(java.lang.String conversation_id)
Retrieves an active/previous Conversation that an Agent has had |
void |
handleMessage(Message msg)
Looks at a Message and checks to see if it part of an exisiting conversation. |
boolean |
hasProtocol(java.lang.String protocol)
Indicates whether the specified protocol is already in the cache, i.e. |
static void |
main(java.lang.String[] args)
|
void |
receiveMessage(Message msg)
Received an incoming message - put it through the CM |
void |
removeConversation(java.lang.String conversation_id)
Moves a conversation from the Active to the conversation archive |
void |
run()
Main thread for dealing with non-event based Conversation updates |
void |
sendMessage(Message msg)
Attempt to send the given message |
void |
setMessageReceiver(MessageReceiver p1)
Attempt to set the receiver of incoming messages - not supported by this class! |
void |
setMessageSender(MessageSender p1)
Set the reference to the MessageSender that should send-outgoing messages |
static void |
setProtocolProfile(ProtocolProfile pp)
Method to set the ProtocolProfile for the JVM |
void |
shutdown()
Shutdown the CM |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConversationManagerImpl(ConversationListener cl, MessageSender ms, FIPAOSAgent agent, DatabaseProfile db_profile, ProtocolProfile protocol_profile)
Method Detail |
public void shutdown()
shutdown
in interface MessageSender
public void setMessageReceiver(MessageReceiver p1)
setMessageReceiver
in interface MessageSender
public void sendMessage(Message msg)
sendMessage
in interface MessageSender
fipaos.mts.MessageSender
message
- The message to be sentpublic void receiveMessage(Message msg)
receiveMessage
in interface MessageReceiver
fipaos.mts.MessageReceiver
message
- The incomming messagepublic void setMessageSender(MessageSender p1)
MessageReceiver
setMessageSender
in interface MessageReceiver
public void run()
run
in interface java.lang.Runnable
public static void setProtocolProfile(ProtocolProfile pp)
public void handleMessage(Message msg) throws UnknownProtocolException, InvalidConversationIDException, ProtocolErrorException, ConversationFinishedException
public Conversation addConversation(java.lang.String protocol) throws UnknownProtocolException
addConversation
in interface ConversationManager
public Conversation getConversation(java.lang.String conversation_id) throws InvalidConversationIDException
getConversation
in interface ConversationManager
public boolean addProtocol(java.lang.String protocol_name, java.lang.String protocol_defn)
addProtocol
in interface ConversationManager
protocol_name
- The name of the protocol to store (e.g. fipa-new-protocol)protocol_defn
- The RDF definition of the protocolpublic boolean hasProtocol(java.lang.String protocol)
hasProtocol
in interface ConversationManager
protocol
- The protocol to check forpublic void removeConversation(java.lang.String conversation_id)
removeConversation
in interface ConversationManager
fipaos.agent.conversation.ConversationManager
id
- The conversation-id of the conversation to removepublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |