toolbox.socket
Interface SocketClient

Package class diagram package SocketClient
All Known Implementing Classes:
SocketClientImpl

public interface SocketClient

Interface that defines a high level abstraction for developing generic client side socket interactions.

Implementations of this interface will provide functionality to interact with client sockets.


Method Summary
 void destroy()
          Destroy this client.
 void init(SocketConnectionManager connMngr, SocketProtocolHandler handler)
          Initialise this client with the provided infrastructure components to facilitate socket communications.
 void publish(java.lang.String payload)
          This method facilitates 1-way fire and forget client socket communication.
 java.lang.String request(java.lang.String payload)
          This method facilitates 2-way synchronous client socket communication.
 

Method Detail

init

void init(SocketConnectionManager connMngr,
          SocketProtocolHandler handler)
Initialise this client with the provided infrastructure components to facilitate socket communications.

Parameters:
connMngr - SocketConnectionManager responsible for managing client socket connections.
handler - SocketProtocolHandler responsible for sending and receiving data over a client socket connection.

request

java.lang.String request(java.lang.String payload)
                         throws SocketClientException
This method facilitates 2-way synchronous client socket communication.

Parameters:
payload - Sring containing the request data.
Returns:
String containing the response data.
Throws:
SocketClientException - when an error occurs during socket communication.

publish

void publish(java.lang.String payload)
             throws SocketClientException
This method facilitates 1-way fire and forget client socket communication.

Parameters:
payload - String containing the data that must be plublished.
Throws:
SocketClientException - when an error occurs during socket communication.

destroy

void destroy()
Destroy this client.