org.openmdx.security.auth.servlet.spi
Class AbstractAuthenticationHandler

java.lang.Object
  extended by org.openmdx.security.auth.servlet.spi.AbstractHandler
      extended by org.openmdx.security.auth.servlet.spi.AbstractAuthenticationHandler
All Implemented Interfaces:
ServletConfig, Invalidator, HttpAuthenticationHandler, HttpHandler
Direct Known Subclasses:
AbstractRemoteAuthenticationHandler, SimpleAuthenticationHandler

public abstract class AbstractAuthenticationHandler
extends AbstractHandler
implements HttpAuthenticationHandler, Invalidator

Abstract HTTP Authentication Handler


Constructor Summary
protected AbstractAuthenticationHandler()
          Constructor
 
Method Summary
protected  String applicationNameDefault()
          Provide the "application-name" default value.
protected  long callbackTimeoutDefault()
          Provide the "callback-timeout" default value.
 void destroy()
          Called by the servlet to indicate to a HTTP handler that the servlet is being taken out of service.
 AuthenticationContext getAuthentication(HttpServletRequest request, boolean create)
          Acquire an AuthenticationContext object
protected  String getCorrelationId(HttpServletRequest request)
          Get the correlation id for a given HTTP request.
protected abstract  Map getSharedOptions()
          Retrieve the shared options
protected  long idleTimeoutDefault()
          Provide the "idle-timeout" default value.
 void init()
          A convenience method which can be overridden so that there's no need to call super.init(config).
protected  int initialCapacityDefault()
          Provide the "initital-capacity" default value.
 void invalidateObject(Object obj)
           
protected  boolean isLenient()
          Retrieve the lenient.
protected  boolean lenientDefault()
          Provide the "lenient" default value.
protected  String loginConfigurationDefault()
          Provide the "login-configuration" default value.
protected  int maximumCapacityDefault()
          Provide the "maximum-capacity" default value.
protected  long maximumWaitDefault()
          Provide the "maximum-wait" default value.
 void returnAuthentication(HttpServletRequest request)
          Return an Authentication object
 
Methods inherited from class org.openmdx.security.auth.servlet.spi.AbstractHandler
debugDefault, endBody, endDocument, endHead, getInitParameter, getInitParameter, getInitParameter, getInitParameter, getInitParameter, getInitParameterNames, getServletContext, getServletName, init, isDebug, log, log, startBody, startDocument, startHead, writeEncoded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmdx.security.auth.servlet.cci.HttpHandler
init
 

Constructor Detail

AbstractAuthenticationHandler

protected AbstractAuthenticationHandler()
Constructor

Method Detail

isLenient

protected final boolean isLenient()
Retrieve the lenient.

Returns:
the lenient's value

getSharedOptions

protected abstract Map getSharedOptions()
                                 throws ServletException
Retrieve the shared options

Returns:
a Map containing the default options shared by all LoginModules
Throws:
ServletException

init

public void init()
          throws ServletException
Description copied from class: AbstractHandler
A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding init(ServletConfig), simply override this method and it will be called by AbstractHandler.init(ServletConfig).

Overrides:
init in class AbstractHandler
Throws:
ServletException

destroy

public void destroy()
Description copied from interface: HttpHandler
Called by the servlet to indicate to a HTTP handler that the servlet is being taken out of service. This method is only called once all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet calls this method, it will not call any of the handler's methods again.$

This method gives the HTTP hanlder an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the handler's current state in memory.

Specified by:
destroy in interface HttpHandler
Overrides:
destroy in class AbstractHandler

getCorrelationId

protected String getCorrelationId(HttpServletRequest request)
Get the correlation id for a given HTTP request.

Returns:
the correlation id to be used to associate a HTTP request with an Authentication object.

getAuthentication

public AuthenticationContext getAuthentication(HttpServletRequest request,
                                               boolean create)
                                        throws ServletException,
                                               TimeoutException
Description copied from interface: HttpAuthenticationHandler
Acquire an AuthenticationContext object

Specified by:
getAuthentication in interface HttpAuthenticationHandler
create - tells whther the Authentication should be newly created or retrieved.
Returns:
an Authentication object
Throws:
ServletException - if Authentication acquisition fails
TimeoutException - in case of timeout

returnAuthentication

public void returnAuthentication(HttpServletRequest request)
                          throws ServletException,
                                 TimeoutException
Description copied from interface: HttpAuthenticationHandler
Return an Authentication object

Specified by:
returnAuthentication in interface HttpAuthenticationHandler
Throws:
ServletException - if Authentication return fails
TimeoutException - in case of timeout

invalidateObject

public void invalidateObject(Object obj)
                      throws Exception
Specified by:
invalidateObject in interface Invalidator
Throws:
Exception

loginConfigurationDefault

protected String loginConfigurationDefault()
Provide the "login-configuration" default value.

Returns:
the "login-configuration" default value

initialCapacityDefault

protected int initialCapacityDefault()
Provide the "initital-capacity" default value.

Returns:
the "initital-capacity" default value

maximumCapacityDefault

protected int maximumCapacityDefault()
Provide the "maximum-capacity" default value.

Returns:
the "maximum-capacity" default value

maximumWaitDefault

protected long maximumWaitDefault()
Provide the "maximum-wait" default value.

Returns:
the "maximum-wait" default value

idleTimeoutDefault

protected long idleTimeoutDefault()
Provide the "idle-timeout" default value.

Returns:
the "idle-timeout" default value

callbackTimeoutDefault

protected long callbackTimeoutDefault()
Provide the "callback-timeout" default value.

Returns:
the "callback-timeout" default value

lenientDefault

protected boolean lenientDefault()
Provide the "lenient" default value.

Returns:
the "lenient" default value

applicationNameDefault

protected String applicationNameDefault()
Provide the "application-name" default value.

Returns:
the "application-name" default value


This software is published under the BSD license. Copyright © 2003-2008, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.