public class DummyRequest extends Object implements HttpRequest, javax.servlet.http.HttpServletRequest
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
checkRestrictedResources
Whether or not access to resources in WEB-INF or META-INF needs to be
checked.
|
protected javax.servlet.FilterChain |
filterChain |
protected String |
pathInfo |
protected String |
queryString |
protected String |
servletPath |
protected Wrapper |
wrapper |
| Constructor and Description |
|---|
DummyRequest() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAsyncListener(javax.servlet.AsyncListener listener) |
void |
addAsyncListener(javax.servlet.AsyncListener listener,
javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse) |
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 ID of the session that this request is associated with.
|
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.
|
javax.servlet.ServletInputStream |
createInputStream()
Create and return a ServletInputStream to read the content
associated with this Request.
|
void |
disableAsyncSupport()
Disables async support on this request.
|
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() |
long |
getAsyncTimeout() |
Object |
getAttribute(String name) |
Enumeration<String> |
getAttributeNames() |
String |
getAuthorization()
Return the authorization credentials sent with this request.
|
String |
getAuthType() |
String |
getCharacterEncoding() |
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() |
long |
getContentLengthLong() |
String |
getContentType() |
Context |
getContext()
Return the Context within which this Request is being processed.
|
String |
getContextPath() |
javax.servlet.http.Cookie[] |
getCookies() |
long |
getDateHeader(String name) |
String |
getDecodedRequestURI()
Get the decoded request URI.
|
javax.servlet.DispatcherType |
getDispatcherType() |
javax.servlet.FilterChain |
getFilterChain()
Get filter chain associated with the request.
|
String |
getHeader(String name) |
Enumeration<String> |
getHeaderNames() |
Enumeration<String> |
getHeaders(String name) |
Host |
getHost()
Return the Host within which this Request is being processed.
|
String |
getInfo()
Return descriptive information about this Request implementation and
the corresponding version number, in the format
<description>/<version>. |
javax.servlet.ServletInputStream |
getInputStream() |
int |
getIntHeader(String name) |
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() |
Locale |
getLocale() |
Enumeration<Locale> |
getLocales() |
String |
getLocalName() |
int |
getLocalPort() |
String |
getMethod() |
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) |
Map<String,String[]> |
getParameterMap() |
Enumeration<String> |
getParameterNames() |
String[] |
getParameterValues(String name) |
javax.servlet.http.Part |
getPart(String name) |
Collection<javax.servlet.http.Part> |
getParts() |
String |
getPathInfo() |
String |
getPathTranslated() |
String |
getProtocol() |
String |
getQueryString() |
BufferedReader |
getReader() |
String |
getRealPath(String path) |
String |
getRemoteAddr() |
String |
getRemoteHost() |
int |
getRemotePort() |
String |
getRemoteUser() |
javax.servlet.ServletRequest |
getRequest()
Return the
ServletRequest for which this object
is the facade. |
javax.servlet.ServletRequest |
getRequest(boolean maskDefaultContextMapping)
Return the
ServletRequest for which this object
is the facade. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path) |
String |
getRequestedSessionId() |
org.glassfish.grizzly.http.util.DataChunk |
getRequestPathMB()
Get the request path.
|
String |
getRequestURI() |
StringBuffer |
getRequestURL() |
Response |
getResponse()
Return the Response with which this Request is associated.
|
String |
getScheme() |
String |
getServerName() |
int |
getServerPort() |
javax.servlet.ServletContext |
getServletContext()
Gets the servlet context to which this servlet request was last
dispatched.
|
String |
getServletPath() |
javax.servlet.http.HttpSession |
getSession() |
javax.servlet.http.HttpSession |
getSession(boolean create) |
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.
|
Principal |
getUserPrincipal() |
Wrapper |
getWrapper()
Return the Wrapper within which this Request is being processed.
|
boolean |
isAsyncStarted() |
boolean |
isAsyncSupported() |
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl() |
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isSetAsyncTimeoutCalled() |
boolean |
isUserInRole(String role) |
Session |
lockSession() |
void |
login(String username,
String password) |
void |
logout() |
void |
recycle()
Release all object references, and initialize instance variables, in
preparation for reuse of this object.
|
void |
removeAttribute(String name) |
void |
removeNote(String name)
Remove any object bound to the specified name in the internal notes
for this request.
|
void |
replayPayload(byte[] payloadByteArray) |
void |
setAsyncTimeout(long timeout) |
void |
setAttribute(String name,
Object value) |
void |
setAuthType(String authType)
Set the authentication type used for this request, if any; otherwise
set the type to
null. |
void |
setCharacterEncoding(String enc) |
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 |
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 |
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 path)
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)
Set the query string for this Request.
|
void |
setRemoteAddr(String remoteAddr)
Set the remote IP address associated with this Request.
|
void |
setRemoteHost(String remoteHost) |
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 |
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 path)
Set the servlet path for this Request.
|
void |
setSocket(Socket socket)
Set the Socket (if any) through which this Request was received.
|
void |
setStream(InputStream input)
Set the input stream associated with this Request.
|
void |
setUserPrincipal(Principal principal)
Set the Principal who has been authenticated for this Request.
|
void |
setWrapper(Wrapper wrapper)
Set the Wrapper within which this Request is being processed.
|
javax.servlet.AsyncContext |
startAsync() |
javax.servlet.AsyncContext |
startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse) |
void |
unlockSession() |
<T extends javax.servlet.http.HttpUpgradeHandler> |
upgrade(Class<T> handlerClass) |
protected String queryString
protected String pathInfo
protected String servletPath
protected Wrapper wrapper
protected javax.servlet.FilterChain filterChain
protected boolean checkRestrictedResources
public String getContextPath()
public javax.servlet.ServletRequest getRequest()
RequestServletRequest for which this object
is the facade.getRequest in interface Requestpublic javax.servlet.ServletRequest getRequest(boolean maskDefaultContextMapping)
RequestServletRequest for which this object
is the facade.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 String getDecodedRequestURI()
HttpRequestgetDecodedRequestURI in interface HttpRequestpublic javax.servlet.FilterChain getFilterChain()
RequestgetFilterChain in interface Requestpublic void setFilterChain(javax.servlet.FilterChain filterChain)
RequestsetFilterChain in interface RequestfilterChain - new filter chainpublic String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic void setQueryString(String query)
HttpRequestsetQueryString in interface HttpRequestquery - The query stringpublic String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic void setPathInfo(String path)
HttpRequestsetPathInfo in interface HttpRequestpath - The path informationpublic org.glassfish.grizzly.http.util.DataChunk getRequestPathMB()
HttpRequestgetRequestPathMB in interface HttpRequestpublic String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic void setServletPath(String path)
HttpRequestsetServletPath in interface HttpRequestpath - The servlet pathpublic Wrapper getWrapper()
RequestgetWrapper in interface Requestpublic void setWrapper(Wrapper wrapper)
RequestsetWrapper in interface Requestwrapper - The newly associated Wrapperpublic void setMethod(String method)
HttpRequestsetMethod in interface HttpRequestmethod - The request methodpublic String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic String getAuthorization()
RequestgetAuthorization in interface Requestpublic Connector getConnector()
RequestgetConnector in interface Requestpublic void setConnector(Connector connector)
RequestsetConnector in interface Requestconnector - The new connectorpublic Context getContext()
RequestgetContext in interface Requestpublic void setContext(Context context)
RequestgetContextPath(),
and thus enables parsing of the request URI.setContext in interface Requestcontext - The newly associated Contextpublic Host getHost()
Requestpublic void setHost(Host host)
Requestpublic String getInfo()
Request<description>/<version>.public Response getResponse()
RequestgetResponse in interface Requestpublic void setResponse(Response response)
RequestsetResponse in interface Requestresponse - The new associated responsepublic Socket getSocket()
Requestpublic void setSocket(Socket socket)
Requestpublic InputStream getStream()
Requestpublic void setStream(InputStream input)
Requestpublic void addLocale(Locale locale)
HttpRequestaddLocale in interface HttpRequestlocale - The new preferred Localepublic javax.servlet.ServletInputStream createInputStream()
throws IOException
RequestcreateInputStream in interface RequestIOException - if an input/output error occurspublic void finishRequest()
throws IOException
RequestfinishRequest in interface RequestIOException - if an input/output error occurspublic Object getNote(String name)
Requestnull if no such binding exists.public Iterator<String> getNoteNames()
RequestgetNoteNames in interface Requestpublic void removeNote(String name)
RequestremoveNote in interface Requestname - Name of the note to be removedpublic void setContentType(String type)
Requesttext/html; charset=ISO-8859-4.setContentType in interface Requesttype - The new content typepublic void setNote(String name, Object value)
Requestpublic void setProtocol(String protocol)
RequestsetProtocol in interface Requestprotocol - Protocol name and versionpublic void setRemoteAddr(String remoteAddr)
RequestgetRemoteHost()
if that method is called.setRemoteAddr in interface RequestremoteAddr - The remote IP addresspublic void setRemoteHost(String remoteHost)
public void setServerName(String name)
RequestsetServerName in interface Requestname - The server namepublic void setServerPort(int port)
RequestsetServerPort in interface Requestport - The server portpublic Object getAttribute(String name)
getAttribute in interface javax.servlet.ServletRequestpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequestpublic String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestpublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic long getContentLengthLong()
public void setContentLength(int length)
RequestsetContentLength in interface Requestlength - The new content lengthpublic String getContentType()
getContentType in interface javax.servlet.ServletRequestpublic javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestIOExceptionpublic Locale getLocale()
public Enumeration<Locale> getLocales()
public String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic BufferedReader getReader() throws IOException
getReader in interface javax.servlet.ServletRequestIOExceptionpublic String getRealPath(String path)
getRealPath in interface javax.servlet.ServletRequestpublic String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestpublic 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()
public void removeAttribute(String name)
public void setAttribute(String name, Object value)
setAttribute in interface javax.servlet.ServletRequestpublic void setCharacterEncoding(String enc) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic void addCookie(javax.servlet.http.Cookie cookie)
HttpRequestaddCookie in interface HttpRequestcookie - The new cookiepublic void addHeader(String name, String value)
HttpRequestaddHeader in interface HttpRequestname - The new header namevalue - The new header valuepublic void addParameter(String name, String[] values)
HttpRequestaddParameter in interface HttpRequestname - Name of this request parametervalues - Corresponding values for this request parameterpublic void clearCookies()
HttpRequestclearCookies in interface HttpRequestpublic void clearHeaders()
HttpRequestclearHeaders in interface HttpRequestpublic void clearLocales()
HttpRequestclearLocales in interface HttpRequestpublic void clearParameters()
HttpRequestclearParameters in interface HttpRequestpublic void replayPayload(byte[] payloadByteArray)
replayPayload in interface HttpRequestpublic void recycle()
Requestpublic void setAuthType(String authType)
HttpRequestnull. Typical values are "BASIC",
"DIGEST", or "SSL".setAuthType in interface HttpRequestauthType - The authentication type usedpublic void setRequestedSessionCookie(boolean flag)
HttpRequestsetRequestedSessionCookie in interface HttpRequestflag - The new flagpublic void setRequestedSessionId(String id)
HttpRequestsetRequestedSessionId in interface HttpRequestid - The new session idpublic void setRequestedSessionURL(boolean flag)
HttpRequestsetRequestedSessionURL in interface HttpRequestflag - The new flagpublic void setRequestURI(String uri)
HttpRequestsetRequestURI in interface HttpRequesturi - The request URIpublic void setSecure(boolean secure)
RequestisSecure()
for this Request.public void setUserPrincipal(Principal principal)
HttpRequestgetRemoteUser() method.setUserPrincipal in interface HttpRequestprincipal - The user Principalpublic String getParameter(String name)
getParameter in interface javax.servlet.ServletRequestpublic Enumeration<String> getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic String[] getParameterValues(String name)
getParameterValues in interface javax.servlet.ServletRequestpublic javax.servlet.RequestDispatcher getRequestDispatcher(String path)
public String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic long getDateHeader(String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestpublic String getHeader(String name)
getHeader in interface javax.servlet.http.HttpServletRequestpublic Enumeration<String> getHeaders(String name)
public Enumeration<String> getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestpublic String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic StringBuffer getRequestURL()
public 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.HttpServletRequestpublic Session getSessionInternal(boolean create)
RequestgetSessionInternal in interface Requestcreate - true if a new session is to be created if one does not
already exist, false otherwisepublic String changeSessionId()
RequestchangeSessionId in interface Requestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic void setRequestedSessionCookiePath(String cookiePath)
RequestsetRequestedSessionCookiePath in interface Requestpublic boolean isUserInRole(String role)
public Principal getUserPrincipal()
public String getLocalAddr()
public String getLocalName()
public int getLocalPort()
public int getRemotePort()
public javax.servlet.DispatcherType getDispatcherType()
public javax.servlet.AsyncContext startAsync()
throws IllegalStateException
IllegalStateExceptionpublic javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
throws IllegalStateException
IllegalStateExceptionpublic boolean isAsyncStarted()
public boolean isAsyncSupported()
public void setAsyncTimeout(long timeout)
public long getAsyncTimeout()
public javax.servlet.AsyncContext getAsyncContext()
public void addAsyncListener(javax.servlet.AsyncListener listener)
public void addAsyncListener(javax.servlet.AsyncListener listener,
javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse)
public boolean isSetAsyncTimeoutCalled()
public void disableAsyncSupport()
RequestdisableAsyncSupport in interface Requestpublic Collection<javax.servlet.http.Part> getParts()
public javax.servlet.http.Part getPart(String name)
public boolean authenticate(javax.servlet.http.HttpServletResponse response)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic void login(String username, String password) throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic void logout()
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass)
public void setCheckRestrictedResources(boolean check)
setCheckRestrictedResources in interface Requestpublic boolean getCheckRestrictedResources()
getCheckRestrictedResources in interface Requestpublic String getJrouteId()
JROUTE cookie or appended to the
session identifier encoded in the URI (if cookies have been disabled).getJrouteId in interface Requestpublic String generateSessionId()
generateSessionId in interface Requestpublic javax.servlet.ServletContext getServletContext()
public Session lockSession()
lockSession in interface Requestpublic void unlockSession()
unlockSession in interface RequestCopyright © 2017. All rights reserved.