2.17.2: 2011-06-17

net.sf.basedb.clients.jobagent.handlers
Class DefaultRequestHandler

java.lang.Object
  extended by net.sf.basedb.clients.jobagent.handlers.DefaultRequestHandler
All Implemented Interfaces:
RequestHandler

public class DefaultRequestHandler
extends Object
implements RequestHandler

This is the default request handler for incoming requests to a job agent. It registeres implementations for the following commands:

Version:
2.0
Author:
nicklas
Last modified
$Date: 2010-10-15 13:59:00 +0200 (Fri, 15 Oct 2010) $

Field Summary
private  Agent agent
           
private  Map<String,RequestHandler> commandHandlers
           
private static Logger log
          Log job agent events.
 
Constructor Summary
DefaultRequestHandler(Agent agent)
           
 
Method Summary
 String handleCmd(Socket incoming, String cmd)
          Handle a command that was sent by an incoming request.
 void registerHandler(RequestHandler handler, String... cmds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log
Log job agent events.


agent

private final Agent agent

commandHandlers

private final Map<String,RequestHandler> commandHandlers
Constructor Detail

DefaultRequestHandler

public DefaultRequestHandler(Agent agent)
Method Detail

registerHandler

public void registerHandler(RequestHandler handler,
                            String... cmds)

handleCmd

public String handleCmd(Socket incoming,
                        String cmd)
Description copied from interface: RequestHandler
Handle a command that was sent by an incoming request.

Specified by:
handleCmd in interface RequestHandler
Parameters:
incoming - The socket that is handling the communication with the remote client
cmd - The command
Returns:
The answer

2.17.2: 2011-06-17