public class Request extends Object implements HttpRequest, javax.servlet.http.HttpServletRequest
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
attributes
The attributes associated with this Request, keyed by attribute name.
|
protected String |
authType
Authentication type.
|
protected static int |
CACHED_POST_LEN
Post data buffer.
|
protected boolean |
checkRestrictedResources
Whether or not access to resources in WEB-INF or META-INF needs to be
checked.
|
protected boolean |
checkUnsuccessfulSessionFind |
protected Connector |
connector
Associated Catalina connector.
|
protected Context |
context
Associated context.
|
protected ArrayList<javax.servlet.http.Cookie> |
cookies
The set of cookies associated with this Request.
|
protected boolean |
cookiesParsed
Cookies parsed flag.
|
protected org.glassfish.grizzly.http.server.Request |
coyoteRequest
Coyote request.
|
protected RequestFacade |
defaultContextMaskingFacade
Request facade that masks the fact that a request received
at the root context was mapped to a default-web-module (if such a
mapping exists).
|
protected static Locale |
defaultLocale
The default Locale if none are specified.
|
static boolean |
discardDisconnectEvent |
protected Object |
dispatcherTypeAttr
The current dispatcher type.
|
protected RequestFacade |
facade
The facade associated with this request.
|
protected javax.servlet.FilterChain |
filterChain
Filter chain associated with the request.
|
protected SimpleDateFormat[] |
formats |
protected GlassFishValve |
hostValve |
protected static String |
info
Descriptive information about this Request implementation.
|
protected InputBuffer |
inputBuffer
The associated input buffer.
|
protected CoyoteInputStream |
inputStream
ServletInputStream.
|
protected String |
localAddr
Local address
|
protected ArrayList<Locale> |
locales
The preferred Locales associated with this Request.
|
protected boolean |
localesParsed
Parse locales.
|
protected String |
localName
Local address
|
protected int |
localPort
Local port
|
protected org.glassfish.grizzly.http.server.util.MappingData |
mappingData
Mapping data.
|
protected ParameterMap<String,String[]> |
parameterMap
Hash map used in the getParametersMap method.
|
protected boolean |
parametersProcessed |
protected byte[] |
postData |
protected CoyoteReader |
reader
Reader.
|
protected String |
remoteAddr
Remote address.
|
protected String |
remoteHost
Remote host.
|
protected int |
remotePort
Remote port
|
protected Object |
requestDispatcherPath
The current request dispatcher path.
|
protected boolean |
requestedSessionCookie
Was the requested session ID received in a cookie?
|
protected String |
requestedSessionCookiePath |
protected String |
requestedSessionId
The requested session ID (if any) for this request.
|
protected boolean |
requestedSessionURL
Was the requested session ID received in a URL?
|
protected String |
requestedSessionVersion
The requested session version (if any) for this request.
|
protected Response |
response
The response with which this request is associated.
|
protected boolean |
secure
Secure flag.
|
protected javax.servlet.ServletContext |
servletContext |
protected Session |
session
The currently active session for this request.
|
protected boolean |
sessionParsed
Session parsed flag.
|
protected Socket |
socket
The socket through which this Request was received.
|
protected Subject |
subject
The Subject associated with the current AccessControllerContext
|
protected org.glassfish.grizzly.http.util.B2CConverter |
URIConverter
URI byte to char converter (not recycled).
|
protected org.glassfish.grizzly.http.util.CharChunk |
uriParamsCC |
protected Principal |
userPrincipal
User principal.
|
protected boolean |
usingInputStream
Using stream flag.
|
protected boolean |
usingReader
Using writer flag.
|
protected Wrapper |
wrapper
Associated wrapper.
|
| Constructor and Description |
|---|
Request() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(javax.servlet.http.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,
String[] values)
Add a parameter name and corresponding set of values to this Request.
|
boolean |
authenticate(javax.servlet.http.HttpServletResponse response) |
String |
changeSessionId()
Change the session id of the current session associated with this
request and return the new session id.
|
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
and reset the query string encoding charset.
|
protected void |
configureSessionCookie(javax.servlet.http.Cookie cookie)
Configures the given JSESSIONID cookie.
|
protected void |
convertURI(org.glassfish.grizzly.http.util.MessageBytes uri)
Character conversion of the URI.
|
javax.servlet.ServletInputStream |
createInputStream()
Create and return a ServletInputStream to read the content
associated with this Request.
|
int |
decrementDispatchDepth()
Decrement the depth of application dispatch
|
void |
disableAsyncSupport()
Disables async support for this request.
|
protected Session |
doGetSession(boolean create) |
void |
finishRequest()
Perform whatever actions are required to flush and close the input
stream or reader, in a single operation.
|
String |
generateSessionId()
This object does not implement a session ID generator.
|
javax.servlet.AsyncContext |
getAsyncContext()
Gets the AsyncContext of this request.
|
Object |
getAttribute(String name)
Return the specified request attribute if it exists; otherwise, return
null. |
Enumeration<String> |
getAttributeNames()
Return the names of all request attributes for this Request, or an
empty
Enumeration if there are none. |
String |
getAuthorization()
Return the authorization credentials sent with this request.
|
String |
getAuthType()
Return the authentication type used for this Request.
|
String |
getCharacterEncoding()
Return the character encoding for this Request.
|
boolean |
getCheckRestrictedResources()
Return whether or not access to resources under WEB-INF or META-INF
needs to be checked.
|
Connector |
getConnector()
Return the Connector through which this Request was received.
|
int |
getContentLength()
Return the content length for this Request.
|
long |
getContentLengthLong()
Return the content length for this Request.
|
String |
getContentType()
Return the content type for this Request.
|
Context |
getContext()
Return the Context within which this Request is being processed.
|
String |
getContextPath()
Return the portion of the request URI used to select the Context
of the Request.
|
String |
getContextPath(boolean maskDefaultContextMapping)
Gets the portion of the request URI used to select the Context
of the Request.
|
javax.servlet.http.Cookie[] |
getCookies()
Return the set of Cookies received with this Request.
|
org.glassfish.grizzly.http.server.Request |
getCoyoteRequest()
Get the Coyote request.
|
long |
getDateHeader(String name)
Return the value of the specified date header, if any; otherwise
return -1.
|
String |
getDecodedRequestURI()
Get the decoded request URI.
|
String |
getDecodedRequestURI(boolean maskDefaultContextMapping)
Gets the decoded request URI.
|
javax.servlet.DispatcherType |
getDispatcherType() |
javax.servlet.FilterChain |
getFilterChain()
Get filter chain associated with the request.
|
String |
getHeader(String name)
Return the first value of the specified header, if any; otherwise,
return
null |
Enumeration<String> |
getHeaderNames()
Return the names of all headers received with this request.
|
Enumeration<String> |
getHeaders(String name)
Return all of the values of the specified header, if any; otherwise,
return an empty enumeration.
|
Host |
getHost()
Return the Host within which this Request is being processed.
|
javax.servlet.http.HttpServletMapping |
getHttpServletMapping() |
javax.servlet.http.HttpUpgradeHandler |
getHttpUpgradeHandler() |
String |
getInfo()
Return descriptive information about this Request implementation and
the corresponding version number, in the format
<description>/<version>. |
javax.servlet.ServletInputStream |
getInputStream()
Return the servlet input stream for this Request.
|
int |
getIntHeader(String headerName)
Return the value of the specified header as an integer, or -1 if there
is no such header for this request.
|
String |
getJrouteId()
Gets the jroute id of this request, which may have been
sent as a separate
JROUTE cookie or appended to the
session identifier encoded in the URI (if cookies have been disabled). |
String |
getLocalAddr()
Returns the Internet Protocol (IP) address of the interface on
which the request was received.
|
Locale |
getLocale()
Return the preferred Locale that the client will accept content in,
based on the value for the first
Accept-Language header
that was encountered. |
Enumeration<Locale> |
getLocales()
Return the set of preferred Locales that the client will accept
content in, based on the values for any
Accept-Language
headers that were encountered. |
String |
getLocalName()
Returns the host name of the Internet Protocol (IP) interface on
which the request was received.
|
int |
getLocalPort()
Returns the Internet Protocol (IP) port number of the interface
on which the request was received.
|
org.glassfish.grizzly.http.server.util.MappingData |
getMappingData()
Return mapping data.
|
static int |
getMaxDispatchDepth() |
String |
getMethod()
Return the HTTP request method used in this Request.
|
Object |
getNote(String name)
Return the object bound with the specified name to the internal notes
for this request, or
null if no such binding exists. |
Iterator<String> |
getNoteNames()
Return an Iterator containing the String names of all notes bindings
that exist for this request.
|
String |
getParameter(String name)
Return the value of the specified request parameter, if any; otherwise,
return
null. |
Map<String,String[]> |
getParameterMap()
Returns a
Map of the parameters of this request. |
Enumeration<String> |
getParameterNames()
Return the names of all defined request parameters for this request.
|
String[] |
getParameterValues(String name)
Return the defined values for the specified request parameter, if any;
otherwise, return
null. |
javax.servlet.http.Part |
getPart(String name) |
Collection<javax.servlet.http.Part> |
getParts() |
String |
getPathInfo()
Return the path information associated with this Request.
|
String |
getPathTranslated()
Return the extra path information for this request, translated
to a real path.
|
protected byte[] |
getPostBody()
Gets the POST body of this request.
|
String |
getProtocol()
Return the protocol and version used to make this Request.
|
String |
getQueryString()
Return the query string associated with this request.
|
BufferedReader |
getReader()
Read the Reader wrapping the input stream for this Request.
|
String |
getRealPath(String path)
Deprecated.
As of version 2.1 of the Java Servlet API, use
ServletContext.getRealPath(). |
String |
getRemoteAddr()
Return the remote IP address making this Request.
|
String |
getRemoteHost()
Return the remote host name making this Request.
|
int |
getRemotePort()
Returns the Internet Protocol (IP) source port of the client
or last proxy that sent the request.
|
String |
getRemoteUser()
Return the name of the remote user that has been authenticated
for this Request.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the
ServletRequest for which this object
is the facade. |
javax.servlet.http.HttpServletRequest |
getRequest(boolean maskDefaultContextMapping)
Gets the
ServletRequest for which this object
is the facade. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path)
Return a RequestDispatcher that wraps the resource at the specified
path, which may be interpreted as relative to the current request path.
|
String |
getRequestedSessionId()
Return the session identifier included in this request, if any.
|
org.glassfish.grizzly.http.util.DataChunk |
getRequestPathMB()
Get the request path.
|
String |
getRequestURI()
Return the request URI for this request.
|
String |
getRequestURI(boolean maskDefaultContextMapping)
Gets the request URI for this request.
|
StringBuffer |
getRequestURL()
Reconstructs the URL the client used to make the request.
|
StringBuffer |
getRequestURL(boolean maskDefaultContextMapping) |
Response |
getResponse()
Return the Response with which this Request is associated.
|
String |
getScheme()
Return the scheme used to make this Request.
|
String |
getServerName()
Return the server name responding to this Request.
|
int |
getServerPort()
Return the server port responding to this Request.
|
javax.servlet.ServletContext |
getServletContext()
Gets the servlet context to which this servlet request was last
dispatched.
|
String |
getServletPath()
Return the portion of the request URI used to select the servlet
that will process this request.
|
javax.servlet.http.HttpSession |
getSession()
Return the session associated with this Request, creating one
if necessary.
|
javax.servlet.http.HttpSession |
getSession(boolean create)
Return the session associated with this Request, creating one
if necessary and requested.
|
Session |
getSessionInternal()
Return the session associated with this Request, creating one
if necessary.
|
Session |
getSessionInternal(boolean create)
Gets the session associated with this Request, creating one
if necessary and requested.
|
Socket |
getSocket()
Return the Socket (if any) through which this Request was received.
|
InputStream |
getStream()
Return the input stream associated with this Request.
|
Map<String,String> |
getTrailerFields() |
boolean |
getUnsuccessfulSessionFind()
Get the unsuccessfulSessionFind flag.
|
protected org.glassfish.grizzly.http.util.B2CConverter |
getURIConverter()
Return the URI converter.
|
Principal |
getUserPrincipal()
Return the principal that has been authenticated for this Request.
|
javax.servlet.http.WebConnection |
getWebConnection() |
Wrapper |
getWrapper()
Return the Wrapper within which this Request is being processed.
|
int |
incrementDispatchDepth()
Increment the depth of application dispatch
|
void |
initialiseHttpUpgradeHandler(javax.servlet.http.WebConnection wc) |
protected static boolean |
isAlpha(String value) |
boolean |
isAsyncStarted()
Checks whether async processing has started on this request.
|
boolean |
isAsyncSupported()
Checks whether this request supports async.
|
boolean |
isMaxDispatchDepthReached()
Check if the application dispatching has reached the maximum
|
boolean |
isRequestedSessionIdFromCookie()
Return
true if the session identifier included in this
request came from a cookie. |
boolean |
isRequestedSessionIdFromSecureCookie() |
boolean |
isRequestedSessionIdFromUrl()
Deprecated.
As of Version 2.1 of the Java Servlet API, use
isRequestedSessionIdFromURL() instead. |
boolean |
isRequestedSessionIdFromURL()
Return
true if the session identifier included in this
request came from the request URI. |
boolean |
isRequestedSessionIdValid()
Return
true if the session identifier included in this
request identifies a valid session. |
boolean |
isSecure()
Was this request received on a secure connection?
|
boolean |
isTrailerFieldsReady() |
boolean |
isUpgrade() |
boolean |
isUserInRole(String role)
Return
true if the authenticated user principal
possesses the specified role name. |
Session |
lockSession()
lock the session associated with this request
this will be a foreground lock
checks for background lock to clear
and does a decay poll loop to wait until
it is clear; after 5 times it takes control for
the foreground
|
void |
login(String username,
char[] password) |
void |
login(String username,
String password) |
void |
logout() |
protected javax.servlet.http.Cookie |
makeCookie(org.glassfish.grizzly.http.Cookie scookie) |
protected javax.servlet.http.Cookie |
makeCookie(org.glassfish.grizzly.http.Cookie scookie,
boolean decode) |
javax.servlet.http.PushBuilder |
newPushBuilder() |
protected void |
obtainSessionId()
Take the session id from Grizzly Request
|
protected void |
parseCookies()
Parse cookies.
|
protected void |
parseJReplica(org.glassfish.grizzly.http.util.CharChunk uriCC)
Parses and removes jreplica (if present) from the request URI.
|
protected void |
parseSessionCookiesId()
Parse session id in URL.
|
protected void |
parseSessionId(String sessionParameterName,
org.glassfish.grizzly.http.util.CharChunk uriBB)
Parse session id in URL.
|
protected void |
parseSessionVersion(org.glassfish.grizzly.http.util.CharChunk uriCC)
Parses and removes any session version (if present) from the request
URI.
|
protected int |
readPostBody(byte[] body,
int len)
Read post body in an array.
|
void |
recycle()
Release all object references, and initialize instance variables, in
preparation for reuse of this object.
|
void |
removeAttribute(String name)
Remove the specified request attribute if it exists.
|
void |
removeNote(String name)
Remove any object bound to the specified name in the internal notes
for this request.
|
void |
replayPayload(byte[] payloadByteArray) |
void |
setAttribute(String name,
Object value)
Set the specified request attribute to the specified value.
|
void |
setAuthType(String type)
Set the authentication type used for this request, if any; otherwise
set the type to
null. |
void |
setCharacterEncoding(String enc)
Overrides the name of the character encoding used in the body of this
request.
|
void |
setCheckRestrictedResources(boolean check)
Set whether or not access to resources under WEB-INF or META-INF
needs to be checked.
|
void |
setConnector(Connector connector)
Set the Connector through which this Request was received.
|
void |
setContentLength(int length)
Set the content length associated with this Request.
|
void |
setContentType(String type)
Set the content type (and optionally the character encoding)
associated with this Request.
|
void |
setContext(Context context)
Set the Context within which this Request is being processed.
|
void |
setCookies(javax.servlet.http.Cookie[] cookies)
Set the set of cookies received with this Request.
|
void |
setCoyoteRequest(org.glassfish.grizzly.http.server.Request grizzlyRequest)
Set the Coyote request.
|
void |
setDefaultContext(boolean isDefaultContext) |
static void |
setEnforceScope(boolean enforce)
Set whether or not to enforce scope checking of this object.
|
void |
setFilterChain(javax.servlet.FilterChain filterChain)
Set filter chain associated with the request.
|
void |
setHost(Host host)
Set the Host within which this Request is being processed.
|
void |
setMappingData(org.glassfish.grizzly.http.server.util.MappingData mappingData)
Set the mapping data for this Request.
|
static void |
setMaxDispatchDepth(int depth)
Static setter method for the maximum dispatch depth
|
void |
setMethod(String method)
Set the HTTP request method used for this Request.
|
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.
|
void |
setPathInfo(String pathInfo)
Set the path information for this Request.
|
void |
setProtocol(String protocol)
Set the protocol name and version associated with this Request.
|
void |
setQueryString(String query)
Sets the query string for this Request.
|
void |
setRemoteAddr(String remoteAddr)
Set the IP address of the remote client associated with this Request.
|
void |
setRemoteHost(String remoteHost)
Set the fully qualified name of the remote client associated with 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 |
setRequestedSessionCookiePath(String cookiePath)
Sets the requested session cookie path, see IT 7426
|
void |
setRequestedSessionId(String id)
Set the requested session ID for this request.
|
void |
setRequestedSessionIdFromSecureCookie(boolean secure)
Marks (or unmarks) this request as having a JSESSIONID cookie
that is marked as secure
|
void |
setRequestedSessionURL(boolean flag)
Set a flag indicating whether or not the requested session ID for this
request came in through a URL.
|
void |
setRequestURI(String uri)
Set the unparsed request URI for this Request.
|
void |
setResponse(Response response)
Set the Response with which this Request is associated.
|
void |
setSecure(boolean secure)
Set the value to be returned by
isSecure()
for this Request. |
void |
setServerName(String name)
Set the name of the server (virtual host) to process this request.
|
void |
setServerPort(int port)
Set the port number of the server to process this request.
|
void |
setServletPath(String servletPath)
Sets the servlet path for this Request.
|
void |
setSession(Session newSess)
set the session - this method is not for general use
|
void |
setSocket(Socket socket)
Set the Socket (if any) through which this Request was received.
|
void |
setStream(InputStream stream)
Set the input stream associated with this Request.
|
void |
setUnsuccessfulSessionFind(boolean unsuccessfulSessionFind)
Set the unsuccessfulSessionFind flag.
|
void |
setUpgrade(boolean upgrade) |
protected void |
setURIConverter(org.glassfish.grizzly.http.util.B2CConverter URIConverter)
Set the URI converter.
|
void |
setUserPrincipal(Principal principal)
Set the Principal who has been authenticated for this Request.
|
void |
setWebConnection(javax.servlet.http.WebConnection wc) |
void |
setWrapper(Wrapper wrapper)
Set the Wrapper within which this Request is being processed.
|
javax.servlet.AsyncContext |
startAsync()
Starts async processing on this request.
|
javax.servlet.AsyncContext |
startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
Starts async processing on this request.
|
void |
unlockSession()
unlock the session associated with this request
|
void |
updatePaths(org.glassfish.grizzly.http.server.util.MappingData md)
Update this instance with the content of the
MappingData
MappingData |
<T extends javax.servlet.http.HttpUpgradeHandler> |
upgrade(Class<T> handlerClass)
Create an instance of
HttpUpgradeHandler for an given
class and uses it for the http protocol upgrade processing. |
protected static final String info
protected SimpleDateFormat[] formats
protected ArrayList<javax.servlet.http.Cookie> cookies
protected static final Locale defaultLocale
protected Map<String,Object> attributes
protected String authType
protected Object dispatcherTypeAttr
protected InputBuffer inputBuffer
protected CoyoteInputStream inputStream
protected CoyoteReader reader
protected boolean usingInputStream
protected boolean usingReader
protected Principal userPrincipal
protected boolean sessionParsed
protected boolean parametersProcessed
protected boolean cookiesParsed
protected boolean secure
protected Subject subject
protected static final int CACHED_POST_LEN
protected byte[] postData
protected ParameterMap<String,String[]> parameterMap
protected Session session
protected Object requestDispatcherPath
protected boolean requestedSessionCookie
protected String requestedSessionId
protected String requestedSessionVersion
protected String requestedSessionCookiePath
protected org.glassfish.grizzly.http.util.CharChunk uriParamsCC
protected boolean requestedSessionURL
protected Socket socket
protected boolean localesParsed
protected int localPort
protected String remoteAddr
protected String remoteHost
protected int remotePort
protected String localName
protected String localAddr
protected boolean checkRestrictedResources
protected boolean checkUnsuccessfulSessionFind
protected org.glassfish.grizzly.http.server.Request coyoteRequest
protected RequestFacade facade
protected RequestFacade defaultContextMaskingFacade
protected Response response
protected Connector connector
protected org.glassfish.grizzly.http.server.util.MappingData mappingData
protected Wrapper wrapper
protected javax.servlet.FilterChain filterChain
protected Context context
protected javax.servlet.ServletContext servletContext
protected GlassFishValve hostValve
public static final boolean discardDisconnectEvent
protected org.glassfish.grizzly.http.util.B2CConverter URIConverter
public void setCoyoteRequest(org.glassfish.grizzly.http.server.Request grizzlyRequest)
grizzlyRequest - The Coyote requestpublic org.glassfish.grizzly.http.server.Request getCoyoteRequest()
public static void setEnforceScope(boolean enforce)
public void recycle()
public void setUnsuccessfulSessionFind(boolean unsuccessfulSessionFind)
unsuccessfulSessionFind - public boolean getUnsuccessfulSessionFind()
public void setUpgrade(boolean upgrade)
public boolean isUpgrade()
public javax.servlet.http.HttpUpgradeHandler getHttpUpgradeHandler()
public String getAuthorization()
getAuthorization in interface Requestpublic Connector getConnector()
getConnector in interface Requestpublic void setConnector(Connector connector)
setConnector in interface Requestconnector - The new connectorpublic Context getContext()
getContext in interface Requestpublic void setContext(Context context)
getContextPath(),
and thus enables parsing of the request URI.setContext in interface Requestcontext - The newly associated Contextpublic void setDefaultContext(boolean isDefaultContext)
isDefaultContext - true if this request was mapped to a context
with an empty context root that is backed by the vitual server's
default-web-modulepublic javax.servlet.FilterChain getFilterChain()
getFilterChain in interface Requestpublic void setFilterChain(javax.servlet.FilterChain filterChain)
setFilterChain in interface RequestfilterChain - new filter chainpublic Host getHost()
public void setHost(Host host)
public javax.servlet.http.HttpServletMapping getHttpServletMapping()
getHttpServletMapping in interface javax.servlet.http.HttpServletRequestpublic String getInfo()
<description>/<version>.public org.glassfish.grizzly.http.server.util.MappingData getMappingData()
public void setMappingData(org.glassfish.grizzly.http.server.util.MappingData mappingData)
public void updatePaths(org.glassfish.grizzly.http.server.util.MappingData md)
MappingData
MappingDatapublic javax.servlet.http.HttpServletRequest getRequest()
ServletRequest for which this object
is the facade. This method must be implemented by a subclass.getRequest in interface Requestpublic javax.servlet.http.HttpServletRequest getRequest(boolean maskDefaultContextMapping)
ServletRequest for which this object
is the facade. This method must be implemented by a subclass.getRequest in interface RequestmaskDefaultContextMapping - true if the fact that a request
received at the root context was mapped to a default-web-module will
be masked, false otherwisepublic Response getResponse()
getResponse in interface Requestpublic void setResponse(Response response)
setResponse in interface Requestresponse - The new associated responsepublic Socket getSocket()
public void setSocket(Socket socket)
public InputStream getStream()
public void setStream(InputStream stream)
protected org.glassfish.grizzly.http.util.B2CConverter getURIConverter()
protected void setURIConverter(org.glassfish.grizzly.http.util.B2CConverter URIConverter)
URIConverter - the new URI converterpublic Wrapper getWrapper()
getWrapper in interface Requestpublic void setWrapper(Wrapper wrapper)
setWrapper in interface Requestwrapper - The newly associated Wrapperpublic javax.servlet.ServletInputStream createInputStream()
throws IOException
createInputStream in interface RequestIOException - if an input/output error occurspublic void finishRequest()
throws IOException
finishRequest in interface RequestIOException - if an input/output error occurspublic Object getNote(String name)
null if no such binding exists.public Iterator<String> getNoteNames()
getNoteNames in interface Requestpublic void removeNote(String name)
removeNote in interface Requestname - Name of the note to be removedpublic void setNote(String name, Object value)
public void setContentLength(int length)
setContentLength in interface Requestlength - The new content lengthpublic void setContentType(String type)
text/html; charset=ISO-8859-4.setContentType in interface Requesttype - The new content typepublic void setProtocol(String protocol)
setProtocol in interface Requestprotocol - Protocol name and versionpublic void setRemoteAddr(String remoteAddr)
setRemoteAddr in interface RequestremoteAddr - The remote IP addresspublic void setRemoteHost(String remoteHost)
remoteHost - The remote host namepublic void setSecure(boolean secure)
isSecure()
for this Request.public void setServerName(String name)
setServerName in interface Requestname - The server namepublic void setServerPort(int port)
setServerPort in interface Requestport - The server portpublic void setCheckRestrictedResources(boolean check)
setCheckRestrictedResources in interface Requestpublic boolean getCheckRestrictedResources()
getCheckRestrictedResources in interface Requestpublic Object getAttribute(String name)
null.getAttribute in interface javax.servlet.ServletRequestname - Name of the request attribute to returnpublic Enumeration<String> getAttributeNames()
Enumeration if there are none.getAttributeNames in interface javax.servlet.ServletRequestpublic String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestpublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic long getContentLengthLong()
getContentLengthLong in interface javax.servlet.ServletRequestpublic String getContentType()
getContentType in interface javax.servlet.ServletRequestpublic javax.servlet.ServletInputStream getInputStream()
throws IOException
createInputStream().getInputStream in interface javax.servlet.ServletRequestIllegalStateException - if getReader() has
already been called for this requestIOException - if an input/output error occurspublic Locale getLocale()
Accept-Language header
that was encountered. If the request did not specify a preferred
language, the server's default Locale is returned.getLocale in interface javax.servlet.ServletRequestpublic Enumeration<Locale> getLocales()
Accept-Language
headers that were encountered. If the request did not specify a
preferred language, the server's default Locale is returned.getLocales in interface javax.servlet.ServletRequestpublic String getParameter(String name)
null. If there is more than one value defined,
return only the first one.getParameter in interface javax.servlet.ServletRequestname - Name of the desired request parameterpublic Map<String,String[]> getParameterMap()
Map of the parameters of this request.
Request parameters are extra information sent with the request.
For HTTP servlets, parameters are contained in the query string
or posted form data.getParameterMap in interface javax.servlet.ServletRequestMap containing parameter names as keys
and parameter values as map values.public Enumeration<String> getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic String[] getParameterValues(String name)
null.getParameterValues in interface javax.servlet.ServletRequestname - Name of the desired request parameterpublic String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic BufferedReader getReader() throws IOException
BufferedReader around the
servlet input stream returned by createInputStream().getReader in interface javax.servlet.ServletRequestIllegalStateException - if getInputStream()
has already been called for this requestIOException - if an input/output error occurspublic String getRealPath(String path)
ServletContext.getRealPath().getRealPath in interface javax.servlet.ServletRequestpath - Path to be translatedpublic String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestpublic int getRemotePort()
getRemotePort in interface javax.servlet.ServletRequestpublic String getLocalName()
getLocalName in interface javax.servlet.ServletRequestpublic String getLocalAddr()
getLocalAddr in interface javax.servlet.ServletRequestpublic int getLocalPort()
getLocalPort in interface javax.servlet.ServletRequestpublic javax.servlet.RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface javax.servlet.ServletRequestpath - Path of the resource to be wrappedpublic String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic int getServerPort()
getServerPort in interface javax.servlet.ServletRequestpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic void removeAttribute(String name)
removeAttribute in interface javax.servlet.ServletRequestname - Name of the request attribute to removepublic void setAttribute(String name, Object value)
setAttribute in interface javax.servlet.ServletRequestname - Name of the request attribute to setvalue - The associated valuepublic void setCharacterEncoding(String enc) throws UnsupportedEncodingException
getReader(). Otherwise, it has no
effect.setCharacterEncoding in interface javax.servlet.ServletRequestenc - String containing the name of
the character encoding.UnsupportedEncodingException - if this
ServletRequest is still in a state where a
character encoding may be set, but the specified
encoding is invalidpublic static void setMaxDispatchDepth(int depth)
public static int getMaxDispatchDepth()
public int incrementDispatchDepth()
public int decrementDispatchDepth()
public boolean isMaxDispatchDepthReached()
public boolean authenticate(javax.servlet.http.HttpServletResponse response)
throws IOException,
javax.servlet.ServletException
authenticate in interface javax.servlet.http.HttpServletRequestIOExceptionjavax.servlet.ServletExceptionpublic void login(String username, String password) throws javax.servlet.ServletException
login in interface javax.servlet.http.HttpServletRequestjavax.servlet.ServletExceptionpublic void login(String username, char[] password) throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic void logout()
throws javax.servlet.ServletException
logout in interface javax.servlet.http.HttpServletRequestjavax.servlet.ServletExceptionpublic void addCookie(javax.servlet.http.Cookie cookie)
addCookie in interface HttpRequestcookie - The new cookiepublic void addHeader(String name, String value)
addHeader in interface HttpRequestname - The new header namevalue - The new header valuepublic void addLocale(Locale locale)
addLocale in interface HttpRequestlocale - The new preferred Localepublic void addParameter(String name, String[] values)
addParameter in interface HttpRequestname - Name of this request parametervalues - Corresponding values for this request parameterpublic void clearCookies()
clearCookies in interface HttpRequestpublic void clearHeaders()
clearHeaders in interface HttpRequestpublic void clearLocales()
clearLocales in interface HttpRequestpublic void clearParameters()
clearParameters in interface HttpRequestpublic void replayPayload(byte[] payloadByteArray)
replayPayload in interface HttpRequestpublic void setAuthType(String type)
null. Typical values are "BASIC",
"DIGEST", or "SSL".setAuthType in interface HttpRequesttype - The authentication type usedpublic void setMethod(String method)
Used by FBL when the original request is restored after successful authentication.
setMethod in interface HttpRequestmethod - The request methodpublic void setQueryString(String query)
Used by FBL when the original request is restored after successful authentication.
setQueryString in interface HttpRequestquery - The query stringpublic void setPathInfo(String pathInfo)
setPathInfo in interface HttpRequestpathInfo - The path informationpublic void setRequestedSessionCookie(boolean flag)
setRequestedSessionCookie in interface HttpRequestflag - The new flagpublic void setRequestedSessionCookiePath(String cookiePath)
setRequestedSessionCookiePath in interface Requestpublic void setRequestedSessionId(String id)
setRequestedSessionId in interface HttpRequestid - The new session idpublic void setRequestedSessionURL(boolean flag)
setRequestedSessionURL in interface HttpRequestflag - The new flagpublic void setRequestURI(String uri)
setRequestURI in interface HttpRequesturi - The request URIpublic String getDecodedRequestURI()
getDecodedRequestURI in interface HttpRequestpublic String getDecodedRequestURI(boolean maskDefaultContextMapping)
maskDefaultContextMapping - true if the fact that a request
received at the root context was mapped to a default-web-module will
be masked, false otherwisepublic void setServletPath(String servletPath)
setServletPath in interface HttpRequestservletPath - The servlet pathpublic void setUserPrincipal(Principal principal)
getRemoteUser() method.setUserPrincipal in interface HttpRequestprincipal - The user Principalpublic String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic String getContextPath(boolean maskDefaultContextMapping)
maskDefaultContextMapping - true if the fact that a request
received at the root context was mapped to a default-web-module will
be masked, false otherwisepublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic void setCookies(javax.servlet.http.Cookie[] cookies)
public long getDateHeader(String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestname - Name of the requested date headerIllegalArgumentException - if the specified header value
cannot be converted to a datepublic String getHeader(String name)
nullgetHeader in interface javax.servlet.http.HttpServletRequestname - Name of the requested headerpublic Enumeration<String> getHeaders(String name)
getHeaders in interface javax.servlet.http.HttpServletRequestname - Name of the requested headerpublic Enumeration<String> getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(String headerName)
getIntHeader in interface javax.servlet.http.HttpServletRequestheaderName - Name of the requested headerIllegalArgumentException - if the specified header value
cannot be converted to an integerpublic Map<String,String> getTrailerFields()
getTrailerFields in interface javax.servlet.http.HttpServletRequestpublic boolean isTrailerFieldsReady()
isTrailerFieldsReady in interface javax.servlet.http.HttpServletRequestpublic String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.PushBuilder newPushBuilder()
newPushBuilder in interface javax.servlet.http.HttpServletRequestpublic String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic org.glassfish.grizzly.http.util.DataChunk getRequestPathMB()
getRequestPathMB in interface HttpRequestpublic String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic String getRequestURI(boolean maskDefaultContextMapping)
maskDefaultContextMapping - true if the fact that a request
received at the root context was mapped to a default-web-module will
be masked, false otherwisepublic StringBuffer getRequestURL()
Because this method returns a StringBuilder,
not a String, you can modify the URL easily,
for example, to append query parameters.
This method is useful for creating redirect messages and for reporting errors.
getRequestURL in interface javax.servlet.http.HttpServletRequestStringBuilder object containing the
reconstructed URLpublic StringBuffer getRequestURL(boolean maskDefaultContextMapping)
public String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestcreate - Create a new session if one does not existpublic void setSession(Session newSess)
newSess - the new sessionpublic boolean isRequestedSessionIdFromCookie()
true if the session identifier included in this
request came from a cookie.isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
true if the session identifier included in this
request came from the request URI.isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromURL() instead.true if the session identifier included in this
request came from the request URI.isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic void setRequestedSessionIdFromSecureCookie(boolean secure)
secure - true if this request has a JSESSIONID cookie that is
marked as secure, false otherwisepublic boolean isRequestedSessionIdFromSecureCookie()
public boolean isRequestedSessionIdValid()
true if the session identifier included in this
request identifies a valid session.isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(String role)
true if the authenticated user principal
possesses the specified role name.isUserInRole in interface javax.servlet.http.HttpServletRequestrole - Role name to be validatedpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic Session getSessionInternal()
public Session getSessionInternal(boolean create)
getSessionInternal in interface Requestcreate - true if a new session is to be created if one does not
already exist, false otherwisepublic String changeSessionId()
changeSessionId in interface javax.servlet.http.HttpServletRequestchangeSessionId in interface RequestIllegalStateException - if there is no session associated
with the requestpublic String generateSessionId()
generateSessionId in interface Requestpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface javax.servlet.ServletRequestpublic <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException, javax.servlet.ServletException
HttpUpgradeHandler for an given
class and uses it for the http protocol upgrade processing.upgrade in interface javax.servlet.http.HttpServletRequesthandlerClass - The HttpUpgradeHandler class used for the upgrade.HttpUpgradeHandlerIOException - if an I/O error occurred during the upgradejavax.servlet.ServletException - if the given clazz fails to be
instantiatedHttpUpgradeHandler,
WebConnectionpublic void initialiseHttpUpgradeHandler(javax.servlet.http.WebConnection wc)
public javax.servlet.http.WebConnection getWebConnection()
public void setWebConnection(javax.servlet.http.WebConnection wc)
protected Session doGetSession(boolean create)
protected void configureSessionCookie(javax.servlet.http.Cookie cookie)
cookie - The JSESSIONID cookie to be configuredprotected void parseCookies()
protected javax.servlet.http.Cookie makeCookie(org.glassfish.grizzly.http.Cookie scookie)
protected javax.servlet.http.Cookie makeCookie(org.glassfish.grizzly.http.Cookie scookie,
boolean decode)
protected byte[] getPostBody()
throws IOException
IOExceptionprotected int readPostBody(byte[] body,
int len)
throws IOException
IOExceptionprotected static boolean isAlpha(String value)
protected void obtainSessionId()
protected void parseSessionId(String sessionParameterName, org.glassfish.grizzly.http.util.CharChunk uriBB)
protected void parseSessionVersion(org.glassfish.grizzly.http.util.CharChunk uriCC)
protected void parseJReplica(org.glassfish.grizzly.http.util.CharChunk uriCC)
public String getJrouteId()
JROUTE cookie or appended to the
session identifier encoded in the URI (if cookies have been disabled).getJrouteId in interface Requestprotected void parseSessionCookiesId()
protected void convertURI(org.glassfish.grizzly.http.util.MessageBytes uri)
throws Exception
Exceptionpublic javax.servlet.DispatcherType getDispatcherType()
getDispatcherType in interface javax.servlet.ServletRequestpublic javax.servlet.AsyncContext startAsync()
throws IllegalStateException
startAsync in interface javax.servlet.ServletRequestIllegalStateExceptionpublic javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
throws IllegalStateException
startAsync in interface javax.servlet.ServletRequestservletRequest - the ServletRequest with which to initialize
the AsyncContextservletResponse - the ServletResponse with which to initialize
the AsyncContextIllegalStateExceptionpublic boolean isAsyncStarted()
isAsyncStarted in interface javax.servlet.ServletRequestpublic void disableAsyncSupport()
disableAsyncSupport in interface Requestpublic boolean isAsyncSupported()
isAsyncSupported in interface javax.servlet.ServletRequestpublic javax.servlet.AsyncContext getAsyncContext()
getAsyncContext in interface javax.servlet.ServletRequestpublic Collection<javax.servlet.http.Part> getParts() throws IOException, javax.servlet.ServletException
getParts in interface javax.servlet.http.HttpServletRequestIOExceptionjavax.servlet.ServletExceptionpublic javax.servlet.http.Part getPart(String name) throws IOException, javax.servlet.ServletException
getPart in interface javax.servlet.http.HttpServletRequestIOExceptionjavax.servlet.ServletExceptionpublic Session lockSession()
lockSession in interface Requestpublic void unlockSession()
unlockSession in interface RequestCopyright © 2019. All rights reserved.