org.norther.tammi.spray.protocol.chain
Class HeadersRequest

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.protocol.chain.AbstractProtocolRequest
                  extended by org.norther.tammi.spray.protocol.chain.HeadersRequest
All Implemented Interfaces:
EventListener, HttpServletRequest, ServletRequest, Poolable, Recyclable, FilterChainListener
Direct Known Subclasses:
ProtocolRequest, RelayRequest, SavedRequest

public abstract class HeadersRequest
extends AbstractProtocolRequest

An abstract protocol request implementing URL and header methods.

Version:
$Id: HeadersRequest.java,v 1.8 2010-03-30 16:01:28 cvsimp Exp $
Author:
Ilkka Priha

Nested Class Summary
 
Nested classes/interfaces inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
AbstractProtocolRequest.InternalRemoteClient, AbstractProtocolRequest.ProtocolRequestExtension
 
Field Summary
 
Fields inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
AUTHENTICATION_PARSED, BODY_PARSED, CHARSET_PARSED, COOKIE_SESSION, HEADERS_PARSED, REQUEST_PARSED, URI_PARSED, URL_SESSION
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
HeadersRequest()
          Constructs a new request.
HeadersRequest(ServletRequest req)
          Constructs a new request with a wrapped one.
 
Method Summary
 void dispose()
          Disposes the object after use.
 String getCharacterEncoding()
           
 int getContentLength()
           
 String getContentType()
           
 Cookie[] getCookies()
           
 long getDateHeader(String name)
           
 String getHeader(String name)
           
 Enumeration<String> getHeaderNames()
           
 Enumeration<String> getHeaders(String name)
           
 int getIntHeader(String name)
           
 Locale getLocale()
           
 Enumeration<Locale> getLocales()
           
 String getMethod()
           
protected abstract  Map<String,String[]> getParsedHeaderMap()
          Gets the parsed HTTP headers as a map of names and value vectors.
protected abstract  List<String> getParsedRequestList()
          Gets the parsed request as a list of items.
protected abstract  String getParsedRequestURI()
          Gets the parsed request URI.
 String getProtocol()
           
 String getQueryString()
           
 String getRemoteAddr()
           
 RequestDispatcher getRequestDispatcher(String path)
           
 String getRequestURI()
           
 StringBuffer getRequestURL()
           
 String getServerName()
           
 int getServerPort()
           
 String getServletPath()
           
 
Methods inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
addParameter, addParameter, getAuthorityURL, getAuthorityURL, getAuthorityURL, getHttpFilter, getParameter, getParameterMap, getParameterNames, getParameters, getParameterValues, getParsedCharacterEncoding, getParsedParameterMap, getParsedURLAuthentication, getPathTail, getRedirectionURL, getVersion, isRedirection, isUnparsedPath, removeParameter, setParameter, setRedirection, setRedirectionURL
 
Methods inherited from class org.norther.tammi.spray.filter.chain.HttpServletRequestWrapper
getAuthType, getContextPath, getPathInfo, getPathTranslated, getRemoteUser, getRequestedSessionId, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, setRequest
 
Methods inherited from class org.norther.tammi.spray.filter.chain.ServletRequestWrapper
completed, disposed, filtered, getExtension, getFilterChain, isDisposed, recycle, recycle, recycled
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getInputStream, getLocalAddr, getLocalName, getLocalPort, getReader, getRealPath, getRemoteHost, getRemotePort, getRequest, getScheme, 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, getInputStream, getLocalAddr, getLocalName, getLocalPort, getReader, getRealPath, getRemoteHost, getRemotePort, getScheme, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Constructor Detail

HeadersRequest

public HeadersRequest()
Constructs a new request.


HeadersRequest

public HeadersRequest(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 AbstractProtocolRequest

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface ServletRequest
Overrides:
getProtocol in class ServletRequestWrapper

getServerName

public String getServerName()
Specified by:
getServerName in interface ServletRequest
Overrides:
getServerName in class ServletRequestWrapper

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface ServletRequest
Overrides:
getServerPort in class ServletRequestWrapper

getRemoteAddr

public String getRemoteAddr()
Specified by:
getRemoteAddr in interface ServletRequest
Overrides:
getRemoteAddr in class ServletRequestWrapper

getContentType

public String getContentType()
Specified by:
getContentType in interface ServletRequest
Overrides:
getContentType in class ServletRequestWrapper

getContentLength

public int getContentLength()
Specified by:
getContentLength in interface ServletRequest
Overrides:
getContentLength in class ServletRequestWrapper

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ServletRequest
Overrides:
getCharacterEncoding in class AbstractProtocolRequest

getLocale

public Locale getLocale()
Specified by:
getLocale in interface ServletRequest
Overrides:
getLocale in class ServletRequestWrapper

getLocales

public Enumeration<Locale> getLocales()
Specified by:
getLocales in interface ServletRequest
Overrides:
getLocales in class ServletRequestWrapper

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface ServletRequest
Overrides:
getRequestDispatcher in class ServletRequestWrapper

getMethod

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

getRequestURL

public StringBuffer getRequestURL()
Specified by:
getRequestURL in interface HttpServletRequest
Overrides:
getRequestURL in class HttpServletRequestWrapper

getRequestURI

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

getServletPath

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

getQueryString

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

getHeader

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

getIntHeader

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

getDateHeader

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

getHeaders

public Enumeration<String> getHeaders(String name)
Specified by:
getHeaders in interface HttpServletRequest
Overrides:
getHeaders in class HttpServletRequestWrapper

getHeaderNames

public Enumeration<String> getHeaderNames()
Specified by:
getHeaderNames in interface HttpServletRequest
Overrides:
getHeaderNames in class HttpServletRequestWrapper

getCookies

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

getParsedRequestList

protected abstract List<String> getParsedRequestList()
Gets the parsed request as a list of items.

Returns:
the parsed request as a list.
Throws:
IllegalArgumentException - for parsing errors.

getParsedHeaderMap

protected abstract Map<String,String[]> getParsedHeaderMap()
Gets the parsed HTTP headers as a map of names and value vectors.

Returns:
the parsed headers as a map.

getParsedRequestURI

protected abstract String getParsedRequestURI()
Gets the parsed request URI.

Returns:
the parsed request URI.


Copyright © 2004 The Norther Organization. All rights reserved.