org.apache.catalina

Interface HttpRequest

All Superinterfaces:
Request
Known Implementing Classes:
CoyoteRequest, CoyoteRequest, DummyRequest

public interface HttpRequest
extends Request

An HttpRequest is the Catalina internal facade for an HttpServletRequest that is to be processed, in order to produce the corresponding HttpResponse.

Version:
$Revision: 1.4 $ $Date: 2004/02/27 14:58:38 $

Author:
Craig R. McClanahan

Method Summary

void
addCookie(Cookie cookie)
Add a Cookie to the set of Cookies associated with this Request.
void
addHeader(String name, String value)
Add a Header to the set of Headers associated with this Request.
void
addLocale(Locale locale)
Add a Locale to the set of preferred Locales for this Request.
void
addParameter(String name, values[] )
Add a parameter name and corresponding set of values to this Request.
void
clearCookies()
Clear the collection of Cookies associated with this Request.
void
clearHeaders()
Clear the collection of Headers associated with this Request.
void
clearLocales()
Clear the collection of Locales associated with this Request.
void
clearParameters()
Clear the collection of parameters associated with this Request.
MessageBytes
getContextPathMB()
Get the context path.
String
getDecodedRequestURI()
Get the decoded request URI.
MessageBytes
getDecodedRequestURIMB()
Get the decoded request URI.
MessageBytes
getPathInfoMB()
Get the path info.
MessageBytes
getRequestPathMB()
Get the request path.
MessageBytes
getServletPathMB()
Get the servlet path.
void
setAuthType(String type)
Set the authentication type used for this request, if any; otherwise set the type to null.
void
setContextPath(String path)
Set the context path for this Request.
void
setDecodedRequestURI(String uri)
Set the decoded request URI.
void
setMethod(String method)
Set the HTTP request method used for this Request.
void
setPathInfo(String path)
Set the path information for this Request.
void
setQueryString(String query)
Set the query string for this Request.
void
setRequestURI(String uri)
Set the unparsed request URI for this Request.
void
setRequestedSessionCookie(boolean flag)
Set a flag indicating whether or not the requested session ID for this request came in through a cookie.
void
setRequestedSessionId(String id)
Set the requested session ID for this request.
void
setRequestedSessionURL(boolean flag)
Set a flag indicating whether or not the requested session ID for this request came in through a URL.
void
setServletPath(String path)
Set the servlet path for this Request.
void
setUserPrincipal(Principal principal)
Set the Principal who has been authenticated for this Request.

Methods inherited from interface org.apache.catalina.Request

createInputStream, finishRequest, getAuthorization, getConnector, getContext, getFilterChain, getHost, getInfo, getNote, getNoteNames, getRequest, getResponse, getSocket, getStream, getValveContext, getWrapper, recycle, removeNote, setAuthorization, setConnector, setContentLength, setContentType, setContext, setFilterChain, setHost, setNote, setProtocol, setRemoteAddr, setResponse, setScheme, setSecure, setServerName, setServerPort, setSocket, setStream, setValveContext, setWrapper

Method Details

addCookie

public void addCookie(Cookie cookie)
Add a Cookie to the set of Cookies associated with this Request.

Parameters:
cookie - The new cookie


addHeader

public void addHeader(String name,
                      String value)
Add a Header to the set of Headers associated with this Request.

Parameters:
name - The new header name
value - The new header value


addLocale

public void addLocale(Locale locale)
Add a Locale to the set of preferred Locales for this Request. The first added Locale will be the first one returned by getLocales().

Parameters:
locale - The new preferred Locale


addParameter

public void addParameter(String name,
                         values[] )
Add a parameter name and corresponding set of values to this Request. (This is used when restoring the original request on a form based login).

Parameters:
name - Name of this request parameter


clearCookies

public void clearCookies()
Clear the collection of Cookies associated with this Request.


clearHeaders

public void clearHeaders()
Clear the collection of Headers associated with this Request.


clearLocales

public void clearLocales()
Clear the collection of Locales associated with this Request.


clearParameters

public void clearParameters()
Clear the collection of parameters associated with this Request.


getContextPathMB

public MessageBytes getContextPathMB()
Get the context path.

Returns:
the context path


getDecodedRequestURI

public String getDecodedRequestURI()
Get the decoded request URI.

Returns:
the URL decoded request URI


getDecodedRequestURIMB

public MessageBytes getDecodedRequestURIMB()
Get the decoded request URI.

Returns:
the URL decoded request URI


getPathInfoMB

public MessageBytes getPathInfoMB()
Get the path info.

Returns:
the path info


getRequestPathMB

public MessageBytes getRequestPathMB()
Get the request path.

Returns:
the request path


getServletPathMB

public MessageBytes getServletPathMB()
Get the servlet path.

Returns:
the servlet path


setAuthType

public void setAuthType(String type)
Set the authentication type used for this request, if any; otherwise set the type to null. Typical values are "BASIC", "DIGEST", or "SSL".

Parameters:
type - The authentication type used


setContextPath

public void setContextPath(String path)
Set the context path for this Request. This will normally be called when the associated Context is mapping the Request to a particular Wrapper.

Parameters:
path - The context path


setDecodedRequestURI

public void setDecodedRequestURI(String uri)
Set the decoded request URI.

Parameters:
uri - The decoded request URI


setMethod

public void setMethod(String method)
Set the HTTP request method used for this Request.

Parameters:
method - The request method


setPathInfo

public void setPathInfo(String path)
Set the path information for this Request. This will normally be called when the associated Context is mapping the Request to a particular Wrapper.

Parameters:
path - The path information


setQueryString

public void setQueryString(String query)
Set the query string for this Request. This will normally be called by the HTTP Connector, when it parses the request headers.

Parameters:
query - The query string


setRequestURI

public void setRequestURI(String uri)
Set the unparsed request URI for this Request. This will normally be called by the HTTP Connector, when it parses the request headers.

Parameters:
uri - The request URI


setRequestedSessionCookie

public void setRequestedSessionCookie(boolean flag)
Set a flag indicating whether or not the requested session ID for this request came in through a cookie. This is normally called by the HTTP Connector, when it parses the request headers.

Parameters:
flag - The new flag


setRequestedSessionId

public void setRequestedSessionId(String id)
Set the requested session ID for this request. This is normally called by the HTTP Connector, when it parses the request headers.

Parameters:
id - The new session id


setRequestedSessionURL

public void setRequestedSessionURL(boolean flag)
Set a flag indicating whether or not the requested session ID for this request came in through a URL. This is normally called by the HTTP Connector, when it parses the request headers.

Parameters:
flag - The new flag


setServletPath

public void setServletPath(String path)
Set the servlet path for this Request. This will normally be called when the associated Context is mapping the Request to a particular Wrapper.

Parameters:
path - The servlet path


setUserPrincipal

public void setUserPrincipal(Principal principal)
Set the Principal who has been authenticated for this Request. This value is also used to calculate the value to be returned by the getRemoteUser() method.

Parameters:
principal - The user Principal


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.