public interface ChatAgentInterface extends AgentInterface
ChatAgentInterface
is an extension of
AgentInterface
designed to be used with a GUI as a chat or
message system. It adds methods to send chat messages, store chat messages
that are received, and retrieve the history that has been stored.
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Method and Description |
---|---|
void |
chatMessage(URLDescriptor cd,
MLMessage message)
Performs operations necessary when a chat message has been received.
|
Status |
doSendChatMessage(URLDescriptor cd,
List<URLDescriptor> to,
boolean whisper,
String message)
Sends the given chat message through the given cooperation domain to the
given agents.
|
Status |
doSendChatMessage(URLDescriptor cd,
String message)
Sends the given chat message through the given cooperation domain to all
current members of that cooperation domain.
|
Status |
doSendChatMessage(URLDescriptor cd,
URLDescriptor to,
boolean whisper,
String message)
Sends the given chat message through the given cooperation domain to the
given agent.
|
Vector<ChatMessage> |
getHistory(URLDescriptor cd)
Retrieves the message history for the given cooperation domain.
|
void |
setObtainHistory(boolean obtainHistory)
Sets whether this
ChatAgent should obtain the history of any
cooperation domain it joins. |
boolean |
willObtainHistory()
Returns whether this
ChatAgent will obtain the history of any
cooperation domain it joins. |
destroyDataObject, getBooleanProperty, getCASAFilename, getDataObject, getDataObjectInputStream, getDataObjectOutputStream, getDoubleProperty, getFloatProperty, getIntegerProperty, getLongProperty, getStringProperty, hasProperty, isPersistent, putDataObject, putDataObject, ready, removeProperty, setBooleanProperty, setDoubleProperty, setFloatProperty, setIntegerProperty, setLongProperty, setPersistent, setStringProperty
doAdvertise, doCDGetHistory_sync, doCDGetMembers, doCDPutData, doFindInstances_sync, doGetCooperationDomains, doGetOnology, doInviteToCD, doJoinCD, doPing_sync, doPing, doRegisterAgentInstance, doRegisterAgentInstance, doSearchYP, doUnadvertise, doUnregisterAgentInstance, doUnregisterAgentType, doWithdrawCD, executeCommand, getInstancesFound, getJoinedCooperationDomains, getLACURL, getMembers, getOntology, getOptions, getSerializedOntology, getStrategyGUI, hasStrategyGUI, isAAct, isInitialized, isRegistered, makeDefaultInterface, putExtendedOntology, putReplacementOntology, putUI, release_get_ontology, removeCooperationDomains, requestInstances, setOptions, updateOptions
addObserver, addObserver, closePort, deleteObserver, deleteObserver, exit, getAgentName, getName, getNewMessage, getPort, getStrategy, getTrace, getUniqueRequestID, getURL, getUseAckProtocol, hasOpenPort, isA, isAPerformative, isExiting, isLoggingTag, isStoppable, isTracing, println, println, println, realizeAgentBehaviourFromOptions, sendMessage, setTracing, setUseAckProtocol, startTraceMonitor
addObserver, addObserver, countObservers, deleteObservers, hasChanged, notifyObservers, notifyObservers, notifyObserversWithNoArg, notifyObserversWithTop
abclEval, abclEval, abclEval, addTransformation, bump, chooseSC, defer, dequeueEvent, dispatchMsgHandlerMethod, evesdrop, getKnowledgeBase, getName, getSCStore, getSubscribeEvents, getTransformationFor, getUniqueRequestID, getURL, getUseAckProtocol, isA, isA, isA, isA, isAPerformative, isAPerformative, isLoggingTag, notifyObservers, println, println, println, queueEvent, queueEventIf, revTransform, revTransform, sendMessage, transform, transform
void setObtainHistory(boolean obtainHistory)
ChatAgent
should obtain the history of any
cooperation domain it joins.persistent
- Whether this Agent
's data should be
persistent between instances.boolean willObtainHistory()
ChatAgent
will obtain the history of any
cooperation domain it joins.true
if this ChatAgent
will obtain the
history of any cooperation domain it joins; false
otherwise.Vector<ChatMessage> getHistory(URLDescriptor cd)
cd
- The cooperation domain for which we are retrieving the history.Vector
of ChatMessage
s that have been
received from the given cooperation domain.void chatMessage(URLDescriptor cd, MLMessage message)
cd
- The cooperation domain that the message was sent through.message
- The chat message that was received.Status doSendChatMessage(URLDescriptor cd, URLDescriptor to, boolean whisper, String message)
cd
- The cooperation domain that will forward the message.to
- The agent that will receive the message.message
- The message to send to the given agent.Status
of the message sending operation, 0 for
success; negative otherwise.Exception
- If an exception is thrown while sending the message.Status doSendChatMessage(URLDescriptor cd, List<URLDescriptor> to, boolean whisper, String message)
cd
- The cooperation domain that will forward the message.to
- A Vector
containing the URLDescriptor
s
of the agents that will receive the message.message
- The message to send to the given agents.Status
of the message sending operation, 0 for
success; negative otherwise.Exception
- If an exception is thrown while sending the message.Status doSendChatMessage(URLDescriptor cd, String message)
cd
- The cooperation domain that will forward the message.message
- The message to send to the given agent.Status
of the message sending operation, 0 for
success; negative otherwise.Exception
- If an exception is thrown while sending the message.