java.lang.Object
jakarta.servlet.ServletRequestWrapper
jakarta.servlet.http.HttpServletRequestWrapper
cloud.piranha.webapp.impl.AsyncHttpDispatchWrapper
- All Implemented Interfaces:
WebApplicationRequest
,HttpServletRequest
,ServletRequest
public class AsyncHttpDispatchWrapper extends HttpServletRequestWrapper implements WebApplicationRequest
The async HTTP dispatch wrapper.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
Constructors Constructor Description AsyncHttpDispatchWrapper(HttpServletRequest request)
Constructor. -
Method Summary
Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String name)
Get the attribute.java.util.Enumeration<java.lang.String>
getAttributeNames()
Get the attribute names.DispatcherType
getDispatcherType()
Get the dispatcher type.java.lang.String
getParameter(java.lang.String name)
Get the parameter.java.util.Map<java.lang.String,java.lang.String[]>
getParameterMap()
Get the parameter map.java.util.Enumeration<java.lang.String>
getParameterNames()
Get the parameter names.java.lang.String[]
getParameterValues(java.lang.String name)
Get the parameter values.java.lang.String
getPathInfo()
Get the path info.java.lang.String
getQueryString()
Get the query string.HttpServletRequest
getRequest()
Get the wrapped request.java.lang.String
getRequestURI()
Get the request URI.java.lang.String
getRequestURIWithQueryString()
Get the request URI with query string.java.lang.String
getServletPath()
Get the servlet path.java.util.List<java.lang.String>
getWrapperAttributes()
Get the wrapper attributes.java.util.Map<java.lang.String,java.lang.String[]>
getWrapperParameters()
Get the wrapper parameters.boolean
isAsyncStarted()
Is async started.void
removeAttribute(java.lang.String name)
Remove the attribute.void
setAsWrapperAttribute(java.lang.String name, java.lang.Object value)
Set as a wrapper attribute.void
setAttribute(java.lang.String name, java.lang.Object object)
Set the attribute.void
setContextPath(java.lang.String contextPath)
Set the context path.void
setDispatcherType(DispatcherType dispatcherType)
Set the dispatcher type.void
setPathInfo(java.lang.String pathInfo)
Set the path info.void
setQueryString(java.lang.String queryString)
Set the query string.void
setRequestURI(java.lang.String requestURI)
Set the request URI.void
setServletPath(java.lang.String servletPath)
Set the servlet path.void
setWebApplication(WebApplication webApplication)
Set the web application.AsyncContext
startAsync()
Start async processing.AsyncContext
startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
Start async processing.java.lang.String
toString()
Methods inherited from class jakarta.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathTranslated, getRemoteUser, getRequestedSessionId, getRequestURL, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout, upgrade
Methods inherited from class jakarta.servlet.ServletRequestWrapper
getAsyncContext, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, setCharacterEncoding, setRequest
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface jakarta.servlet.http.HttpServletRequest
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathTranslated, getRemoteUser, getRequestedSessionId, getRequestURL, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
Methods inherited from interface jakarta.servlet.ServletRequest
getAsyncContext, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncSupported, isSecure, setCharacterEncoding
-
Constructor Details
-
AsyncHttpDispatchWrapper
Constructor.- Parameters:
request
- the HTTP servlet request.
-
-
Method Details
-
getRequest
Description copied from class:ServletRequestWrapper
Get the wrapped request.- Overrides:
getRequest
in classServletRequestWrapper
- Returns:
- the wrapped request.
-
getDispatcherType
Description copied from class:ServletRequestWrapper
Get the dispatcher type.- Specified by:
getDispatcherType
in interfaceServletRequest
- Overrides:
getDispatcherType
in classServletRequestWrapper
- Returns:
- the dispatcher type.
-
getServletPath
public java.lang.String getServletPath()Description copied from class:HttpServletRequestWrapper
Get the servlet path.- Specified by:
getServletPath
in interfaceHttpServletRequest
- Overrides:
getServletPath
in classHttpServletRequestWrapper
- Returns:
- the servlet path.
-
getPathInfo
public java.lang.String getPathInfo()Description copied from class:HttpServletRequestWrapper
Get the path info.- Specified by:
getPathInfo
in interfaceHttpServletRequest
- Overrides:
getPathInfo
in classHttpServletRequestWrapper
- Returns:
- the path info.
-
setPathInfo
public void setPathInfo(java.lang.String pathInfo)Set the path info.- Parameters:
pathInfo
- the path info.
-
getRequestURI
public java.lang.String getRequestURI()Description copied from class:HttpServletRequestWrapper
Get the request URI.- Specified by:
getRequestURI
in interfaceHttpServletRequest
- Overrides:
getRequestURI
in classHttpServletRequestWrapper
- Returns:
- the request URI.
-
setRequestURI
public void setRequestURI(java.lang.String requestURI)Set the request URI.- Parameters:
requestURI
- the request URI.
-
getQueryString
public java.lang.String getQueryString()Description copied from class:HttpServletRequestWrapper
Get the query string.- Specified by:
getQueryString
in interfaceHttpServletRequest
- Overrides:
getQueryString
in classHttpServletRequestWrapper
- Returns:
- the query string.
-
startAsync
Description copied from class:ServletRequestWrapper
Start async processing.- Specified by:
startAsync
in interfaceServletRequest
- Overrides:
startAsync
in classServletRequestWrapper
- Returns:
- the async context.
- Throws:
java.lang.IllegalStateException
- when not allowed.
-
startAsync
public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws java.lang.IllegalStateExceptionDescription copied from class:ServletRequestWrapper
Start async processing.- Specified by:
startAsync
in interfaceServletRequest
- Overrides:
startAsync
in classServletRequestWrapper
- Parameters:
servletRequest
- the servlet request.servletResponse
- the servlet response.- Returns:
- the async context.
- Throws:
java.lang.IllegalStateException
- when not able to start async processing.
-
isAsyncStarted
public boolean isAsyncStarted()Description copied from class:ServletRequestWrapper
Is async started.- Specified by:
isAsyncStarted
in interfaceServletRequest
- Overrides:
isAsyncStarted
in classServletRequestWrapper
- Returns:
- true if async started, false otherwise.
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()Description copied from class:ServletRequestWrapper
Get the attribute names.- Specified by:
getAttributeNames
in interfaceServletRequest
- Overrides:
getAttributeNames
in classServletRequestWrapper
- Returns:
- the attribute names.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)Description copied from class:ServletRequestWrapper
Get the attribute.- Specified by:
getAttribute
in interfaceServletRequest
- Overrides:
getAttribute
in classServletRequestWrapper
- Parameters:
name
- the name.- Returns:
- the value.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object object)Description copied from class:ServletRequestWrapper
Set the attribute.- Specified by:
setAttribute
in interfaceServletRequest
- Overrides:
setAttribute
in classServletRequestWrapper
- Parameters:
name
- the name.object
- the object value.
-
removeAttribute
public void removeAttribute(java.lang.String name)Description copied from class:ServletRequestWrapper
Remove the attribute.- Specified by:
removeAttribute
in interfaceServletRequest
- Overrides:
removeAttribute
in classServletRequestWrapper
- Parameters:
name
- the name.
-
getParameter
public java.lang.String getParameter(java.lang.String name)Get the parameter.- Specified by:
getParameter
in interfaceServletRequest
- Overrides:
getParameter
in classServletRequestWrapper
- Parameters:
name
- the name.- Returns:
- the value.
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()Get the parameter map.- Specified by:
getParameterMap
in interfaceServletRequest
- Overrides:
getParameterMap
in classServletRequestWrapper
- Returns:
- the parameter map.
-
getParameterNames
public java.util.Enumeration<java.lang.String> getParameterNames()Get the parameter names.- Specified by:
getParameterNames
in interfaceServletRequest
- Overrides:
getParameterNames
in classServletRequestWrapper
- Returns:
- the parameter names.
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)Get the parameter values.- Specified by:
getParameterValues
in interfaceServletRequest
- Overrides:
getParameterValues
in classServletRequestWrapper
- Parameters:
name
- the parameter name.- Returns:
- the parameter values.
-
setQueryString
public void setQueryString(java.lang.String queryString)Set the query string.- Parameters:
queryString
- the query string.
-
setAsWrapperAttribute
public void setAsWrapperAttribute(java.lang.String name, java.lang.Object value)Set as a wrapper attribute.- Parameters:
name
- the name.value
- the value.
-
getWrapperAttributes
public java.util.List<java.lang.String> getWrapperAttributes()Get the wrapper attributes.- Returns:
- the wrapper attributes.
-
getWrapperParameters
public java.util.Map<java.lang.String,java.lang.String[]> getWrapperParameters()Get the wrapper parameters.- Returns:
- the wrapper parameters.
-
setDispatcherType
Description copied from interface:WebApplicationRequest
Set the dispatcher type.- Specified by:
setDispatcherType
in interfaceWebApplicationRequest
- Parameters:
dispatcherType
- the dispatcher type.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getRequestURIWithQueryString
public java.lang.String getRequestURIWithQueryString()Get the request URI with query string.- Returns:
- the request URI with query string.
-
setContextPath
public void setContextPath(java.lang.String contextPath)Description copied from interface:WebApplicationRequest
Set the context path.- Specified by:
setContextPath
in interfaceWebApplicationRequest
- Parameters:
contextPath
- the context path.
-
setServletPath
public void setServletPath(java.lang.String servletPath)Description copied from interface:WebApplicationRequest
Set the servlet path.- Specified by:
setServletPath
in interfaceWebApplicationRequest
- Parameters:
servletPath
- the servlet path.
-
setWebApplication
Description copied from interface:WebApplicationRequest
Set the web application.- Specified by:
setWebApplication
in interfaceWebApplicationRequest
- Parameters:
webApplication
- the web application.
-