cgl.narada.transport.sslHttpBase
Interface Transport

All Known Subinterfaces:
SSLTransport
All Known Implementing Classes:
HTTPSTransportImpl, HTTPTransportImpl, SSLTransportJSSEImpl, TransportImpl

public interface Transport

A generic transport interface. Implemented by SSLTransport, HTTPTransport...


Method Summary
 void connect()
          -------------------------------------------------------------------
 void disconnect()
          ------------------------------------------------------------------- Connect to a destination using SSL.
 long getStatusCheckInterval()
          -------------------------------------------------------------------
 String getType()
          -------------------------------------------------------------------
 boolean isConnected()
          -------------------------------------------------------------------
 boolean isInErrorState()
          -------------------------------------------------------------------
 boolean isSecure()
          -------------------------------------------------------------------
 byte[] receiveData()
          ------------------------------------------------------------------- You may use this in combination with transport listener but the transport guarantees no coherence as data received in this method may not be delivered to the data listener.
 byte[] receiveData(long waitTime)
          ------------------------------------------------------------------- Same as receiveData() except the function will return after waiting for a certain amount of time.
 void sendData(byte[] message)
          ------------------------------------------------------------------- Sends a chunk of data over the SSL transport.
 void setProperties(Properties properties)
          ------------------------------------------------------------------- Transport specific configuration properties.
 void setStatusCheckInterval(long interval)
          ------------------------------------------------------------------- Sets optionally the status check interval for the transport to make sure it is alive and its get its performance characteristics.
 void setTransportDataListener(TransportDataListener l)
          ------------------------------------------------------------------- Recieve a chunk of data over the SSL tranposrt.
 

Method Detail

setProperties

void setProperties(Properties properties)
------------------------------------------------------------------- Transport specific configuration properties.


connect

void connect()
             throws TransportException
-------------------------------------------------------------------

Throws:
TransportException

isConnected

boolean isConnected()
-------------------------------------------------------------------


isInErrorState

boolean isInErrorState()
-------------------------------------------------------------------


isSecure

boolean isSecure()
-------------------------------------------------------------------


setStatusCheckInterval

void setStatusCheckInterval(long interval)
------------------------------------------------------------------- Sets optionally the status check interval for the transport to make sure it is alive and its get its performance characteristics.


getStatusCheckInterval

long getStatusCheckInterval()
-------------------------------------------------------------------


disconnect

void disconnect()
                throws IOException
------------------------------------------------------------------- Connect to a destination using SSL. The port is explicit.

Throws:
IOException

sendData

void sendData(byte[] message)
              throws IOException
------------------------------------------------------------------- Sends a chunk of data over the SSL transport.

Throws:
IOException

receiveData

byte[] receiveData()
                   throws IOException
------------------------------------------------------------------- You may use this in combination with transport listener but the transport guarantees no coherence as data received in this method may not be delivered to the data listener.

Throws:
IOException

receiveData

byte[] receiveData(long waitTime)
                   throws IOException
------------------------------------------------------------------- Same as receiveData() except the function will return after waiting for a certain amount of time.

Parameters:
waitTime - 0 means the same as receiveData();
Throws:
IOException

setTransportDataListener

void setTransportDataListener(TransportDataListener l)
------------------------------------------------------------------- Recieve a chunk of data over the SSL tranposrt. This method will block until all data within a chunk is received.


getType

String getType()
-------------------------------------------------------------------

Returns:
A unique id for this transport type. i.e. SSL, TCP, UDP, ...


For comments and suggestions please send e-mail to The NaradaBrokering Project