Package org.atmosphere.cpr
Interface AtmosphereRequest
- All Superinterfaces:
jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletRequest
- All Known Implementing Classes:
AtmosphereRequestImpl
public interface AtmosphereRequest
extends jakarta.servlet.http.HttpServletRequest
An Atmosphere request representation. An
AtmosphereRequest is a two-way communication channel between the
client and the server. If the AtmosphereRequestImpl.isDestroyable() is set to false, or if its
associated AtmosphereResource has been suspended, this object can be re-used at any moment between requests.
You can use its associated AtmosphereResponse to write bytes at any moment, making this object bi-directional.
- Author:
- Jeanfrancois Arcand
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic final class -
Field Summary
Fields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.booleanauthenticate(jakarta.servlet.http.HttpServletResponse response) body()Return the request's body.body(byte[] bytes) body(InputStream body) contextPath(String contextPath) voiddestroy()voiddestroy(boolean force) destroyable(boolean destroyable) booleanbooleanDispatch the request asynchronously to container.jakarta.servlet.AsyncContextintjakarta.servlet.http.Cookie[]longgetDateHeader(String name) jakarta.servlet.DispatcherTypegetHeaders(String name) jakarta.servlet.ServletInputStreamintgetIntHeader(String name) intString[]jakarta.servlet.http.PartCollection<jakarta.servlet.http.Part> getParts()getRealPath(String path) intjakarta.servlet.RequestDispatchergetRequestDispatcher(String path) intjakarta.servlet.ServletContextjakarta.servlet.http.HttpSessionjakarta.servlet.http.HttpSessiongetSession(boolean create) Add a header.Add all headers contained within the Map.booleanbooleanbooleanCjeck if this object can be destroyed.booleanbooleanbooleanbooleanbooleanisSecure()booleanisUserInRole(String role) Return a subset of the attributes set on this AtmosphereRequest, set locally by the framework or by an application.voidvoidlogout()queryString(String qs) Set the query string.voidremoveAttribute(String name) requestURI(String requestURI) resource()TheAtmosphereResourceassociated with this request.servletPath(String servletPath) voidsetAttribute(String s, Object o) voidvoidsetRequest(jakarta.servlet.ServletRequest request) jakarta.servlet.AsyncContextjakarta.servlet.AsyncContextstartAsync(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) toString()uuid()Return the underlyingAtmosphereResource.uuid().jakarta.servlet.http.HttpServletRequestMethods inherited from interface jakarta.servlet.http.HttpServletRequest
changeSessionId, getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder, upgradeMethods inherited from interface jakarta.servlet.ServletRequest
getContentLengthLong
-
Method Details
-
destroyed
boolean destroyed() -
destroyable
-
getPathInfo
String getPathInfo()- Specified by:
getPathInfoin interfacejakarta.servlet.http.HttpServletRequest
-
getPathTranslated
String getPathTranslated()- Specified by:
getPathTranslatedin interfacejakarta.servlet.http.HttpServletRequest
-
getQueryString
String getQueryString()- Specified by:
getQueryStringin interfacejakarta.servlet.http.HttpServletRequest
-
getRemoteUser
String getRemoteUser()- Specified by:
getRemoteUserin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestedSessionId
String getRequestedSessionId()- Specified by:
getRequestedSessionIdin interfacejakarta.servlet.http.HttpServletRequest
-
getMethod
String getMethod()- Specified by:
getMethodin interfacejakarta.servlet.http.HttpServletRequest
-
getPart
- Specified by:
getPartin interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
getParts
Collection<jakarta.servlet.http.Part> getParts() throws IOException, jakarta.servlet.ServletException- Specified by:
getPartsin interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
getContentType
String getContentType()- Specified by:
getContentTypein interfacejakarta.servlet.ServletRequest
-
getDispatcherType
jakarta.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherTypein interfacejakarta.servlet.ServletRequest
-
getServletPath
String getServletPath()- Specified by:
getServletPathin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURI
String getRequestURI()- Specified by:
getRequestURIin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURL
StringBuffer getRequestURL()- Specified by:
getRequestURLin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfacejakarta.servlet.http.HttpServletRequest
-
getIntHeader
- Specified by:
getIntHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaderNames
Enumeration<String> getHeaderNames()- Specified by:
getHeaderNamesin interfacejakarta.servlet.http.HttpServletRequest
-
authenticate
boolean authenticate(jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException - Specified by:
authenticatein interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
getAuthType
String getAuthType()- Specified by:
getAuthTypein interfacejakarta.servlet.http.HttpServletRequest
-
getContextPath
String getContextPath()- Specified by:
getContextPathin interfacejakarta.servlet.http.HttpServletRequest
-
getCookies
jakarta.servlet.http.Cookie[] getCookies()- Specified by:
getCookiesin interfacejakarta.servlet.http.HttpServletRequest
-
getDateHeader
- Specified by:
getDateHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getHeader
- Specified by:
getHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
wrappedRequest
jakarta.servlet.http.HttpServletRequest wrappedRequest() -
getHeader
-
getParameter
- Specified by:
getParameterin interfacejakarta.servlet.ServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfacejakarta.servlet.ServletRequest
-
getParameterNames
Enumeration<String> getParameterNames()- Specified by:
getParameterNamesin interfacejakarta.servlet.ServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfacejakarta.servlet.ServletRequest
-
getProtocol
String getProtocol()- Specified by:
getProtocolin interfacejakarta.servlet.ServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getReader
- Specified by:
getReaderin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getRealPath
- Specified by:
getRealPathin interfacejakarta.servlet.ServletRequest
-
headers
Add all headers contained within the Map.- Parameters:
headers-- Returns:
- this;
-
header
Add a header.- Parameters:
name-value-- Returns:
- this
-
queryString
Set the query string.- Parameters:
qs-- Returns:
- this
-
headersMap
-
queryStringsMap
-
method
-
contentType
-
body
-
body
-
body
-
body
-
body
AtmosphereRequestImpl.Body body()Return the request's body. This method will return an empty Body if the underlying container or framework is using InputStream or Reader.- Returns:
- the request body;
-
servletPath
-
contextPath
-
requestURI
-
setAttribute
- Specified by:
setAttributein interfacejakarta.servlet.ServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfacejakarta.servlet.ServletRequest- Throws:
UnsupportedEncodingException
-
startAsync
jakarta.servlet.AsyncContext startAsync()- Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest
-
startAsync
jakarta.servlet.AsyncContext startAsync(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) - Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest
-
getAsyncContext
jakarta.servlet.AsyncContext getAsyncContext()- Specified by:
getAsyncContextin interfacejakarta.servlet.ServletRequest
-
getAttribute
- Specified by:
getAttributein interfacejakarta.servlet.ServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfacejakarta.servlet.ServletRequest
-
attributes
AtmosphereRequest.LocalAttributes attributes()Deprecated.Return the locally added attributes.- Returns:
- the locally added attributes
-
getSession
jakarta.servlet.http.HttpSession getSession()- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
getSession
jakarta.servlet.http.HttpSession getSession(boolean create) - Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
getUserPrincipal
Principal getUserPrincipal()- Specified by:
getUserPrincipalin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromCookie
boolean isRequestedSessionIdFromCookie()- Specified by:
isRequestedSessionIdFromCookiein interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
boolean isRequestedSessionIdFromUrl()- Specified by:
isRequestedSessionIdFromUrlin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
boolean isRequestedSessionIdFromURL()- Specified by:
isRequestedSessionIdFromURLin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValidin interfacejakarta.servlet.http.HttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfacejakarta.servlet.http.HttpServletRequest
-
login
- Specified by:
loginin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
logout
void logout() throws jakarta.servlet.ServletException- Specified by:
logoutin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
getRemoteAddr
String getRemoteAddr()- Specified by:
getRemoteAddrin interfacejakarta.servlet.ServletRequest
-
getRemoteHost
String getRemoteHost()- Specified by:
getRemoteHostin interfacejakarta.servlet.ServletRequest
-
getRemotePort
int getRemotePort()- Specified by:
getRemotePortin interfacejakarta.servlet.ServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletRequest
-
getScheme
String getScheme()- Specified by:
getSchemein interfacejakarta.servlet.ServletRequest
-
getServerName
String getServerName()- Specified by:
getServerNamein interfacejakarta.servlet.ServletRequest
-
getServerPort
int getServerPort()- Specified by:
getServerPortin interfacejakarta.servlet.ServletRequest
-
getServletContext
jakarta.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfacejakarta.servlet.ServletRequest
-
isAsyncStarted
boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfacejakarta.servlet.ServletRequest
-
isAsyncSupported
boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfacejakarta.servlet.ServletRequest
-
isSecure
boolean isSecure()- Specified by:
isSecurein interfacejakarta.servlet.ServletRequest
-
getLocalName
String getLocalName()- Specified by:
getLocalNamein interfacejakarta.servlet.ServletRequest
-
getLocalPort
int getLocalPort()- Specified by:
getLocalPortin interfacejakarta.servlet.ServletRequest
-
getLocalAddr
String getLocalAddr()- Specified by:
getLocalAddrin interfacejakarta.servlet.ServletRequest
-
getLocale
Locale getLocale()- Specified by:
getLocalein interfacejakarta.servlet.ServletRequest
-
resource
AtmosphereResource resource()TheAtmosphereResourceassociated with this request.- Returns:
- an
AtmosphereResource
-
getLocales
Enumeration<Locale> getLocales()- Specified by:
getLocalesin interfacejakarta.servlet.ServletRequest
-
dispatchRequestAsynchronously
boolean dispatchRequestAsynchronously()Dispatch the request asynchronously to container. The default is false.- Returns:
- true to dispatch the request asynchronously to container.
-
isDestroyable
boolean isDestroyable()Cjeck if this object can be destroyed. Default is true. -
pathInfo
-
getAttributeNames
Enumeration<String> getAttributeNames()- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletRequest
-
localAttributes
AtmosphereRequest.LocalAttributes localAttributes()Return a subset of the attributes set on this AtmosphereRequest, set locally by the framework or by an application. Attributes added using this method won't be propagated to the original, container-only, native request object.- Returns:
- a
-
getCharacterEncoding
String getCharacterEncoding()- Specified by:
getCharacterEncodingin interfacejakarta.servlet.ServletRequest
-
getContentLength
int getContentLength()- Specified by:
getContentLengthin interfacejakarta.servlet.ServletRequest
-
uuid
String uuid()Return the underlyingAtmosphereResource.uuid(). May return "0" if noAtmosphereResourceis associated with this object.- Returns:
- the underlying
AtmosphereResource.uuid()
-
destroy
void destroy() -
destroy
void destroy(boolean force) -
setRequest
void setRequest(jakarta.servlet.ServletRequest request) -
toString
String toString() -
requestURL
String requestURL()
-
localAttributes()