kaos.core.csi.util.tcpSupport
Class ServerRequestHandler

java.lang.Object
  extended by kaos.core.csi.util.tcpSupport.CommHandler
      extended by kaos.core.csi.util.tcpSupport.ServerRequestHandler
All Implemented Interfaces:
java.lang.Runnable, ResponseSender

public class ServerRequestHandler
extends CommHandler
implements ResponseSender

This class accepts requests for actions from a client. It reads input stream from the client socket, parses it and formats it into a String that contains request name and properties. The string is passed to the XML-CSILink for further processing of the request. This class also receives a response from the action executor and sends it back to the client.


Field Summary
 
Fields inherited from class kaos.core.csi.util.tcpSupport.CommHandler
_clientSocket, _logger, _os
 
Constructor Summary
ServerRequestHandler(java.net.Socket clientSocket)
          Constructor
 
Method Summary
 java.lang.String getID()
          This method is invoked in order to send a response back via tcp sockets.
protected  void processBuffer(java.lang.String line, java.io.BufferedReader bufferedReader)
           
 void sendResponse(java.lang.String response)
          This method is invoked in order to send a response back via tcp sockets.
 
Methods inherited from class kaos.core.csi.util.tcpSupport.CommHandler
processLine, readLine, run, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerRequestHandler

public ServerRequestHandler(java.net.Socket clientSocket)
                     throws java.lang.Exception
Constructor

Parameters:
clientSocket - Socket used to communicate with a client.
Throws:
java.lang.Exception
Method Detail

processBuffer

protected void processBuffer(java.lang.String line,
                             java.io.BufferedReader bufferedReader)
Overrides:
processBuffer in class CommHandler

sendResponse

public void sendResponse(java.lang.String response)
Description copied from interface: ResponseSender
This method is invoked in order to send a response back via tcp sockets.

Specified by:
sendResponse in interface ResponseSender
Parameters:
response - String containing the response to send.

getID

public java.lang.String getID()
Description copied from interface: ResponseSender
This method is invoked in order to send a response back via tcp sockets.

Specified by:
getID in interface ResponseSender
Returns:
String containing the id for this ResponseSender.