Package org.glassfish.grizzly.servlet
Class HttpServletRequestImpl
java.lang.Object
org.glassfish.grizzly.servlet.HttpServletRequestImpl
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest,Holders.RequestHolder
public class HttpServletRequestImpl
extends Object
implements javax.servlet.http.HttpServletRequest, Holders.RequestHolder
Facade class that wraps a
Request request object.
All methods are delegated to the wrapped request.- Version:
- $Revision: 1.7 $ $Date: 2007/08/01 19:04:28 $
- Author:
- Craig R. McClanahan, Remy Maucherat, Jean-Francois Arcand
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.glassfish.grizzly.http.server.RequestThe wrapped request.protected HttpServletResponseImplThe corresponding servlet responseprotected booleanUsing stream flag.protected booleanUsing writer flag.Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a wrapper for the specified request. -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(javax.servlet.http.HttpServletResponse hsr) protected Objectclone()Prevent cloning the facade.static HttpServletRequestImplcreate()voidDisables async support for this request.javax.servlet.AsyncContextgetAttribute(String name) intlongprotected WebappContextReturn the underlyingWebappContextjavax.servlet.http.Cookie[]longgetDateHeader(String name) javax.servlet.DispatcherTypeorg.glassfish.grizzly.http.Cookie[]getHeaders(String name) javax.servlet.http.HttpUpgradeHandlerjavax.servlet.ServletInputStreamorg.glassfish.grizzly.http.server.RequestReturns internal GrizzlyRequestassociated with this Holder.intgetIntHeader(String name) intgetParameter(String name) String[]getParameterValues(String name) javax.servlet.http.PartCollection<javax.servlet.http.Part>getParts()getRealPath(String path) intorg.glassfish.grizzly.http.server.Requestjavax.servlet.RequestDispatchergetRequestDispatcher(String path) intjavax.servlet.ServletContextjavax.servlet.http.HttpSessionjavax.servlet.http.HttpSessiongetSession(boolean create) voidinitialize(org.glassfish.grizzly.http.server.Request request, HttpServletResponseImpl servletResponse, WebappContext context) booleanbooleanbooleanbooleanbooleanbooleanbooleanisSecure()booleanbooleanisUserInRole(String role) voidvoidlogout()voidremoveAttribute(String name) voidsetAttribute(String name, Object value) voidprotected voidsetContextImpl(WebappContext contextImpl) Set the underlyingWebappContextprotected voidsetContextPath(String contextPath) protected voidsetPathInfo(String pathInfo) voidsetServletPath(String servletPath) Programmatically set the servlet path value.javax.servlet.AsyncContextjavax.servlet.AsyncContextstartAsync(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) <T extends javax.servlet.http.HttpUpgradeHandler>
TCreate an instance ofHttpUpgradeHandlerfor an given class and uses it for the http protocol upgrade processing.
-
Field Details
-
request
protected org.glassfish.grizzly.http.server.Request requestThe wrapped request. -
servletResponse
The corresponding servlet response -
usingInputStream
protected boolean usingInputStreamUsing stream flag. -
usingReader
protected boolean usingReaderUsing writer flag.
-
-
Constructor Details
-
HttpServletRequestImpl
protected HttpServletRequestImpl()Construct a wrapper for the specified request.
-
-
Method Details
-
create
-
initialize
public void initialize(org.glassfish.grizzly.http.server.Request request, HttpServletResponseImpl servletResponse, WebappContext context) throws IOException - Throws:
IOException
-
clone
Prevent cloning the facade.- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getAttribute
- Specified by:
getAttributein interfacejavax.servlet.ServletRequest
-
getAttributeNames
- Specified by:
getAttributeNamesin interfacejavax.servlet.ServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfacejavax.servlet.ServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfacejavax.servlet.ServletRequest- Throws:
UnsupportedEncodingException
-
getContentLength
public int getContentLength()- Specified by:
getContentLengthin interfacejavax.servlet.ServletRequest
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLongin interfacejavax.servlet.ServletRequest
-
getContentType
- Specified by:
getContentTypein interfacejavax.servlet.ServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfacejavax.servlet.ServletRequest- Throws:
IOException
-
getParameter
- Specified by:
getParameterin interfacejavax.servlet.ServletRequest
-
getParameterNames
- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfacejavax.servlet.ServletRequest
-
getProtocol
- Specified by:
getProtocolin interfacejavax.servlet.ServletRequest
-
getScheme
- Specified by:
getSchemein interfacejavax.servlet.ServletRequest
-
getServerName
- Specified by:
getServerNamein interfacejavax.servlet.ServletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfacejavax.servlet.ServletRequest
-
getReader
- Specified by:
getReaderin interfacejavax.servlet.ServletRequest- Throws:
IOException
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfacejavax.servlet.ServletRequest
-
getRemoteHost
- Specified by:
getRemoteHostin interfacejavax.servlet.ServletRequest
-
setAttribute
- Specified by:
setAttributein interfacejavax.servlet.ServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfacejavax.servlet.ServletRequest
-
getLocale
- Specified by:
getLocalein interfacejavax.servlet.ServletRequest
-
getLocales
- Specified by:
getLocalesin interfacejavax.servlet.ServletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfacejavax.servlet.ServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfacejavax.servlet.ServletRequest
-
getRealPath
- Specified by:
getRealPathin interfacejavax.servlet.ServletRequest
-
getAuthType
- Specified by:
getAuthTypein interfacejavax.servlet.http.HttpServletRequest
-
getGrizzlyCookies
public org.glassfish.grizzly.http.Cookie[] getGrizzlyCookies() -
getDateHeader
- Specified by:
getDateHeaderin interfacejavax.servlet.http.HttpServletRequest
-
getHeader
- Specified by:
getHeaderin interfacejavax.servlet.http.HttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfacejavax.servlet.http.HttpServletRequest
-
getHeaderNames
- Specified by:
getHeaderNamesin interfacejavax.servlet.http.HttpServletRequest
-
getIntHeader
- Specified by:
getIntHeaderin interfacejavax.servlet.http.HttpServletRequest
-
getMethod
- Specified by:
getMethodin interfacejavax.servlet.http.HttpServletRequest
-
getPathInfo
- Specified by:
getPathInfoin interfacejavax.servlet.http.HttpServletRequest
-
getPathTranslated
- Specified by:
getPathTranslatedin interfacejavax.servlet.http.HttpServletRequest
-
getContextPath
- Specified by:
getContextPathin interfacejavax.servlet.http.HttpServletRequest
-
setContextPath
-
getQueryString
- Specified by:
getQueryStringin interfacejavax.servlet.http.HttpServletRequest
-
getRemoteUser
- Specified by:
getRemoteUserin interfacejavax.servlet.http.HttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfacejavax.servlet.http.HttpServletRequest
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfacejavax.servlet.http.HttpServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionIdin interfacejavax.servlet.http.HttpServletRequest
-
getRequestURI
- Specified by:
getRequestURIin interfacejavax.servlet.http.HttpServletRequest
-
getRequestURL
- Specified by:
getRequestURLin interfacejavax.servlet.http.HttpServletRequest
-
getServletPath
- Specified by:
getServletPathin interfacejavax.servlet.http.HttpServletRequest
-
getSession
public javax.servlet.http.HttpSession getSession(boolean create) - Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
-
getSession
public javax.servlet.http.HttpSession getSession()- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
-
changeSessionId
- Specified by:
changeSessionIdin interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValidin interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()- Specified by:
isRequestedSessionIdFromCookiein interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()- Specified by:
isRequestedSessionIdFromURLin interfacejavax.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()- Specified by:
isRequestedSessionIdFromUrlin interfacejavax.servlet.http.HttpServletRequest
-
getCookies
public javax.servlet.http.Cookie[] getCookies()- Specified by:
getCookiesin interfacejavax.servlet.http.HttpServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePortin interfacejavax.servlet.ServletRequest
-
getLocalName
- Specified by:
getLocalNamein interfacejavax.servlet.ServletRequest
-
getLocalAddr
- Specified by:
getLocalAddrin interfacejavax.servlet.ServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPortin interfacejavax.servlet.ServletRequest
-
getContextImpl
Return the underlyingWebappContext- Returns:
- Return the underlying
WebappContext
-
setContextImpl
Set the underlyingWebappContext- Parameters:
contextImpl- the underlyingWebappContext
-
setServletPath
Programmatically set the servlet path value. Default is an empty String.- Parameters:
servletPath- Servlet path to set.
-
setPathInfo
-
getRequest
public org.glassfish.grizzly.http.server.Request getRequest() -
getServletContext
public javax.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfacejavax.servlet.ServletRequest
-
getInternalRequest
public org.glassfish.grizzly.http.server.Request getInternalRequest()Returns internal GrizzlyRequestassociated with this Holder.- Specified by:
getInternalRequestin interfaceHolders.RequestHolder
-
getDispatcherType
public javax.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherTypein interfacejavax.servlet.ServletRequest
-
startAsync
- Specified by:
startAsyncin interfacejavax.servlet.ServletRequest- Throws:
IllegalStateException
-
startAsync
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws IllegalStateException - Specified by:
startAsyncin interfacejavax.servlet.ServletRequest- Throws:
IllegalStateException
-
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfacejavax.servlet.ServletRequest
-
disableAsyncSupport
public void disableAsyncSupport()Disables async support for this request. Async support is disabled as soon as this request has passed a filter or servlet that does not support async (either via the designated annotation or declaratively). -
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfacejavax.servlet.ServletRequest
-
getAsyncContext
public javax.servlet.AsyncContext getAsyncContext()- Specified by:
getAsyncContextin interfacejavax.servlet.ServletRequest
-
upgrade
public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> handlerClass) throws IOException Create an instance ofHttpUpgradeHandlerfor an given class and uses it for the http protocol upgrade processing.- Specified by:
upgradein interfacejavax.servlet.http.HttpServletRequest- Parameters:
handlerClass- TheProtocolHandlerclass used for the upgrade.- Returns:
- an instance of the
HttpUpgradeHandler - Throws:
IOException- if an I/O error occurred during the upgrade- Since:
- Servlet 3.1
- See Also:
-
HttpUpgradeHandlerWebConnection
-
isUpgrade
public boolean isUpgrade() -
getHttpUpgradeHandler
public javax.servlet.http.HttpUpgradeHandler getHttpUpgradeHandler() -
authenticate
public boolean authenticate(javax.servlet.http.HttpServletResponse hsr) throws IOException, javax.servlet.ServletException - Specified by:
authenticatein interfacejavax.servlet.http.HttpServletRequest- Throws:
IOExceptionjavax.servlet.ServletException
-
login
- Specified by:
loginin interfacejavax.servlet.http.HttpServletRequest- Throws:
javax.servlet.ServletException
-
logout
public void logout() throws javax.servlet.ServletException- Specified by:
logoutin interfacejavax.servlet.http.HttpServletRequest- Throws:
javax.servlet.ServletException
-
getParts
public Collection<javax.servlet.http.Part> getParts() throws IOException, javax.servlet.ServletException- Specified by:
getPartsin interfacejavax.servlet.http.HttpServletRequest- Throws:
IOExceptionjavax.servlet.ServletException
-
getPart
public javax.servlet.http.Part getPart(String string) throws IOException, javax.servlet.ServletException - Specified by:
getPartin interfacejavax.servlet.http.HttpServletRequest- Throws:
IOExceptionjavax.servlet.ServletException
-