unsw.cse.mica.agent.transport
Interface AgentConnection

All Known Implementing Classes:
SSLAgentConnection, TCPAgentConnection

public interface AgentConnection

An AgentConnection represents the client-side connection to the blackboard. This is equivalent to Layer 4 (Transport) in the OSI model.

Author:
jhw

Method Summary
 void connect()
          Make a connection.
 void disconnect()
          terminate the connection.
 java.io.InputStream getInputStream()
          Get an input stream for this connection
 java.io.OutputStream getOutputStream()
          Get an output stream for this connection
 boolean isConnected()
          Check if a connection is open.
 

Method Detail

connect

void connect()
             throws TransportException
Make a connection. The details of how this occurs this will be implementation-specific.

Throws:
TransportException - if the connection could not be made

isConnected

boolean isConnected()
Check if a connection is open.

Returns:
true if the connection is active, false otherwise

disconnect

void disconnect()
                throws TransportException
terminate the connection.

Throws:
TransportException - if something went wrong...

getInputStream

java.io.InputStream getInputStream()
                                   throws TransportException
Get an input stream for this connection

Returns:
an input stream for this connection
Throws:
TransportException - if an inputstream could not be obtained for some reason.

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws TransportException
Get an output stream for this connection

Returns:
an output stream for this connection
Throws:
TransportException - if an output stream could not be obtained for some reason.