unsw.cse.mica.agent.transport
Class XMLAgentProtocol

java.lang.Object
  extended by unsw.cse.mica.agent.transport.AbstractAgentProtocol
      extended by unsw.cse.mica.agent.transport.XMLAgentProtocol
All Implemented Interfaces:
AgentActions, MessageHandler, AgentProtocol
Direct Known Subclasses:
SecureXMLAgentProtocol

public class XMLAgentProtocol
extends AbstractAgentProtocol

An implementation of AgentProtocol that uses XML to communicate with the blackboard.

Author:
jhw
See Also:
XMLBlackboardProtocol

Nested Class Summary
 
Nested classes/interfaces inherited from class unsw.cse.mica.agent.transport.AbstractAgentProtocol
AbstractAgentProtocol.Reply
 
Constructor Summary
XMLAgentProtocol()
           
 
Method Summary
 java.lang.String connect(java.lang.String proposedName)
          Connect to the blackboard.
 void disconnect()
          Disconnect from the Blackboard
 boolean isConnected()
          See if the protocol is currently connected?
 void setConnectReply(java.lang.String agentName)
           
 void setMobSearchReply(java.util.List mobs)
           
 void setReadMobReply(java.lang.String status, Mob mob)
           
 void setStatusReply(java.lang.String status)
           
 void setTypeManagerReply(TypeManager tm)
           
 void setWriteMobReply(java.lang.String mobName)
           
 
Methods inherited from class unsw.cse.mica.agent.transport.AbstractAgentProtocol
deleteMob, getTypeManager, handleDeletedMob, handleNewMob, handleReplacedMob, handleTypeManagerChanged, mobSearch, readMob, register, replaceMob, setConnection, setMessageHandler, unregister, writeMob
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLAgentProtocol

public XMLAgentProtocol()
Method Detail

isConnected

public boolean isConnected()
Description copied from interface: AgentProtocol
See if the protocol is currently connected?

Returns:
true if the protocol is connected, false otherwise

connect

public java.lang.String connect(java.lang.String proposedName)
                         throws TransportException
Description copied from interface: AgentActions
Connect to the blackboard. This should be the first action performed by an agent.

Parameters:
proposedName - The agent name proposed by the agent.
Returns:
The actual agent name (usually the requested name with a suffix)
Throws:
TransportException

disconnect

public void disconnect()
                throws TransportException
Description copied from interface: AgentActions
Disconnect from the Blackboard

Throws:
TransportException

setStatusReply

public void setStatusReply(java.lang.String status)

setConnectReply

public void setConnectReply(java.lang.String agentName)

setWriteMobReply

public void setWriteMobReply(java.lang.String mobName)

setReadMobReply

public void setReadMobReply(java.lang.String status,
                            Mob mob)

setMobSearchReply

public void setMobSearchReply(java.util.List mobs)

setTypeManagerReply

public void setTypeManagerReply(TypeManager tm)