org.norther.tammi.spray.filter.chain
Class HttpServletRequestWrapper

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
All Implemented Interfaces:
EventListener, HttpServletRequest, ServletRequest, Poolable, Recyclable, FilterChainListener
Direct Known Subclasses:
AbstractProtocolRequest, AuthenticatedRequest, TerminalRequest

public class HttpServletRequestWrapper
extends ServletRequestWrapper
implements HttpServletRequest

A wrapper implementation of the javax.servlet.http.HttpServletRequest interface providing a recyclable alternative to the javax.servlet.http.HttpServletRequestWrapper class. By default, it passes all method calls to the wrapped implementation of the interface.

It also supports dummy methods for a wrapped javax.servlet.ServletRequest implemention.

Author:
Ilkka Priha

Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
HttpServletRequestWrapper()
          Contstructs a new wrapper.
HttpServletRequestWrapper(ServletRequest req)
          Constructs a new wrapper with a request.
 
Method Summary
 void dispose()
          Disposes the object after use.
 String getAuthType()
           
 String getContextPath()
           
 Cookie[] getCookies()
           
 long getDateHeader(String name)
           
 String getHeader(String name)
           
 Enumeration getHeaderNames()
           
 Enumeration getHeaders(String name)
           
 int getIntHeader(String name)
           
 String getMethod()
           
 String getPathInfo()
           
 String getPathTranslated()
           
 String getQueryString()
           
 String getRemoteUser()
           
 String getRequestedSessionId()
           
 String getRequestURI()
           
 StringBuffer getRequestURL()
           
 String getServletPath()
           
 HttpSession getSession()
           
 HttpSession getSession(boolean create)
           
 Principal getUserPrincipal()
           
 boolean isRequestedSessionIdFromCookie()
           
 boolean isRequestedSessionIdFromUrl()
           
 boolean isRequestedSessionIdFromURL()
           
 boolean isRequestedSessionIdValid()
           
 boolean isUserInRole(String role)
           
 void setRequest(ServletRequest req)
           
 
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

HttpServletRequestWrapper

public HttpServletRequestWrapper()
Contstructs a new wrapper.


HttpServletRequestWrapper

public HttpServletRequestWrapper(ServletRequest req)
Constructs a new wrapper with a request.

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 ServletRequestWrapper

setRequest

public void setRequest(ServletRequest req)
Overrides:
setRequest in class ServletRequestWrapper

getMethod

public String getMethod()
Specified by:
getMethod in interface HttpServletRequest

getRequestURL

public StringBuffer getRequestURL()
Specified by:
getRequestURL in interface HttpServletRequest

getRequestURI

public String getRequestURI()
Specified by:
getRequestURI in interface HttpServletRequest

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface HttpServletRequest

getServletPath

public String getServletPath()
Specified by:
getServletPath in interface HttpServletRequest

getQueryString

public String getQueryString()
Specified by:
getQueryString in interface HttpServletRequest

getHeaderNames

public Enumeration getHeaderNames()
Specified by:
getHeaderNames in interface HttpServletRequest

getHeader

public String getHeader(String name)
Specified by:
getHeader in interface HttpServletRequest

getIntHeader

public int getIntHeader(String name)
                 throws NumberFormatException
Specified by:
getIntHeader in interface HttpServletRequest
Throws:
NumberFormatException

getDateHeader

public long getDateHeader(String name)
Specified by:
getDateHeader in interface HttpServletRequest

getHeaders

public Enumeration getHeaders(String name)
Specified by:
getHeaders in interface HttpServletRequest

getRequestedSessionId

public String getRequestedSessionId()
Specified by:
getRequestedSessionId in interface HttpServletRequest

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
Specified by:
isRequestedSessionIdFromCookie in interface HttpServletRequest

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
Specified by:
isRequestedSessionIdFromUrl in interface HttpServletRequest

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Specified by:
isRequestedSessionIdFromURL in interface HttpServletRequest

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
Specified by:
isRequestedSessionIdValid in interface HttpServletRequest

getSession

public HttpSession getSession()
Specified by:
getSession in interface HttpServletRequest

getSession

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

getCookies

public Cookie[] getCookies()
Specified by:
getCookies in interface HttpServletRequest

getPathInfo

public String getPathInfo()
Specified by:
getPathInfo in interface HttpServletRequest

getPathTranslated

public String getPathTranslated()
Specified by:
getPathTranslated in interface HttpServletRequest

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface HttpServletRequest

getRemoteUser

public String getRemoteUser()
Specified by:
getRemoteUser in interface HttpServletRequest

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface HttpServletRequest

isUserInRole

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


Copyright © 2004 The Norther Organization. All rights reserved.