Package org.apache.catalina
Interface Request
-
- All Known Subinterfaces:
HttpRequest
- All Known Implementing Classes:
DummyRequest,HttpRequestWrapper,PwcCoyoteRequest,Request
public interface RequestA Request is the Catalina-internal facade for aServletRequestthat is to be processed, in order to produce the correspondingResponse.- Version:
- $Revision: 1.4 $ $Date: 2006/04/24 16:36:12 $
- Author:
- Craig R. McClanahan
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringchangeSessionId()Change the ID of the session that this request is associated with.jakarta.servlet.ServletInputStreamcreateInputStream()Create and return a ServletInputStream to read the content associated with this Request.voiddisableAsyncSupport()Disables async support on this request.voidfinishRequest()Perform whatever actions are required to flush and close the input stream or reader, in a single operation.StringgenerateSessionId()Generate and return a new session ID.StringgetAuthorization()Return the authorization credentials sent with this request.booleangetCheckRestrictedResources()Return whether or not access to resources under WEB-INF or META-INF needs to be checked.ConnectorgetConnector()Return the Connector through which this Request was received.ContextgetContext()Return the Context within which this Request is being processed.jakarta.servlet.FilterChaingetFilterChain()Get filter chain associated with the request.HostgetHost()Return the Host within which this Request is being processed.StringgetInfo()Return descriptive information about this Request implementation and the corresponding version number, in the format<description>/<version>.StringgetJrouteId()Gets the jroute id of this request, which may have been sent as a separateJROUTEcookie or appended to the session identifier encoded in the URI (if cookies have been disabled).ObjectgetNote(String name)Return the object bound with the specified name to the internal notes for this request, ornullif no such binding exists.IteratorgetNoteNames()Return an Iterator containing the String names of all notes bindings that exist for this request.jakarta.servlet.ServletRequestgetRequest()Return theServletRequestfor which this object is the facade.jakarta.servlet.ServletRequestgetRequest(boolean maskDefaultContextMapping)Return theServletRequestfor which this object is the facade.ResponsegetResponse()Return the Response with which this Request is associated.SessiongetSessionInternal(boolean create)Gets the session associated with this Request, creating one if necessary and requested.SocketgetSocket()Return the Socket (if any) through which this Request was received.InputStreamgetStream()Return the input stream associated with this Request.WrappergetWrapper()Return the Wrapper within which this Request is being processed.SessionlockSession()voidrecycle()Release all object references, and initialize instance variables, in preparation for reuse of this object.voidremoveNote(String name)Remove any object bound to the specified name in the internal notes for this request.voidsetCheckRestrictedResources(boolean check)Set whether or not access to resources under WEB-INF or META-INF needs to be checked.voidsetConnector(Connector connector)Set the Connector through which this Request was received.voidsetContentLength(int length)Set the content length associated with this Request.voidsetContentType(String type)Set the content type (and optionally the character encoding) associated with this Request.voidsetContext(Context context)Set the Context within which this Request is being processed.voidsetFilterChain(jakarta.servlet.FilterChain filterChain)Set filter chain associated with the request.voidsetHost(Host host)Set the Host within which this Request is being processed.voidsetNote(String name, Object value)Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.voidsetProtocol(String protocol)Set the protocol name and version associated with this Request.voidsetRemoteAddr(String remote)Set the remote IP address associated with this Request.voidsetRequestedSessionCookiePath(String cookiePath)Sets the requested session cookie path, see IT 7426voidsetResponse(Response response)Set the Response with which this Request is associated.voidsetSecure(boolean secure)Set the value to be returned byisSecure()for this Request.voidsetServerName(String name)Set the name of the server (virtual host) to process this request.voidsetServerPort(int port)Set the port number of the server to process this request.voidsetSocket(Socket socket)Set the Socket (if any) through which this Request was received.voidsetStream(InputStream stream)Set the input stream associated with this Request.voidsetWrapper(Wrapper wrapper)Set the Wrapper within which this Request is being processed.voidunlockSession()
-
-
-
Method Detail
-
getAuthorization
String getAuthorization()
Return the authorization credentials sent with this request.
-
getConnector
Connector getConnector()
Return the Connector through which this Request was received.
-
setConnector
void setConnector(Connector connector)
Set the Connector through which this Request was received.- Parameters:
connector- The new connector
-
getContext
Context getContext()
Return the Context within which this Request is being processed.
-
setContext
void setContext(Context context)
Set the Context within which this Request is being processed. This must be called as soon as the appropriate Context is identified, because it identifies the value to be returned bygetContextPath(), and thus enables parsing of the request URI.- Parameters:
context- The newly associated Context
-
getFilterChain
jakarta.servlet.FilterChain getFilterChain()
Get filter chain associated with the request.
-
setFilterChain
void setFilterChain(jakarta.servlet.FilterChain filterChain)
Set filter chain associated with the request.- Parameters:
filterChain- new filter chain
-
getHost
Host getHost()
Return the Host within which this Request is being processed.
-
setHost
void setHost(Host host)
Set the Host within which this Request is being processed. This must be called as soon as the appropriate Host is identified, and before the Request is passed to a context.- Parameters:
host- The newly associated Host
-
getInfo
String getInfo()
Return descriptive information about this Request implementation and the corresponding version number, in the format<description>/<version>.
-
getRequest
jakarta.servlet.ServletRequest getRequest()
Return theServletRequestfor which this object is the facade.
-
getRequest
jakarta.servlet.ServletRequest getRequest(boolean maskDefaultContextMapping)
Return theServletRequestfor which this object is the facade.- Parameters:
maskDefaultContextMapping- true if the fact that a request received at the root context was mapped to a default-web-module will be masked, false otherwise
-
getResponse
Response getResponse()
Return the Response with which this Request is associated.
-
setResponse
void setResponse(Response response)
Set the Response with which this Request is associated.- Parameters:
response- The new associated response
-
getSocket
Socket getSocket()
Return the Socket (if any) through which this Request was received. This should only be used to access underlying state information about this Socket, such as the SSLSession associated with an SSLSocket.
-
setSocket
void setSocket(Socket socket)
Set the Socket (if any) through which this Request was received.- Parameters:
socket- The socket through which this request was received
-
getStream
InputStream getStream()
Return the input stream associated with this Request.
-
setStream
void setStream(InputStream stream)
Set the input stream associated with this Request.- Parameters:
stream- The new input stream
-
getWrapper
Wrapper getWrapper()
Return the Wrapper within which this Request is being processed.
-
setWrapper
void setWrapper(Wrapper wrapper)
Set the Wrapper within which this Request is being processed. This must be called as soon as the appropriate Wrapper is identified, and before the Request is ultimately passed to an application servlet.- Parameters:
wrapper- The newly associated Wrapper
-
createInputStream
jakarta.servlet.ServletInputStream createInputStream() throws IOExceptionCreate and return a ServletInputStream to read the content associated with this Request.- Throws:
IOException- if an input/output error occurs
-
finishRequest
void finishRequest() throws IOExceptionPerform whatever actions are required to flush and close the input stream or reader, in a single operation.- Throws:
IOException- if an input/output error occurs
-
getNote
Object getNote(String name)
Return the object bound with the specified name to the internal notes for this request, ornullif no such binding exists.- Parameters:
name- Name of the note to be returned
-
getNoteNames
Iterator getNoteNames()
Return an Iterator containing the String names of all notes bindings that exist for this request.
-
recycle
void recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object.
-
removeNote
void removeNote(String name)
Remove any object bound to the specified name in the internal notes for this request.- Parameters:
name- Name of the note to be removed
-
setContentLength
void setContentLength(int length)
Set the content length associated with this Request.- Parameters:
length- The new content length
-
setContentType
void setContentType(String type)
Set the content type (and optionally the character encoding) associated with this Request. For example,text/html; charset=ISO-8859-4.- Parameters:
type- The new content type
-
setNote
void setNote(String name, Object value)
Bind an object to a specified name in the internal notes associated with this request, replacing any existing binding for this name.- Parameters:
name- Name to which the object should be boundvalue- Object to be bound to the specified name
-
setProtocol
void setProtocol(String protocol)
Set the protocol name and version associated with this Request.- Parameters:
protocol- Protocol name and version
-
setRemoteAddr
void setRemoteAddr(String remote)
Set the remote IP address associated with this Request. NOTE: This value will be used to resolve the value forgetRemoteHost()if that method is called.- Parameters:
remote- The remote IP address
-
setSecure
void setSecure(boolean secure)
Set the value to be returned byisSecure()for this Request.- Parameters:
secure- The new isSecure value
-
setServerName
void setServerName(String name)
Set the name of the server (virtual host) to process this request.- Parameters:
name- The server name
-
setServerPort
void setServerPort(int port)
Set the port number of the server to process this request.- Parameters:
port- The server port
-
setCheckRestrictedResources
void setCheckRestrictedResources(boolean check)
Set whether or not access to resources under WEB-INF or META-INF needs to be checked.
-
getCheckRestrictedResources
boolean getCheckRestrictedResources()
Return whether or not access to resources under WEB-INF or META-INF needs to be checked.
-
getJrouteId
String getJrouteId()
Gets the jroute id of this request, which may have been sent as a separateJROUTEcookie or appended to the session identifier encoded in the URI (if cookies have been disabled).- Returns:
- The jroute id of this request, or null if this request does not carry any jroute id
-
generateSessionId
String generateSessionId()
Generate and return a new session ID. This hook allows connectors to provide their own scalable session ID generators.
-
disableAsyncSupport
void disableAsyncSupport()
Disables async support on this request.
-
setRequestedSessionCookiePath
void setRequestedSessionCookiePath(String cookiePath)
Sets the requested session cookie path, see IT 7426
-
getSessionInternal
Session getSessionInternal(boolean create)
Gets the session associated with this Request, creating one if necessary and requested.- Parameters:
create- true if a new session is to be created if one does not already exist, false otherwise
-
changeSessionId
String changeSessionId()
Change the ID of the session that this request is associated with. There are several things that may trigger an ID change. These include moving between nodes in a cluster and session fixation prevention during the authentication process.
-
lockSession
Session lockSession()
-
unlockSession
void unlockSession()
-
-