org.norther.tammi.spray.authenticator.chain
Class AuthenticatedRequest

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by org.norther.tammi.spray.filter.chain.ServletRequestWrapper
          extended by org.norther.tammi.spray.filter.chain.HttpServletRequestWrapper
              extended by org.norther.tammi.spray.authenticator.chain.AuthenticatedRequest
All Implemented Interfaces:
EventListener, HttpServletRequest, ServletRequest, Poolable, Recyclable, FilterChainListener

public class AuthenticatedRequest
extends HttpServletRequestWrapper

A default implementation of the authenticated request.

Author:
Ilkka Priha

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
AuthenticatedRequest()
          Constructs a new request.
AuthenticatedRequest(ServletRequest req)
          Constructs a new request with a wrapped one.
 
Method Summary
 void dispose()
          Disposes the object after use.
protected  AuthenticatorFilter getAuthenticatorFilter()
          Gets the authenticator filter.
 String getAuthType()
           
 String getRemoteUser()
           
 HttpSession getSession(boolean create)
           
 Principal getUserPrincipal()
           
 boolean isUserInRole(String role)
           
 void setUserPrincipal(Principal principal, boolean disable)
          Sets the user principal.
 
Methods inherited from class org.norther.tammi.spray.filter.chain.HttpServletRequestWrapper
getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, setRequest
 
Methods inherited from class org.norther.tammi.spray.filter.chain.ServletRequestWrapper
completed, disposed, filtered, getExtension, getFilterChain, getFilteredRequest, getFilteredResponse, isDisposed, recycle, recycle, recycled, setExtension
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Constructor Detail

AuthenticatedRequest

public AuthenticatedRequest()
Constructs a new request.


AuthenticatedRequest

public AuthenticatedRequest(ServletRequest req)
Constructs a new request with a wrapped one.

Parameters:
req - the wrapped request.
Method Detail

dispose

public void dispose()
Description copied from interface: Recyclable
Disposes the object after use. The method is called when the object is returned to its pool. The dispose method must call its super.

Specified by:
dispose in interface Recyclable
Overrides:
dispose in class HttpServletRequestWrapper

getSession

public HttpSession getSession(boolean create)
Specified by:
getSession in interface HttpServletRequest
Overrides:
getSession in class HttpServletRequestWrapper

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface HttpServletRequest
Overrides:
getAuthType in class HttpServletRequestWrapper

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface HttpServletRequest
Overrides:
getRemoteUser in class HttpServletRequestWrapper

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface HttpServletRequest
Overrides:
getUserPrincipal in class HttpServletRequestWrapper

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in interface HttpServletRequest
Overrides:
isUserInRole in class HttpServletRequestWrapper

setUserPrincipal

public void setUserPrincipal(Principal principal,
                             boolean disable)
Sets the user principal.

Parameters:
principal - the authenticated principal.
disable - a flag to disable the session cache.

getAuthenticatorFilter

protected AuthenticatorFilter getAuthenticatorFilter()
Gets the authenticator filter.

Returns:
the authenticator filter.
Throws:
IllegalStateException - if not available.


Copyright © 2004 The Norther Organization. All rights reserved.