Top Description Inners Fields Constructors Methods
org.apache.catalina.connector

public Class RequestFacade

extends Object
implements HttpServletRequest
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletRequest
Imports
java.io.BufferedReader, .IOException, java.security.AccessController, .PrivilegedAction, java.util.Collection, .Enumeration, .Locale, .Map, jakarta.servlet.AsyncContext, .DispatcherType, .RequestDispatcher, .ServletConnection, .ServletContext, .ServletException, .ServletInputStream, .ServletRequest, .ServletResponse, jakarta.servlet.http.Cookie, .HttpServletMapping, .HttpServletRequest, .HttpServletResponse, .HttpSession, .HttpUpgradeHandler, .Part, .PushBuilder, org.apache.catalina.Globals, org.apache.catalina.security.SecurityUtil, org.apache.tomcat.util.res.StringManager

Facade class that wraps a Coyote request object. All methods are delegated to the wrapped request.
Authors
Craig R. McClanahan, Remy Maucherat

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class

Field Summary

Modifier and TypeField and Description
protected Request
request

The wrapped request.

private static final StringManager

Constructor Summary

AccessConstructor and Description
public
RequestFacade(Request
The request to be wrapped
request
)

Construct a wrapper for the specified request.

Method Summary

Modifier and TypeMethod and Description
public boolean
authenticate(HttpServletResponse
The response to use to return any authentication challenge
response
)

Implements jakarta.servlet.http.HttpServletRequest.authenticate.

Triggers the same authentication process as would be triggered if the request is for a resource that is protected by a security constraint.

public String
changeSessionId()

Implements jakarta.servlet.http.HttpServletRequest.changeSessionId.

Changes the session ID of the session associated with this request.

private void
public void
clear()

Clear facade.

protected Object
clone()

Overrides java.lang.Object.clone.

Prevent cloning the facade.

public boolean
public AsyncContext
getAsyncContext()

Implements jakarta.servlet.ServletRequest.getAsyncContext.

Get the current AsyncContext.

public Object
getAttribute(String
a String specifying the name of the attribute
name
)

Implements jakarta.servlet.ServletRequest.getAttribute.

Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

public Enumeration<String>
getAttributeNames()

Implements jakarta.servlet.ServletRequest.getAttributeNames.

Returns an Enumeration containing the names of the attributes available to this request.

public String
getAuthType()

Implements jakarta.servlet.http.HttpServletRequest.getAuthType.

Returns the name of the authentication scheme used to protect the servlet.

public String
getCharacterEncoding()

Implements jakarta.servlet.ServletRequest.getCharacterEncoding.

Returns the name of the character encoding used in the body of this request.

public int
getContentLength()

Implements jakarta.servlet.ServletRequest.getContentLength.

Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.

public long
getContentLengthLong()

Implements jakarta.servlet.ServletRequest.getContentLengthLong.

Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.

public String
getContentType()

Implements jakarta.servlet.ServletRequest.getContentType.

Returns the MIME type of the body of the request, or null if the type is not known.

public String
getContextPath()

Implements jakarta.servlet.http.HttpServletRequest.getContextPath.

Returns the portion of the request URI that indicates the context of the request.

public Cookie[]
getCookies()

Implements jakarta.servlet.http.HttpServletRequest.getCookies.

Returns an array containing all of the Cookie objects the client sent with this request.

