toolbox.socket
Interface SocketProtocolHandler

Package class diagram package SocketProtocolHandler
All Known Implementing Classes:
SocketProtocolHandlerNewLineImpl

public interface SocketProtocolHandler

Defines the protocol handling interface used by SocketClient implementations.

Implementations of this interface will implement the low level protocol required to communicate with server side sockets. This interface is the most common extension point of the Toolbox client socket API. Users of the API can use this interface to implement custom socket behaviour.


Method Summary
 void publish(java.net.Socket socket, java.lang.String payload)
          This method facilitates 1-way fire and forget client socket communication.
 java.lang.String request(java.net.Socket socket, java.lang.String payload)
          This method facilitates 2-way synchronous client socket communication.
 

Method Detail

request

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

Parameters:
socket - The client socket connection.
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.net.Socket socket,
             java.lang.String payload)
             throws SocketClientException
This method facilitates 1-way fire and forget client socket communication.

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