org.aselect.server.request.handler.aselect.authentication
Class AbstractAPIRequestHandler

java.lang.Object
  extended by org.aselect.server.request.handler.aselect.authentication.AbstractAPIRequestHandler
All Implemented Interfaces:
IRequestHandler
Direct Known Subclasses:
ApplicationAPIHandler, ASelectAPIHandler, AuthSPAPIHandler

public abstract class AbstractAPIRequestHandler
extends java.lang.Object
implements IRequestHandler

Abstract API request handler.

Description:
This class can be used as a base class for request handlers which handle API requests. The AbstractAPIRequestHandler creates an appropriate message creator.

Concurrency issues:
Use one AbstractAPIRequestHandler implementation for a single request.

Author:
Alfa & Ariss

Field Summary
protected  java.lang.String _sModule
          The module name.
protected  java.lang.String _sMyOrg
          The origanisation
protected  java.lang.String _sMyServerId
          The server ID
protected  ASelectSystemLogger _systemLogger
          The system logger.
 
Constructor Summary
AbstractAPIRequestHandler(RequestParser reqParser, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, java.lang.String sMyServerId, java.lang.String sMyOrg)
          Construct a instance.
 
Method Summary
protected abstract  void processAPIRequest(IProtocolRequest oProtocolRequest, IInputMessage oInputMessage, IOutputMessage oOutputMessage)
          Prosesses the API request.
 void processRequest()
          Main process function.
protected  java.lang.String serializeAttributes(java.util.Hashtable htAttributes)
          Serialize attributes contained in a hashtable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sModule

protected java.lang.String _sModule
The module name. Can be overwritten in sub classes


_systemLogger

protected ASelectSystemLogger _systemLogger
The system logger.


_sMyServerId

protected java.lang.String _sMyServerId
The server ID


_sMyOrg

protected java.lang.String _sMyOrg
The origanisation

Constructor Detail

AbstractAPIRequestHandler

public AbstractAPIRequestHandler(RequestParser reqParser,
                                 javax.servlet.http.HttpServletRequest servletRequest,
                                 javax.servlet.http.HttpServletResponse servletResponse,
                                 java.lang.String sMyServerId,
                                 java.lang.String sMyOrg)
                          throws ASelectCommunicationException
Construct a instance.

Description:
Handles are obtained to relevant managers and determines the protocol.

Parameters:
reqParser - The request parser to be used.
servletRequest - The request.
servletResponse - The response.
sMyServerId - The A-Select Server ID.
sMyOrg - The A-Select Server organisation.
Throws:
ASelectCommunicationException - If communication fails.
Method Detail

processRequest

public void processRequest()
                    throws ASelectException
Main process function.

Description:
Creates a Communicator and calls processAPIRequest(IProtocolRequest, IInputMessage, IOutputMessage)

Specified by:
processRequest in interface IRequestHandler
Throws:
ASelectException - if communication fails and no response is send to the client.

processAPIRequest

protected abstract void processAPIRequest(IProtocolRequest oProtocolRequest,
                                          IInputMessage oInputMessage,
                                          IOutputMessage oOutputMessage)
                                   throws ASelectException
Prosesses the API request.

Parameters:
oProtocolRequest - The request protocol properties.
oInputMessage - The input message.
oOutputMessage - The output message.
Throws:
ASelectException - If processing fails and no response is send to the client.

serializeAttributes

protected java.lang.String serializeAttributes(java.util.Hashtable htAttributes)
                                        throws ASelectException
Serialize attributes contained in a hashtable.

Description:
This method serializes attributes contained in a hashtable:

Parameters:
htAttributes - Hashtable containing all attributes
Returns:
Serialized representation of the attributes
Throws:
ASelectException - If serialization fails.


Copyright © 2008 SURFnet BV. All Rights Reserved.