public long
getDateHeader(String
a String specifying the name of the header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getDateHeader.

Returns the value of the specified request header as a long value that represents a Date object.

public DispatcherType
public String
getHeader(String
a String specifying the header name
name
)

Implements jakarta.servlet.http.HttpServletRequest.getHeader.

Returns the value of the specified request header as a String.

public Enumeration<String>
getHeaderNames()

Implements jakarta.servlet.http.HttpServletRequest.getHeaderNames.

Returns an enumeration of all the header names this request contains.

public Enumeration<String>
getHeaders(String
a String specifying the header name
name
)

Implements jakarta.servlet.http.HttpServletRequest.getHeaders.

Returns all the values of the specified request header as an Enumeration of String objects.

public HttpServletMapping
getHttpServletMapping()

Overrides default jakarta.servlet.http.HttpServletRequest.getHttpServletMapping.

Obtain the mapping information for this request.

public ServletInputStream
getInputStream()

Implements jakarta.servlet.ServletRequest.getInputStream.

Retrieves the body of the request as binary data using a ServletInputStream.

public int
getIntHeader(String
a String specifying the name of a request header
name
)

Implements jakarta.servlet.http.HttpServletRequest.getIntHeader.

Returns the value of the specified request header as an int.

public String
getLocalAddr()

Implements jakarta.servlet.ServletRequest.getLocalAddr.

Returns the Internet Protocol (IP) address of the interface on which the request was received.

public Locale
getLocale()

Implements jakarta.servlet.ServletRequest.getLocale.

Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.

public Enumeration<Locale>
getLocales()

Implements jakarta.servlet.ServletRequest.getLocales.

Returns an Enumeration of Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.

public String
getLocalName()

Implements jakarta.servlet.ServletRequest.getLocalName.

Returns the host name of the Internet Protocol (IP) interface on which the request was received.

public int
getLocalPort()

Implements jakarta.servlet.ServletRequest.getLocalPort.

Returns the Internet Protocol (IP) port number of the interface on which the request was received.

public String
getMethod()

Implements jakarta.servlet.http.HttpServletRequest.getMethod.

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

public String
getParameter(String
a String specifying the name of the parameter
name
)

Implements jakarta.servlet.ServletRequest.getParameter.

Returns the value of a request parameter as a String, or null if the parameter does not exist.

public Map<String, String[]>
getParameterMap()

Implements jakarta.servlet.ServletRequest.getParameterMap.

Returns a java.util.Map of the parameters of this request.

public Enumeration<String>
getParameterNames()

Implements jakarta.servlet.ServletRequest.getParameterNames.

Returns an Enumeration of String objects containing the names of the parameters contained in this request.

public String[]
getParameterValues(String
a String containing the name of the parameter whose value is requested
name
)

Implements jakarta.servlet.ServletRequest.getParameterValues.

Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

public Part
getPart(String
The name of the Part to obtain
name
)

Implements jakarta.servlet.http.HttpServletRequest.getPart.

Gets the named Part or null if the Part does not exist.

public Collection<Part>
getParts()

Implements jakarta.servlet.http.HttpServletRequest.getParts.

Return a collection of all uploaded Parts.

public String
getPathInfo()

Implements jakarta.servlet.http.HttpServletRequest.getPathInfo.

Returns any extra path information associated with the URL the client sent when it made this request.

public String
getPathTranslated()

Implements jakarta.servlet.http.HttpServletRequest.getPathTranslated.

Returns any extra path information after the servlet name but before the query string, and translates it to a real path.

public String
getProtocol()

Implements jakarta.servlet.ServletRequest.getProtocol.

Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.

public String
getProtocolRequestId()

Implements jakarta.servlet.ServletRequest.getProtocolRequestId.

Obtain the request identifier for this request as defined by the protocol in use.

public String
getQueryString()

Implements jakarta.servlet.http.HttpServletRequest.getQueryString.

Returns the query string that is contained in the request URL after the path.

public BufferedReader
getReader()

Implements jakarta.servlet.ServletRequest.getReader.

Retrieves the body of the request as character data using a BufferedReader.

public String
getRemoteAddr()

Implements jakarta.servlet.ServletRequest.getRemoteAddr.

Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.

public String
getRemoteHost()

Implements jakarta.servlet.ServletRequest.getRemoteHost.

Returns the fully qualified name of the client or the last proxy that sent the request.

public int
getRemotePort()

Implements jakarta.servlet.ServletRequest.getRemotePort.

Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

public String
getRemoteUser()

Implements jakarta.servlet.http.HttpServletRequest.getRemoteUser.

Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.

public RequestDispatcher
getRequestDispatcher(String
a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.
path
)

Implements jakarta.servlet.ServletRequest.getRequestDispatcher.

Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.

public String
getRequestedSessionId()

Implements jakarta.servlet.http.HttpServletRequest.getRequestedSessionId.

Returns the session ID specified by the client.

public String
getRequestId()

Implements jakarta.servlet.ServletRequest.getRequestId.

Obtain a unique (within the lifetime of the Servlet container) identifier string for this request.

public String
getRequestURI()

Implements jakarta.servlet.http.HttpServletRequest.getRequestURI.

Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.

public StringBuffer
getRequestURL()

Implements jakarta.servlet.http.HttpServletRequest.getRequestURL.

Reconstructs the URL the client used to make the request.

public String
getScheme()

Implements jakarta.servlet.ServletRequest.getScheme.

Returns the name of the scheme used to make this request, for example, http, https, or ftp.

public String
getServerName()

Implements jakarta.servlet.ServletRequest.getServerName.

Returns the host name of the server to which the request was sent.

public int
getServerPort()

Implements jakarta.servlet.ServletRequest.getServerPort.

Returns the port number to which the request was sent.

public ServletConnection
getServletConnection()

Implements jakarta.servlet.ServletRequest.getServletConnection.

Obtain details of the network connection to the Servlet container that is being used by this request.

public ServletContext
public String
getServletPath()

Implements jakarta.servlet.http.HttpServletRequest.getServletPath.

Returns the part of this request's URL that calls the servlet.

public HttpSession
getSession(boolean
true to create a new session for this request if necessary; false to return null if there's no current session
create
)

Implements jakarta.servlet.http.HttpServletRequest.getSession.

Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.

public HttpSession
getSession()

Implements jakarta.servlet.http.HttpServletRequest.getSession.

Returns the current session associated with this request, or if the request does not have a session, creates one.

public Map<String, String>
getTrailerFields()

Overrides default jakarta.servlet.http.HttpServletRequest.getTrailerFields.

Obtain a Map of the trailer fields that is not backed by the request object.

public Principal
getUserPrincipal()

Implements jakarta.servlet.http.HttpServletRequest.getUserPrincipal.

Returns a java.security.Principal object containing the name of the current authenticated user.

public boolean
public boolean
public boolean
isRequestedSessionIdFromCookie()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromCookie.

Checks whether the requested session ID came in as a cookie.

public boolean
isRequestedSessionIdFromURL()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdFromURL.

Checks whether the requested session ID came in as part of the request URL.

public boolean
isRequestedSessionIdValid()

Implements jakarta.servlet.http.HttpServletRequest.isRequestedSessionIdValid.

Checks whether the requested session ID is still valid.

public boolean
isSecure()

Implements jakarta.servlet.ServletRequest.isSecure.

Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

public boolean
isTrailerFieldsReady()

Overrides default jakarta.servlet.http.HttpServletRequest.isTrailerFieldsReady.

Are trailer fields ready to be read (there may still be no trailers to read).

public boolean
isUserInRole(String
a String specifying the name of the role
role
)

Implements jakarta.servlet.http.HttpServletRequest.isUserInRole.

Returns a boolean indicating whether the authenticated user is included in the specified logical "role".

public void
login(String
The user name to authenticate
username
,
String
The password to use to authenticate the user
password
)

Implements jakarta.servlet.http.HttpServletRequest.login.

Authenticate the provided user name and password and then associated the authenticated user with the request.

public void
logout()

Implements jakarta.servlet.http.HttpServletRequest.logout.

Removes any authenticated user from the request.

public PushBuilder
newPushBuilder()

Overrides default jakarta.servlet.http.HttpServletRequest.newPushBuilder.

Obtain a builder for generating push requests.

public PushBuilder
public void
removeAttribute(String
a String specifying the name of the attribute to remove
name
)

Implements jakarta.servlet.ServletRequest.removeAttribute.

Removes an attribute from this request.

public void
setAttribute(String
a String specifying the name of the attribute
name
,
Object
the Object to be stored
o
)

Implements jakarta.servlet.ServletRequest.setAttribute.

Stores an attribute in this request.

public void
setCharacterEncoding(String
a String containing the name of the character encoding
env
)

Implements jakarta.servlet.ServletRequest.setCharacterEncoding.

Overrides the name of the character encoding used in the body of this request.

public AsyncContext
public AsyncContext
startAsync(ServletRequest
The ServletRequest with which to initialise the asynchronous context
request
,
ServletResponse
The ServletResponse with which to initialise the asynchronous context
response
)

Implements jakarta.servlet.ServletRequest.startAsync.

public <T extends HttpUpgradeHandler> T
upgrade(Class<T>
The class that implements the upgrade handler
httpUpgradeHandlerClass
)

Implements jakarta.servlet.http.HttpServletRequest.upgrade.

Start the HTTP upgrade process and create and instance of the provided protocol handler class.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait