Enhydra 5.1 API

org.enhydra.servlet.filter
Class RequestFilter

java.lang.Object
  |
  +--org.enhydra.servlet.filter.RequestFilter
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, org.apache.tomcat.core.RequestAdapter, javax.servlet.ServletRequest
Direct Known Subclasses:
PrintTransactionRequest, RequestRecord

public class RequestFilter
extends java.lang.Object
implements javax.servlet.http.HttpServletRequest, org.apache.tomcat.core.RequestAdapter

This replaces the BasicTransactionRequest. This is part of the basic transaction filter. This is what wraps around the servlet request object. This class does nothing, every single call is a pass-through to the real request. This class exists so that it can be extended. You would then only need to override the methods you are interested in. All the other calls will be passed through by this class.

Author:
Andy John
, Shawn McMurdo

Field Summary
protected  org.apache.tomcat.core.RequestAdapter adapter
          The RequestAdapter used by Tomcat.
protected  javax.servlet.http.HttpServletRequest myRequest
          The original request.
 
Constructor Summary
RequestFilter(javax.servlet.http.HttpServletRequest originalRequest)
          Constructor.
 
Method Summary
 int doRead()
           
 int doRead(byte[] b, int off, int len)
           
 java.lang.Object getAttribute(java.lang.String name)
          This call is passed on to the original HttpServletRequest object.
 java.util.Enumeration getAttributeNames()
           
 java.lang.String getAuthType()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getCharacterEncoding()
          This call is passed on to the original HttpServletRequest object.
 int getContentLength()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getContentType()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getContextPath()
           
 java.lang.String[] getCookieHeaders()
           
 javax.servlet.http.Cookie[] getCookies()
          This call is passed on to the original HttpServletRequest object.
 long getDateHeader(java.lang.String name)
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getHeader(java.lang.String name)
          This call is passed on to the original HttpServletRequest object.
 java.util.Enumeration getHeaderNames()
          This call is passed on to the original HttpServletRequest object.
 java.util.Enumeration getHeaders(java.lang.String name)
           
 javax.servlet.ServletInputStream getInputStream()
          This call is passed on to the original HttpServletRequest object.
 int getIntHeader(java.lang.String name)
          This call is passed on to the original HttpServletRequest object.
 java.util.Locale getLocale()
           
 java.util.Enumeration getLocales()
           
 java.lang.String getMethod()
          This call is passed on to the original HttpServletRequest object.
 org.apache.tomcat.util.MimeHeaders getMimeHeaders()
           
 java.lang.String getParameter(java.lang.String name)
          This call is passed on to the original HttpServletRequest object.
 java.util.Enumeration getParameterNames()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String[] getParameterValues(java.lang.String name)
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getPathInfo()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getPathTranslated()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getProtocol()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getQueryString()
          This call is passed on to the original HttpServletRequest object.
 java.io.BufferedReader getReader()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getRealPath(java.lang.String path)
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getRemoteAddr()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getRemoteHost()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getRemoteUser()
          This call is passed on to the original HttpServletRequest object.
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String name)
           
 java.lang.String getRequestedSessionId()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getRequestURI()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getScheme()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getServerName()
          This call is passed on to the original HttpServletRequest object.
 int getServerPort()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getServletName()
           
 java.lang.String getServletPath()
          This call is passed on to the original HttpServletRequest object.
 java.lang.String getServletPrefix()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean create)
          This call is passed on to the original HttpServletRequest object.
 java.security.Principal getUserPrincipal()
           
 boolean isRequestedSessionIdFromCookie()
          This call is passed on to the original HttpServletRequest object.
 boolean isRequestedSessionIdFromUrl()
          This call is passed on to the original HttpServletRequest object.
 boolean isRequestedSessionIdFromURL()
           
 boolean isRequestedSessionIdValid()
          This call is passed on to the original HttpServletRequest object.
 boolean isSecure()
           
 boolean isUserInRole(java.lang.String role)
           
 void recycle()
           
 void removeAttribute(java.lang.String name)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void setQueryString(java.lang.String queryString)
          This call is passed on to the original HttpServletRequest object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myRequest

protected javax.servlet.http.HttpServletRequest myRequest
The original request. All calls will be passed through to this object. It is set by the constructor.


adapter

protected org.apache.tomcat.core.RequestAdapter adapter
The RequestAdapter used by Tomcat.

Constructor Detail

RequestFilter

public RequestFilter(javax.servlet.http.HttpServletRequest originalRequest)
Constructor. You must pass in the original request. All the HttpServletRequest calls will be passed on to this object.

Parameters:
originalRequest - The real HttpServletRequest, which all calls will be passed on to.
See Also:
ServletRequest, HttpServletRequest
Method Detail

getContentLength

public int getContentLength()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getContentLength in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getContentType

public java.lang.String getContentType()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getContentType in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getProtocol

public java.lang.String getProtocol()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getProtocol in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getScheme

public java.lang.String getScheme()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getScheme in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getServerName

public java.lang.String getServerName()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getServerName in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getServerPort

public int getServerPort()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getServerPort in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getRemoteAddr

public java.lang.String getRemoteAddr()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getRemoteHost

public java.lang.String getRemoteHost()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getRemoteHost in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getRealPath

public java.lang.String getRealPath(java.lang.String path)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getRealPath in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getInputStream in interface javax.servlet.ServletRequest
java.io.IOException
See Also:
ServletRequest

getParameter

