unsw.cse.mica.blackboard.transport
Interface BlackboardProtocol

All Superinterfaces:
BlackboardAgentMessageSender
All Known Implementing Classes:
SecureXMLBlackboardProtocol, XMLBlackboardProtocol

public interface BlackboardProtocol
extends BlackboardAgentMessageSender

Represents the server side of a communications protocol with a single agent. It must parse the actions that arrive from the connection and forward them to its action handler. It is also required to accept agent messages and send them to the agent via the connection.

Author:
jhw

Method Summary
 void close()
          Closes the protocol.
 java.lang.String getAgentName()
          Gets the name of the agent the protocol is connected to.
 boolean isOpen()
          Tests if the protocol is open.
 void open()
          Opens the protocol.
 void setActionHandler(BlackboardActions handler)
          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.
 
Methods inherited from interface unsw.cse.mica.blackboard.transport.BlackboardAgentMessageSender
sendDeletedMob, sendNewMob, sendReplacedMob, sendTypeManagerChanged
 

Method Detail

getAgentName

java.lang.String getAgentName()
Gets the name of the agent the protocol is connected to.

Returns:
the name of the agent

setActionHandler

void setActionHandler(BlackboardActions handler)
Sets the action handler that will peform the actions recieved by the protocol.

Parameters:
handler - the action handler

setConnection

void setConnection(BlackboardAgentConnection connection)
Sets the connection the protocol will use to communicate with the agent.

Parameters:
connection - the connection to the agent

open

void open()
          throws TransportException
Opens the protocol.

Throws:
TransportException - If any problems occur when opening the protocol.

isOpen

boolean isOpen()
Tests if the protocol is open.

Returns:
true if it is open else false

close

void close()
           throws TransportException
Closes the protocol.

Throws:
TransportException - If any problems occur when closing the protocol.