com.lightdev.app.trec.server.sam
Class SAMXmlRpcWorker

java.lang.Object
  extended by org.apache.xmlrpc.XmlRpcWorker
      extended by com.lightdev.app.trec.server.sam.SAMXmlRpcWorker

public class SAMXmlRpcWorker
extends XmlRpcWorker

An XmlRpcWorker that applies authentication and authorization to all client requests. The worker expects a SAM session id as the first parameter of each client request. Once properly authorized client requests are passed to the appropriate handler with the session id removed. When authorization fails an AccessException is thrown instead.

SAMXmlRpcWorker expects a SAMXmlRpcServer in its constructor to be sure, that an Authorizer handler, a Gatekeeper and SAMApplications are present. Client requests to methods login, logout and changeOwnPassword are passed without authentication and are routed to the Authorizer handler automatically.

Version:
2, 28.12.2005
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the BSD License, for details see file license.txt in the distribution package of this software

Field Summary
 
Fields inherited from class org.apache.xmlrpc.XmlRpcWorker
handlerMapping, requestProcessor, responseProcessor
 
Constructor Summary
SAMXmlRpcWorker(XmlRpcHandlerMapping handlerMapping, SAMXmlRpcServer s)
          construct a new instance of a SAMXmlRpcWorker object
 
Method Summary
 byte[] execute(InputStream is, XmlRpcContext context)
          execute an XML-RPC client request This method passes on all method calls to non SAMApplication handlers as well as all calls to methods login, logout and changeOwnPassword.
 
Methods inherited from class org.apache.xmlrpc.XmlRpcWorker
defaultContext, execute, invokeHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMXmlRpcWorker

public SAMXmlRpcWorker(XmlRpcHandlerMapping handlerMapping,
                       SAMXmlRpcServer s)
construct a new instance of a SAMXmlRpcWorker object

Parameters:
handlerMapping - the hanlder mapping
s - the XmlRpcServer havin Gatekeeper, Authorizer and SAMApplications
Method Detail

execute

public byte[] execute(InputStream is,
                      XmlRpcContext context)
execute an XML-RPC client request

This method passes on all method calls to non SAMApplication handlers as well as all calls to methods login, logout and changeOwnPassword. All other client requests are expected to have a SAM session id as their first parameter. The session id is used to authenticate and authorize the caller. Once proper authorized the call is passed on to the appropriate handler with the session id parameter removed. An AccessException is thrown when authorization fails.

Overrides:
execute in class XmlRpcWorker
Parameters:
is - the input stream having the HTTP request
context - the context