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

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.BaseProtocolRequest
                      extended by org.norther.tammi.spray.protocol.chain.HttpRelayRequest
All Implemented Interfaces:
EventListener, HttpServletRequest, ServletRequest, Poolable, Recyclable, FilterChainListener

public final class HttpRelayRequest
extends BaseProtocolRequest

A HTTP relay request.

Author:
Ilkka Priha

Nested Class Summary
 
Nested classes/interfaces inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
AbstractProtocolRequest.ProtocolRequestExtension
 
Field Summary
 
Fields inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
BODY_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
HttpRelayRequest()
          Constructs a new request.
 
Method Summary
 void dispose()
          Disposes the object after use.
protected  void drain()
          Drains a HTTP/1.1 request to guarantee a fresh stream for the next round.
protected  Map getParsedHeaderMap()
          Gets the parsed HTTP headers as a map of names and value vectors.
protected  Map getParsedParameterMap()
          Gets the parsed parameters as a map of names and value arrays.
protected  List getParsedRequestList()
          Gets the parsed request as a list of items.
protected  String getParsedRequestURI()
          Gets the parsed request URI.
protected  boolean isRedirection()
          Checks whether this request is a redirection.
 boolean parse()
          Parses a new request from the same stream.
 void relay(OutputStream out, String ctx, String uri)
          Relays the request.
 
Methods inherited from class org.norther.tammi.spray.protocol.chain.BaseProtocolRequest
getCharacterEncoding, getContentLength, getContentType, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getLocale, getLocales, getMethod, getProtocol, getQueryString, getRequestDispatcher, getRequestURI, getRequestURL, getServerName, getServerPort, getServletPath
 
Methods inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
addParameter, addParameter, addParameterMap, getAuthorityURL, getAuthorityURL, getAuthorityURL, getHttpFilter, getInternalCharacterEncoding, getParameter, getParameterMap, getParameterNames, getParameterValues, getPathTail, getRedirectionURL, getVersion, isAuthentication, isSecureSession, removeParameter, setAuthentication, 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, getFilteredRequest, getFilteredResponse, isDisposed, recycle, recycle, recycled, setExtension
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getInputStream, getLocalAddr, getLocalName, getLocalPort, getReader, getRealPath, getRemoteAddr, 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, getRemoteAddr, getRemoteHost, getRemotePort, getScheme, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Constructor Detail

HttpRelayRequest

public HttpRelayRequest()
Constructs a new 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 BaseProtocolRequest

relay

public void relay(OutputStream out,
                  String ctx,
                  String uri)
           throws IOException
Relays the request.

Parameters:
out - the relayed output stream.
ctx - an optional context path.
uri - an optional relayed URI.
Throws:
IOException - for I/O errors.
RuntimeException - for parsing errors.

parse

public boolean parse()
Parses a new request from the same stream.

Returns:
true if there was anything to parse.

drain

protected void drain()
Description copied from class: AbstractProtocolRequest
Drains a HTTP/1.1 request to guarantee a fresh stream for the next round.

Specified by:
drain in class AbstractProtocolRequest

isRedirection

protected boolean isRedirection()
Description copied from class: AbstractProtocolRequest
Checks whether this request is a redirection.

Overrides:
isRedirection in class AbstractProtocolRequest
Returns:
true if a redirection, otherwise false.

getParsedRequestList

protected List getParsedRequestList()
Description copied from class: BaseProtocolRequest
Gets the parsed request as a list of items.

Specified by:
getParsedRequestList in class BaseProtocolRequest
Returns:
the parsed request as a list.

getParsedHeaderMap

protected Map getParsedHeaderMap()
Description copied from class: BaseProtocolRequest
Gets the parsed HTTP headers as a map of names and value vectors.

Specified by:
getParsedHeaderMap in class BaseProtocolRequest
Returns:
the parsed headers as a map.

getParsedParameterMap

protected Map getParsedParameterMap()
Description copied from class: AbstractProtocolRequest
Gets the parsed parameters as a map of names and value arrays.

Overrides:
getParsedParameterMap in class AbstractProtocolRequest
Returns:
the parsed parameters as a map.

getParsedRequestURI

protected String getParsedRequestURI()
Description copied from class: BaseProtocolRequest
Gets the parsed request URI.

Specified by:
getParsedRequestURI in class BaseProtocolRequest
Returns:
the parsed request URI.


Copyright © 2004 The Norther Organization. All rights reserved.