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

java.lang.Object
  extended by org.openmdx.security.auth.servlet.spi.AbstractHandler
      extended by org.openmdx.security.auth.servlet.spi.AbstractSubjectHandler
All Implemented Interfaces:
ServletConfig, HttpHandler, HttpSubjectHandler
Direct Known Subclasses:
SimpleSubjectHandler

public abstract class AbstractSubjectHandler
extends AbstractHandler
implements HttpSubjectHandler


Constructor Summary
AbstractSubjectHandler()
           
 
Method Summary
protected  Cookie getCookie(Subject subject)
          Create Cookie based on the given subject's token
protected  String getCookieComment()
          Retrieve the cookieComment.
protected  String getCookieDomain()
          Retrieve the cookieDomain.
protected  String getCookieName()
          Retrieve the cookieName.
protected  String getCookiePath()
          Retrieve the cookiePath.
protected abstract  KeyProvider getKeyProvider()
          Retrieve this handler's KeyPrpvider
protected  String getSignatureAlgorithm()
          Retrieve the signatureAlgorithm.
protected  byte[] getToken(Subject subject)
          Create a base 64 encoded token based on the subject's principals
protected  TokenFactory getTokenFactory()
          Retrieve the tokenFactory.
protected  long getTokenTimeout()
          Retrieve the tokenTimeout.
 void init(ServletConfig configuration)
          Use the Servlet's configuration to initialize the handler.
protected  boolean isCookieSecure()
          Retrieve the cookieSecure.
 
Methods inherited from class org.openmdx.security.auth.servlet.spi.AbstractHandler
debugDefault, destroy, 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.HttpSubjectHandler
handle
 
Methods inherited from interface org.openmdx.security.auth.servlet.cci.HttpHandler
destroy
 

Constructor Detail

AbstractSubjectHandler

public AbstractSubjectHandler()
Method Detail

getCookieDomain

protected String getCookieDomain()
Retrieve the cookieDomain.

Returns:
the cookieDomain's value

getCookieName

protected String getCookieName()
Retrieve the cookieName.

Returns:
the cookieName's value

getCookieComment

protected String getCookieComment()
Retrieve the cookieComment.

Returns:
the cookieComment's value

getCookiePath

protected String getCookiePath()
Retrieve the cookiePath.

Returns:
the cookiePath's value

isCookieSecure

protected boolean isCookieSecure()
Retrieve the cookieSecure.

Returns:
the cookieSecure's value

getSignatureAlgorithm

protected String getSignatureAlgorithm()
Retrieve the signatureAlgorithm.

Returns:
the signatureAlgorithm's value

getTokenFactory

protected TokenFactory getTokenFactory()
Retrieve the tokenFactory.

Returns:
the tokenFactory's value

getTokenTimeout

protected long getTokenTimeout()
Retrieve the tokenTimeout.

Returns:
the tokenTimeout's value

getKeyProvider

protected abstract KeyProvider getKeyProvider()
Retrieve this handler's KeyPrpvider

Returns:
this handler's KeyProvider

init

public void init(ServletConfig configuration)
          throws ServletException
Description copied from class: AbstractHandler
Use the Servlet's configuration to initialize the handler.

Specified by:
init in interface HttpHandler
Overrides:
init in class AbstractHandler
Parameters:
configuration - TODO
Throws:
ServletException

getToken

protected byte[] getToken(Subject subject)
                   throws LoginException
Create a base 64 encoded token based on the subject's principals

Parameters:
subject -
Returns:
a token based on the given subject
Throws:
LoginException

getCookie

protected Cookie getCookie(Subject subject)
                    throws LoginException
Create Cookie based on the given subject's token

Parameters:
subject -
Returns:
a Cookie based on the subject's token
Throws:
LoginException


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