Package org.atmosphere.cpr
Interface AtmosphereRequest
- All Superinterfaces:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest
- All Known Implementing Classes:
AtmosphereRequestImpl
public interface AtmosphereRequest
extends javax.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 javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.booleanauthenticate(javax.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.javax.servlet.AsyncContextintjavax.servlet.http.Cookie[]longgetDateHeader(String name) javax.servlet.DispatcherTypegetHeaders(String name) javax.servlet.ServletInputStreamintgetIntHeader(String name) intString[]javax.servlet.http.PartCollection<javax.servlet.http.Part> getParts()getRealPath(String path) intjavax.servlet.RequestDispatchergetRequestDispatcher(String path) intjavax.servlet.ServletContextjavax.servlet.http.HttpSessionjavax.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(javax.servlet.ServletRequest request) javax.servlet.AsyncContextjavax.servlet.AsyncContextstartAsync(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) toString()uuid()Return the underlyingAtmosphereResource.uuid().javax.servlet.http.HttpServletRequest
-
Method Details
-
destroyed
boolean destroyed() -
destroyable
-
getPathInfo
String getPathInfo()- Specified by:
getPathInfoin interfacejavax.servlet.http.HttpServletRequest
-
getPathTranslated
String getPathTranslated()- Specified by:
getPathTranslatedin interfacejavax.servlet.http.HttpServletRequest
-
getQueryString
String getQueryString()- Specified by:
getQueryStringin interfacejavax.servlet.http.HttpServletRequest
-
getRemoteUser
String getRemoteUser()- Specified by:
getRemoteUserin interfacejavax.servlet.http.HttpServletRequest
-
getRequestedSessionId
String getRequestedSessionId()- Specified by:
getRequestedSessionIdin interfacejavax.servlet.http.HttpServletRequest
-
getMethod
String getMethod()- Specified by:
getMethodin interfacejavax.servlet.http.HttpServletRequest
-
getPart
- Specified by:
getPartin interfacejavax.servlet.http.HttpServletRequest- Throws:
IOExceptionjavax.servlet.ServletException
-
getParts
- Specified by:
getPartsin interfacejavax.servlet.http.HttpServletRequest- Throws:
IOExceptionjavax.servlet.ServletException
-
getContentType
String getContentType()- Specified by:
getContentTypein interfacejavax.servlet.ServletRequest
-
getDispatcherType
javax.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherTypein interfacejavax.servlet.ServletRequest
-
getServletPath
String getServletPath()- Specified by:
getServletPathin interfacejavax.servlet.http.HttpServletRequest
-
getRequestURI
String getRequestURI()- Specified by:
getRequestURIin interfacejavax.servlet.http.HttpServletRequest
-
getRequestURL
StringBuffer getRequestURL()- Specified by:
getRequestURLin interfacejavax.servlet.http.HttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfacejavax.servlet.http.HttpServletRequest
-
getIntHeader
- Specified by:
getIntHeaderin interfacejavax.servlet.http.HttpServletRequest
-
getHeaderNames
Enumeration<String> getHeaderNames()- Specified by:
getHeaderNamesin interfacejavax.servlet.http.HttpServletRequest
-
authenticate
boolean authenticate(javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException - Specified by:
authenticatein interfacejavax.servlet.http.HttpServletRequest- Throws:
IOExceptionjavax.servlet.ServletException
-
getAuthType
String getAuthType()- Specified by:
getAuthTypein interfacejavax.servlet.http.HttpServletRequest
-
getContextPath
String getContextPath()- Specified by:
getContextPathin interfacejavax.servlet.http.HttpServletRequest
-
getCookies
javax.servlet.http.Cookie[] getCookies()- Specified by:
getCookiesin interfacejavax.servlet.http.HttpServletRequest
-
getDateHeader
- Specified by:
getDateHeaderin interfacejavax.servlet.http.HttpServletRequest
-
getHeader
- Specified by:
getHeaderin interfacejavax.servlet.http.HttpServletRequest
-
wrappedRequest
javax.servlet.http.HttpServletRequest wrappedRequest() -
getHeader
-
getParameter
- Specified by:
getParameterin interfacejavax.servlet.ServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfacejavax.servlet.ServletRequest
-
getParameterNames
Enumeration<String> getParameterNames()- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest
-
getProtocol
String getProtocol()- Specified by:
getProtocolin interfacejavax.servlet.ServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfacejavax.servlet.ServletRequest- Throws:
IOException
-
getReader
- Specified by:
getReaderin interfacejavax.servlet.ServletRequest- Throws:
IOException
-
getRealPath
- Specified by:
getRealPathin interfacejavax.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 interfacejavax.servlet.ServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfacejavax.servlet.ServletRequest- Throws:
UnsupportedEncodingException
-
startAsync
javax.servlet.AsyncContext startAsync()- Specified by:
startAsyncin interfacejavax.servlet.ServletRequest
-
startAsync
javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) - Specified by:
startAsyncin interfacejavax.servlet.ServletRequest
-
getAsyncContext
javax.servlet.AsyncContext getAsyncContext()- Specified by:
getAsyncContextin interfacejavax.servlet.ServletRequest
-
getAttribute
- Specified by:
getAttributein interfacejavax.servlet.ServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfacejavax.servlet.ServletRequest
-
attributes
AtmosphereRequest.LocalAttributes attributes()Deprecated.Return the locally added attributes.- Returns:
- the locally added attributes
-
getSession
javax.servlet.http.HttpSession getSession()- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
-
getSession
javax.servlet.http.HttpSession getSession(boolean create) - Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
-
getUserPrincipal
Principal getUserPrincipal()- Specified by:
getUserPrincipalin interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromCookie
boolean isRequestedSessionIdFromCookie()- Specified by:
isRequestedSessionIdFromCookiein interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
boolean isRequestedSessionIdFromUrl()- Specified by:
isRequestedSessionIdFromUrlin interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
boolean isRequestedSessionIdFromURL()- Specified by:
isRequestedSessionIdFromURLin interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValidin interfacejavax.servlet.http.HttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfacejavax.servlet.http.HttpServletRequest
-
login
- Specified by:
loginin interfacejavax.servlet.http.HttpServletRequest- Throws:
javax.servlet.ServletException
-
logout
void logout() throws javax.servlet.ServletException- Specified by:
logoutin interfacejavax.servlet.http.HttpServletRequest- Throws:
javax.servlet.ServletException
-
getRemoteAddr
String getRemoteAddr()- Specified by:
getRemoteAddrin interfacejavax.servlet.ServletRequest
-
getRemoteHost
String getRemoteHost()- Specified by:
getRemoteHostin interfacejavax.servlet.ServletRequest
-
getRemotePort
int getRemotePort()- Specified by:
getRemotePortin interfacejavax.servlet.ServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfacejavax.servlet.ServletRequest
-
getScheme
String getScheme()- Specified by:
getSchemein interfacejavax.servlet.ServletRequest
-
getServerName
String getServerName()- Specified by:
getServerNamein interfacejavax.servlet.ServletRequest
-
getServerPort
int getServerPort()- Specified by:
getServerPortin interfacejavax.servlet.ServletRequest
-
getServletContext
javax.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfacejavax.servlet.ServletRequest
-
isAsyncStarted
boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfacejavax.servlet.ServletRequest
-
isAsyncSupported
boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfacejavax.servlet.ServletRequest
-
isSecure
boolean isSecure()- Specified by:
isSecurein interfacejavax.servlet.ServletRequest
-
getLocalName
String getLocalName()- Specified by:
getLocalNamein interfacejavax.servlet.ServletRequest
-
getLocalPort
int getLocalPort()- Specified by:
getLocalPortin interfacejavax.servlet.ServletRequest
-
getLocalAddr
String getLocalAddr()- Specified by:
getLocalAddrin interfacejavax.servlet.ServletRequest
-
getLocale
Locale getLocale()- Specified by:
getLocalein interfacejavax.servlet.ServletRequest
-
resource
AtmosphereResource resource()TheAtmosphereResourceassociated with this request.- Returns:
- an
AtmosphereResource
-
getLocales
Enumeration<Locale> getLocales()- Specified by:
getLocalesin interfacejavax.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 interfacejavax.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 interfacejavax.servlet.ServletRequest
-
getContentLength
int getContentLength()- Specified by:
getContentLengthin interfacejavax.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(javax.servlet.ServletRequest request) -
toString
String toString() -
requestURL
String requestURL()
-
localAttributes()