public java.lang.String getParameter(java.lang.String name)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getParameter in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getParameterNames

public java.util.Enumeration getParameterNames()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getParameterNames in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the ServletRequest documentation.

Specified by:
getAttribute in interface javax.servlet.ServletRequest
See Also:
ServletRequest

getMethod

public java.lang.String getMethod()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getMethod in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getRequestURI

public java.lang.String getRequestURI()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getRequestURI in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getServletPath

public java.lang.String getServletPath()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getServletPath in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getPathInfo

public java.lang.String getPathInfo()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getPathInfo in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getPathTranslated

public java.lang.String getPathTranslated()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getPathTranslated in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getQueryString

public java.lang.String getQueryString()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getQueryString in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

setQueryString

public void setQueryString(java.lang.String queryString)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
setQueryString in interface org.apache.tomcat.core.RequestAdapter
See Also:
HttpServletRequest

getRemoteUser

public java.lang.String getRemoteUser()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getRemoteUser in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getAuthType

public java.lang.String getAuthType()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getAuthType in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getHeader

public java.lang.String getHeader(java.lang.String name)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getIntHeader

public int getIntHeader(java.lang.String name)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getIntHeader in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getDateHeader

public long getDateHeader(java.lang.String name)
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getDateHeader in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getHeaderNames

public java.util.Enumeration getHeaderNames()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getHeaderNames in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest

getCookies

public javax.servlet.http.Cookie[] getCookies()
This call is passed on to the original HttpServletRequest object.

Specified by:
getCookies in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getCookies()

getSession

public javax.servlet.http.HttpSession getSession(boolean create)
This call is passed on to the original HttpServletRequest object.

Specified by:
getSession in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getSession()

getRequestedSessionId

public java.lang.String getRequestedSessionId()
This call is passed on to the original HttpServletRequest object. For a description of what this call does, see the HttpServletRequest documentation.

Specified by:
getRequestedSessionId in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.getRequestedSessionId()

isRequestedSessionIdValid

public boolean isRequestedSessionIdValid()
This call is passed on to the original HttpServletRequest object.

Specified by:
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdValid()

isRequestedSessionIdFromCookie

public boolean isRequestedSessionIdFromCookie()
This call is passed on to the original HttpServletRequest object.

Specified by:
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdFromCookie()

isRequestedSessionIdFromUrl

public boolean isRequestedSessionIdFromUrl()
This call is passed on to the original HttpServletRequest object.

Specified by:
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequest
See Also:
HttpServletRequest.isRequestedSessionIdFromUrl()

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
This call is passed on to the original HttpServletRequest object.

Specified by:
getReader in interface javax.servlet.ServletRequest
Throws:
java.io.IOException - On other I/O related errors.
See Also:
ServletRequest.getReader()

getCharacterEncoding

public java.lang.String getCharacterEncoding()
This call is passed on to the original HttpServletRequest object.

Specified by:
getCharacterEncoding in interface javax.servlet.ServletRequest
See Also:
ServletRequest.getCharacterEncoding()

isUserInRole

public boolean isUserInRole(java.lang.String role)
Specified by:
isUserInRole in interface javax.servlet.http.HttpServletRequest

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface javax.servlet.ServletRequest

getUserPrincipal

public java.security.Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface javax.servlet.http.HttpServletRequest

getLocales

public java.util.Enumeration getLocales()
Specified by:
getLocales in interface javax.servlet.ServletRequest

getContextPath

public java.lang.String getContextPath()
Specified by:
getContextPath in interface javax.servlet.http.HttpServletRequest

getHeaders

public java.util.Enumeration getHeaders(java.lang.String name)
Specified by:
getHeaders in interface javax.servlet.http.HttpServletRequest

removeAttribute

public void removeAttribute(java.lang.String name)
Specified by:
removeAttribute in interface javax.servlet.ServletRequest

isSecure

public boolean isSecure()
Specified by:
isSecure in interface javax.servlet.ServletRequest

isRequestedSessionIdFromURL

public boolean isRequestedSessionIdFromURL()
Specified by:
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequest

getSession

public javax.servlet.http.HttpSession getSession()
Specified by:
getSession in interface javax.servlet.http.HttpServletRequest

getAttributeNames

public java.util.Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface javax.servlet.ServletRequest

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in interface javax.servlet.ServletRequest

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String name)
Specified by:
getRequestDispatcher in interface javax.servlet.ServletRequest

recycle

public void recycle()
Specified by:
recycle in interface org.apache.tomcat.core.RequestAdapter

getMimeHeaders

public org.apache.tomcat.util.MimeHeaders getMimeHeaders()
Specified by:
getMimeHeaders in interface org.apache.tomcat.core.RequestAdapter

getCookieHeaders

public java.lang.String[] getCookieHeaders()
Specified by:
getCookieHeaders in interface org.apache.tomcat.core.RequestAdapter

getServletPrefix

public java.lang.String getServletPrefix()
Specified by:
getServletPrefix in interface org.apache.tomcat.core.RequestAdapter

getServletName

public java.lang.String getServletName()
Specified by:
getServletName in interface org.apache.tomcat.core.RequestAdapter

doRead

public int doRead()
           throws java.io.IOException
Specified by:
doRead in interface org.apache.tomcat.core.RequestAdapter
java.io.IOException

doRead

public int doRead(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Specified by:
doRead in interface org.apache.tomcat.core.RequestAdapter
java.io.IOException

Enhydra 5.1 API