unsw.cse.mica.blackboard.transport
Class XMLBlackboardProtocol

java.lang.Object
  extended by unsw.cse.mica.blackboard.transport.XMLBlackboardProtocol
All Implemented Interfaces:
java.lang.Runnable, BlackboardAgentMessageSender, BlackboardProtocol
Direct Known Subclasses:
SecureXMLBlackboardProtocol

public class XMLBlackboardProtocol
extends java.lang.Object
implements BlackboardProtocol, java.lang.Runnable

The per-agent component of blackboard side of the XML protocol.

Author:
jhw

Constructor Summary
XMLBlackboardProtocol()
           
 
Method Summary
 void close()
          Closes the protocol.
 void connect(java.lang.String proposedName)
           
 void deleteMob(java.lang.String mobName)
           
 void disconnect()
           
 java.lang.String getAgentName()
          Gets the name of the agent the protocol is connected to.
 boolean isOpen()
          Tests if the protocol is open.
 void mobSearch(java.lang.String query)
           
 void open()
          Opens the protocol.
 void readMob(java.lang.String mobName)
           
 void register(java.lang.String mobType)
           
 void replaceMob(Mob mob)
           
 void run()
           
 void sendDeletedMob(Mob mob)
          Send a deleted mob message to the specific agent
 void sendNewMob(Mob mob)
          Send a new mob message to the specific agent
 void sendReplacedMob(Mob oldMob, Mob newMob)
          Send a deleted mob message to the specific agent
 void sendTypeManagerChanged()
          Send a typeManagerChanged message to the specific agent
 void setActionHandler(BlackboardActions actions)
          Sets the action handler that will peform the actions recieved by the protocol.
 void setConnection(BlackboardAgentConnection connection)
          Sets the connection the protocol will use to communicate with the agent.
 void typeManager()
           
 void unregister(java.lang.String mobType)
           
 void writeMob(Mob mob)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBlackboardProtocol

public XMLBlackboardProtocol()
Method Detail

setActionHandler

public void setActionHandler(BlackboardActions actions)
Description copied from interface: BlackboardProtocol
Sets the action handler that will peform the actions recieved by the protocol.

Specified by:
setActionHandler in interface BlackboardProtocol
Parameters:
actions - the action handler

setConnection

public void setConnection(BlackboardAgentConnection connection)
Description copied from interface: BlackboardProtocol
Sets the connection the protocol will use to communicate with the agent.

Specified by:
setConnection in interface BlackboardProtocol
Parameters:
connection - the connection to the agent

getAgentName

public java.lang.String getAgentName()
Description copied from interface: BlackboardProtocol
Gets the name of the agent the protocol is connected to.

Specified by:
getAgentName in interface BlackboardProtocol
Returns:
the name of the agent

open

public void open()
          throws TransportException
Description copied from interface: BlackboardProtocol
Opens the protocol.

Specified by:
open in interface BlackboardProtocol
Throws:
TransportException - If any problems occur when opening the protocol.

isOpen

public boolean isOpen()
Description copied from interface: BlackboardProtocol
Tests if the protocol is open.

Specified by:
isOpen in interface BlackboardProtocol
Returns:
true if it is open else false

close

public void close()
Description copied from interface: BlackboardProtocol
Closes the protocol.

Specified by:
close in interface BlackboardProtocol

run

public void run()
Specified by:
run in interface java.lang.Runnable

sendNewMob

public void sendNewMob(Mob mob)
Description copied from interface: BlackboardAgentMessageSender
Send a new mob message to the specific agent

Specified by:
sendNewMob in interface BlackboardAgentMessageSender

sendDeletedMob

public void sendDeletedMob(Mob mob)
Description copied from interface: BlackboardAgentMessageSender
Send a deleted mob message to the specific agent

Specified by:
sendDeletedMob in interface BlackboardAgentMessageSender

sendReplacedMob

public void sendReplacedMob(Mob oldMob,
                            Mob newMob)
Description copied from interface: BlackboardAgentMessageSender
Send a deleted mob message to the specific agent

Specified by:
sendReplacedMob in interface BlackboardAgentMessageSender

sendTypeManagerChanged

public void sendTypeManagerChanged()
Description copied from interface: BlackboardAgentMessageSender
Send a typeManagerChanged message to the specific agent

Specified by:
sendTypeManagerChanged in interface BlackboardAgentMessageSender

connect

public void connect(java.lang.String proposedName)

disconnect

public void disconnect()

typeManager

public void typeManager()

register

public void register(java.lang.String mobType)

unregister

public void unregister(java.lang.String mobType)

readMob

public void readMob(java.lang.String mobName)

writeMob

public void writeMob(Mob mob)

replaceMob

public void replaceMob(Mob mob)

deleteMob

public void deleteMob(java.lang.String mobName)

mobSearch

public void mobSearch(java.lang.String query)