Module cloud.piranha.webapp.impl
Package cloud.piranha.webapp.impl
Class DefaultWebApplicationRequest
java.lang.Object
java.io.InputStream
javax.servlet.ServletInputStream
cloud.piranha.webapp.impl.DefaultWebApplicationRequest
- All Implemented Interfaces:
WebApplicationRequest
,java.io.Closeable
,java.lang.AutoCloseable
,HttpServletRequest
,ServletRequest
- Direct Known Subclasses:
DefaultWebApplicationServerRequest
,EmbeddedRequest
,NanoRequest
public class DefaultWebApplicationRequest extends ServletInputStream implements WebApplicationRequest
The default WebApplicationRequest.
- Author:
- Manfred Riem ([email protected])
-
Field Summary
Fields Modifier and Type Field Description protected AsyncContext
asyncContext
Stores the async context.protected boolean
asyncStarted
Stores if async is started.protected boolean
asyncSupported
Stores if async is supported.protected AttributeManager
attributeManager
Stores the attribute manager.protected java.lang.String
authType
Stores the auth type.protected java.lang.String
characterEncoding
Stores the character encoding.protected long
contentLength
Stores the content length.protected java.lang.String
contentType
Stores the content type.protected java.lang.String
contextPath
Stores the context path.protected Cookie[]
cookies
Stores the cookies.protected java.lang.String
currentSessionId
Stores the current session id.protected DispatcherType
dispatcherType
Stores the dispatcher type.protected boolean
gotInputStream
Stores the gotInputStream flag.protected boolean
gotReader
Stores the gotReader flag.protected HttpHeaderManager
headerManager
Stores the header manager.protected java.io.InputStream
inputStream
Stores the input stream.protected java.lang.String
localAddress
Stores the local address.protected java.lang.String
localName
Stores the local name.protected int
localPort
Stores the local port.protected java.lang.String
method
Stores the method.protected java.util.HashMap<java.lang.String,java.lang.String[]>
parameters
Stores the parameters.protected boolean
parametersParsed
Stores the parameters parsed flag.protected java.lang.String
pathInfo
Stores the path info.protected java.lang.String
protocol
Stores the protocol.protected java.lang.String
queryString
Stores the query string.protected java.io.BufferedReader
reader
Stores the reader.protected java.lang.String
remoteAddr
Stores the remote address.protected java.lang.String
remoteHost
Stores the remote host.protected int
remotePort
Stores the remote port.protected java.lang.String
requestedSessionId
Stores the requested session id.protected boolean
requestedSessionIdFromCookie
Stores the requested session id from cookie flag.protected boolean
requestedSessionIdFromURL
Stores the requested session id from url flag.protected java.lang.String
scheme
Stores the scheme.protected java.lang.String
serverName
Stores the server name.protected int
serverPort
Stores the server port.protected java.lang.String
servletPath
Stores the servlet path.protected boolean
upgraded
Stores the upgraded flag.protected HttpUpgradeHandler
upgradeHandler
Stores the upgrade handler.protected java.security.Principal
userPrincipal
Stores the user principal.protected WebApplication
webApplication
Stores the web applicationFields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
Constructors Constructor Description DefaultWebApplicationRequest()
Constructor. -
Method Summary
Modifier and Type Method Description boolean
authenticate(HttpServletResponse response)
Authenticate.java.lang.String
changeSessionId()
Change the session id.AsyncContext
getAsyncContext()
Get the async context.java.lang.Object
getAttribute(java.lang.String name)
Get the attribute.java.util.Enumeration<java.lang.String>
getAttributeNames()
Get attribute names.java.lang.String
getAuthType()
Get the auth type.java.lang.String
getCharacterEncoding()
Get the character encoding.int
getContentLength()
Get the content length.long
getContentLengthLong()
Get the content length.java.lang.String
getContentType()
Get the content type.java.lang.String
getContextPath()
Get the context path.Cookie[]
getCookies()
Get the cookies.long
getDateHeader(java.lang.String name)
Get the date header.DispatcherType
getDispatcherType()
Get the dispatcher type.java.lang.String
getHeader(java.lang.String name)
Get the header.java.util.Enumeration<java.lang.String>
getHeaderNames()
Get the header names.java.util.Enumeration<java.lang.String>
getHeaders(java.lang.String name)
Get the headers.ServletInputStream
getInputStream()
Get the input stream.int
getIntHeader(java.lang.String name)
Get the int header.java.lang.String
getLocalAddr()
Get the local address.java.util.Locale
getLocale()
Get locale.java.util.Enumeration<java.util.Locale>
getLocales()
Get the locales.java.lang.String
getLocalName()
Get the local name.int
getLocalPort()
Get the local port.java.lang.String
getMethod()
Get the request method.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.protected void
getParametersFromRequest()
Get the parameters from the request.java.lang.String[]
getParameterValues(java.lang.String name)
Get the parameter values.Part
getPart(java.lang.String name)
Get the part.java.util.Collection<Part>
getParts()
Get the parts.java.lang.String
getPathInfo()
Get the path info.java.lang.String
getPathTranslated()
Get the translated path.java.lang.String
getProtocol()
Get the protocol.java.lang.String
getQueryString()
Get the query string.java.io.BufferedReader
getReader()
Get the reader.java.lang.String
getRealPath(java.lang.String path)
Deprecated.java.lang.String
getRemoteAddr()
Get the remote address.java.lang.String
getRemoteHost()
Get the remote host.int
getRemotePort()
Get the remote port.java.lang.String
getRemoteUser()
Get the remote user.RequestDispatcher
getRequestDispatcher(java.lang.String path)
Get the request dispatcher.java.lang.String
getRequestedSessionId()
Get the requested session id.java.lang.String
getRequestURI()
Get the request URI.java.lang.String
getRequestURIWithQueryString()
java.lang.StringBuffer
getRequestURL()
Get the request URL.java.lang.String
getScheme()
Get the scheme.java.lang.String
getServerName()
Get the server name.int
getServerPort()
Get the server port.WebApplication
getServletContext()
Get the servlet context.java.lang.String
getServletPath()
Get the servlet path.HttpSession
getSession()
Get the session.HttpSession
getSession(boolean create)
Get the session.HttpUpgradeHandler
getUpgradeHandler()
Get the upgrade handler.java.security.Principal
getUserPrincipal()
Get the user principal.boolean
isAsyncStarted()
Is async started.boolean
isAsyncSupported()
Is async supported.boolean
isFinished()
Is the Servlet input stream finished?boolean
isReady()
Is the Servlet input stream ready?boolean
isRequestedSessionIdFromCookie()
Is the requested session id from cookie.boolean
isRequestedSessionIdFromUrl()
Deprecated.boolean
isRequestedSessionIdFromURL()
Is the requested session id from the request url.boolean
isRequestedSessionIdValid()
Is the requested session id valid?boolean
isSecure()
Is the request secure.boolean
isUpgraded()
Is the request upgraded.boolean
isUserInRole(java.lang.String role)
Is the user in the specified role.void
login(java.lang.String username, java.lang.String password)
Login.void
logout()
Logout.int
read()
Read from the Servlet input stream.void
removeAttribute(java.lang.String name)
Remove the attribute.void
setAsyncStarted(boolean asyncStarted)
void
setAsyncSupported(boolean asyncSupported)
Set the async supported flag.void
setAttribute(java.lang.String name, java.lang.Object value)
Set the attribute.void
setAuthType(java.lang.String authType)
Set the auth type.void
setCharacterEncoding(java.lang.String characterEncoding)
Set the character encoding.void
setContentLength(int contentLength)
Set the content length.void
setContentType(java.lang.String contentType)
Set the content type.void
setContextPath(java.lang.String contextPath)
Set the context path.void
setCookies(Cookie[] cookies)
Set the cookies.void
setDispatcherType(DispatcherType dispatcherType)
Set the dispatcher type.void
setHeader(java.lang.String name, java.lang.String value)
Set the header.void
setInputStream(java.io.InputStream inputStream)
Set the input stream.void
setLocalAddr(java.lang.String localAddress)
Set the local address.void
setLocalName(java.lang.String localName)
Set the local name.void
setLocalPort(int localPort)
Set the local port.void
setMethod(java.lang.String method)
Set the method.void
setParameter(java.lang.String name, java.lang.String[] values)
Set the parameter values.void
setPathInfo(java.lang.String pathInfo)
Set the path info.void
setProtocol(java.lang.String protocol)
Set the protocol.void
setQueryString(java.lang.String queryString)
Set the query string.void
setReadListener(ReadListener listener)
Set the read listener.void
setRemoteAddr(java.lang.String remoteAddr)
Set the remote address.void
setRemoteHost(java.lang.String remoteHost)
Set the remote host.void
setRemotePort(int remotePort)
Set the remote port.void
setRequestedSessionId(java.lang.String requestedSessionId)
Set the requested session id.void
setRequestedSessionIdFromCookie(boolean requestedSessionIdFromCookie)
Set the requested session id from cookie.void
setRequestedSessionIdFromURL(boolean requestedSessionIdFromURL)
Set the request session id from URL flag.void
setScheme(java.lang.String scheme)
Set the scheme.void
setServerName(java.lang.String serverName)
Set the server name.void
setServerPort(int serverPort)
Set the server port.void
setServletPath(java.lang.String servletPath)
Set the servlet path.void
setUpgraded(boolean upgraded)
Set the upgraded flag.void
setUserPrincipal(java.security.Principal userPrincipal)
Set the user principal.void
setWebApplication(WebApplication webApplication)
Set the web application.AsyncContext
startAsync()
Start async.AsyncContext
startAsync(ServletRequest request, ServletResponse response)
Start async.java.lang.String
toString()
HttpServletRequest
unwrap(HttpServletRequest request)
<T extends HttpUpgradeHandler>
Tupgrade(java.lang.Class<T> handlerClass)
Upgrade the request.protected void
verifyMultipartFormData()
Verify the method is of type "multipart/form-data"Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
-
Field Details
-
authType
protected java.lang.String authTypeStores the auth type. -
asyncContext
Stores the async context. -
asyncStarted
protected boolean asyncStartedStores if async is started. -
asyncSupported
protected boolean asyncSupportedStores if async is supported. -
attributeManager
Stores the attribute manager. -
characterEncoding
protected java.lang.String characterEncodingStores the character encoding. -
contentLength
protected long contentLengthStores the content length. -
contentType
protected java.lang.String contentTypeStores the content type. -
contextPath
protected java.lang.String contextPathStores the context path. -
cookies
Stores the cookies. -
currentSessionId
protected java.lang.String currentSessionIdStores the current session id. -
dispatcherType
Stores the dispatcher type. -
gotInputStream
protected boolean gotInputStreamStores the gotInputStream flag. -
gotReader
protected boolean gotReaderStores the gotReader flag. -
headerManager
Stores the header manager. -
inputStream
protected java.io.InputStream inputStreamStores the input stream. -
localAddress
protected java.lang.String localAddressStores the local address. -
localName
protected java.lang.String localNameStores the local name. -
localPort
protected int localPortStores the local port. -
method
protected java.lang.String methodStores the method. -
parameters
protected java.util.HashMap<java.lang.String,java.lang.String[]> parametersStores the parameters. -
parametersParsed
protected boolean parametersParsedStores the parameters parsed flag. -
pathInfo
protected java.lang.String pathInfoStores the path info. -
protocol
protected java.lang.String protocolStores the protocol. -
queryString
protected java.lang.String queryStringStores the query string. -
reader
protected java.io.BufferedReader readerStores the reader. -
remoteAddr
protected java.lang.String remoteAddrStores the remote address. -
remoteHost
protected java.lang.String remoteHostStores the remote host. -
remotePort
protected int remotePortStores the remote port. -
requestedSessionId
protected java.lang.String requestedSessionIdStores the requested session id. -
requestedSessionIdFromCookie
protected boolean requestedSessionIdFromCookieStores the requested session id from cookie flag. -
requestedSessionIdFromURL
protected boolean requestedSessionIdFromURLStores the requested session id from url flag. -
scheme
protected java.lang.String schemeStores the scheme. -
serverName
protected java.lang.String serverNameStores the server name. -
serverPort
protected int serverPortStores the server port. -
servletPath
protected java.lang.String servletPathStores the servlet path. -
upgraded
protected boolean upgradedStores the upgraded flag. -
upgradeHandler
Stores the upgrade handler. -
userPrincipal
protected java.security.Principal userPrincipalStores the user principal. -
webApplication
Stores the web application
-
-
Constructor Details
-
DefaultWebApplicationRequest
public DefaultWebApplicationRequest()Constructor.
-
-
Method Details
-
authenticate
public boolean authenticate(HttpServletResponse response) throws java.io.IOException, ServletExceptionAuthenticate.- Specified by:
authenticate
in interfaceHttpServletRequest
- Parameters:
response
- the HTTP servlet response.- Returns:
- true if authenticated, false otherwise.
- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
changeSessionId
public java.lang.String changeSessionId()Change the session id.- Specified by:
changeSessionId
in interfaceHttpServletRequest
- Returns:
- the changed session id.
-
getAsyncContext
Get the async context.- Specified by:
getAsyncContext
in interfaceServletRequest
- Returns:
- the async context.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)Get the attribute.- Specified by:
getAttribute
in interfaceServletRequest
- Parameters:
name
- the attribute name.- Returns:
- the value.
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()Get attribute names.- Specified by:
getAttributeNames
in interfaceServletRequest
- Returns:
- the attribute names.
-
getAuthType
public java.lang.String getAuthType()Get the auth type.- Specified by:
getAuthType
in interfaceHttpServletRequest
- Returns:
- the auth type.
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()Get the character encoding.- Specified by:
getCharacterEncoding
in interfaceServletRequest
- Returns:
- the character encoding.
-
getContentLength
public int getContentLength()Get the content length.- Specified by:
getContentLength
in interfaceServletRequest
- Returns:
- the content length.
-
getContentLengthLong
public long getContentLengthLong()Get the content length.- Specified by:
getContentLengthLong
in interfaceServletRequest
- Returns:
- the content length.
-
getContentType
public java.lang.String getContentType()Get the content type.- Specified by:
getContentType
in interfaceServletRequest
- Returns:
- the content type.
-
getContextPath
public java.lang.String getContextPath()Get the context path.- Specified by:
getContextPath
in interfaceHttpServletRequest
- Returns:
- the context path.
-
getCookies
Get the cookies.- Specified by:
getCookies
in interfaceHttpServletRequest
- Returns:
- the cookies.
-
getDateHeader
public long getDateHeader(java.lang.String name)Get the date header.- Specified by:
getDateHeader
in interfaceHttpServletRequest
- Parameters:
name
- the header name.- Returns:
- the date header.
-
getDispatcherType
Get the dispatcher type.- Specified by:
getDispatcherType
in interfaceServletRequest
- Returns:
- the dispatcher type.
-
getHeader
public java.lang.String getHeader(java.lang.String name)Get the header.- Specified by:
getHeader
in interfaceHttpServletRequest
- Parameters:
name
- the header name.- Returns:
- the header value.
-
getHeaderNames
public java.util.Enumeration<java.lang.String> getHeaderNames()Get the header names.- Specified by:
getHeaderNames
in interfaceHttpServletRequest
- Returns:
- the header names.
-
getHeaders
public java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name)Get the headers.- Specified by:
getHeaders
in interfaceHttpServletRequest
- Parameters:
name
- the header name.- Returns:
- the header values.
-
getInputStream
Get the input stream.- Specified by:
getInputStream
in interfaceServletRequest
- Returns:
- the input stream.
- Throws:
java.io.IOException
- when a serious I/O error occurs.
-
getIntHeader
public int getIntHeader(java.lang.String name)Get the int header.- Specified by:
getIntHeader
in interfaceHttpServletRequest
- Parameters:
name
- the name.- Returns:
- the int header.
-
getLocalAddr
public java.lang.String getLocalAddr()Get the local address.- Specified by:
getLocalAddr
in interfaceServletRequest
- Returns:
- the local address.
-
getLocalName
public java.lang.String getLocalName()Get the local name.- Specified by:
getLocalName
in interfaceServletRequest
- Returns:
- the local name.
-
getLocalPort
public int getLocalPort()Get the local port.- Specified by:
getLocalPort
in interfaceServletRequest
- Returns:
- the local port.
-
getLocale
public java.util.Locale getLocale()Get locale.- Specified by:
getLocale
in interfaceServletRequest
- Returns:
- the locale.
-
getLocales
public java.util.Enumeration<java.util.Locale> getLocales()Get the locales.- Specified by:
getLocales
in interfaceServletRequest
- Returns:
- the locales.
-
getMethod
public java.lang.String getMethod()Get the request method.- Specified by:
getMethod
in interfaceHttpServletRequest
- Returns:
- the request method.
-
getParameter
public java.lang.String getParameter(java.lang.String name)Get the parameter.- Specified by:
getParameter
in interfaceServletRequest
- 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
- Returns:
- the parameter map.
-
getParameterNames
public java.util.Enumeration<java.lang.String> getParameterNames()Get the parameter names.- Specified by:
getParameterNames
in interfaceServletRequest
- Returns:
- the parameter names.
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)Get the parameter values.- Specified by:
getParameterValues
in interfaceServletRequest
- Parameters:
name
- the parameter name.- Returns:
- the parameter values.
-
getParametersFromRequest
protected void getParametersFromRequest()Get the parameters from the request. -
getPart
Get the part.- Specified by:
getPart
in interfaceHttpServletRequest
- Parameters:
name
- the name.- Returns:
- the part, or null.
- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a servlet error occurs.
-
getParts
Get the parts.- Specified by:
getParts
in interfaceHttpServletRequest
- Returns:
- the parts.
- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a servlet error occurs.
-
getPathInfo
public java.lang.String getPathInfo()Get the path info.- Specified by:
getPathInfo
in interfaceHttpServletRequest
- Returns:
- the path info.
-
getPathTranslated
public java.lang.String getPathTranslated()Get the translated path.- Specified by:
getPathTranslated
in interfaceHttpServletRequest
- Returns:
- the translated path.
-
getProtocol
public java.lang.String getProtocol()Get the protocol.- Specified by:
getProtocol
in interfaceServletRequest
- Returns:
- the protocol.
-
getQueryString
public java.lang.String getQueryString()Get the query string.- Specified by:
getQueryString
in interfaceHttpServletRequest
- Returns:
- the query string.
-
getReader
public java.io.BufferedReader getReader() throws java.io.IOExceptionGet the reader.- Specified by:
getReader
in interfaceServletRequest
- Returns:
- the reader.
- Throws:
java.io.IOException
- when a serious I/O error occurs.
-
getRealPath
@Deprecated public java.lang.String getRealPath(java.lang.String path)Deprecated.Get the real path.- Specified by:
getRealPath
in interfaceServletRequest
- Parameters:
path
- the path.- Returns:
- the real path.
-
getRemoteAddr
public java.lang.String getRemoteAddr()Get the remote address.- Specified by:
getRemoteAddr
in interfaceServletRequest
- Returns:
- the remote address.
-
getRemoteHost
public java.lang.String getRemoteHost()Get the remote host.- Specified by:
getRemoteHost
in interfaceServletRequest
- Returns:
- the remote host.
-
getRemotePort
public int getRemotePort()Get the remote port.- Specified by:
getRemotePort
in interfaceServletRequest
- Returns:
- the remote port.
-
getRemoteUser
public java.lang.String getRemoteUser()Get the remote user.- Specified by:
getRemoteUser
in interfaceHttpServletRequest
- Returns:
- the remote user.
-
getRequestDispatcher
Get the request dispatcher.- Specified by:
getRequestDispatcher
in interfaceServletRequest
- Parameters:
path
- the path.- Returns:
- the request dispatcher.
-
getRequestURI
public java.lang.String getRequestURI()Get the request URI.- Specified by:
getRequestURI
in interfaceHttpServletRequest
- Returns:
- the request URI.
-
getRequestURL
public java.lang.StringBuffer getRequestURL()Get the request URL.- Specified by:
getRequestURL
in interfaceHttpServletRequest
- Returns:
- the request URL.
-
getRequestedSessionId
public java.lang.String getRequestedSessionId()Get the requested session id.- Specified by:
getRequestedSessionId
in interfaceHttpServletRequest
- Returns:
- the requested session id.
-
getScheme
public java.lang.String getScheme()Get the scheme.- Specified by:
getScheme
in interfaceServletRequest
- Returns:
- the scheme.
-
getServerName
public java.lang.String getServerName()Get the server name.- Specified by:
getServerName
in interfaceServletRequest
- Returns:
- the server name.
-
getServerPort
public int getServerPort()Get the server port.- Specified by:
getServerPort
in interfaceServletRequest
- Returns:
- the server port.
-
getServletContext
Get the servlet context.- Specified by:
getServletContext
in interfaceServletRequest
- Returns:
- the servlet context.
-
getServletPath
public java.lang.String getServletPath()Get the servlet path.- Specified by:
getServletPath
in interfaceHttpServletRequest
- Returns:
- the servlet path.
-
getSession
Get the session.- Specified by:
getSession
in interfaceHttpServletRequest
- Returns:
- the session.
-
getSession
Get the session.- Specified by:
getSession
in interfaceHttpServletRequest
- Parameters:
create
- to create it or not.- Returns:
- the session.
-
getUpgradeHandler
Get the upgrade handler.- Returns:
- the upgrade handler.
-
getUserPrincipal
public java.security.Principal getUserPrincipal()Get the user principal.- Specified by:
getUserPrincipal
in interfaceHttpServletRequest
- Returns:
- the user principal.
-
isAsyncStarted
public boolean isAsyncStarted()Is async started.- Specified by:
isAsyncStarted
in interfaceServletRequest
- Returns:
- is async started.
-
isAsyncSupported
public boolean isAsyncSupported()Is async supported.- Specified by:
isAsyncSupported
in interfaceServletRequest
- Returns:
- true if is async is supported.
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()Is the requested session id from cookie.- Specified by:
isRequestedSessionIdFromCookie
in interfaceHttpServletRequest
- Returns:
- if the requested session id from cookie.
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()Is the requested session id from the request url.- Specified by:
isRequestedSessionIdFromURL
in interfaceHttpServletRequest
- Returns:
- if the requested session id from the request url.
-
isRequestedSessionIdFromUrl
@Deprecated public boolean isRequestedSessionIdFromUrl()Deprecated.Is the requested session id from the request url.- Specified by:
isRequestedSessionIdFromUrl
in interfaceHttpServletRequest
- Returns:
- if the requested session id from the request url.
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()Is the requested session id valid?- Specified by:
isRequestedSessionIdValid
in interfaceHttpServletRequest
- Returns:
- true if it is, false otherwise.
-
isSecure
public boolean isSecure()Is the request secure.- Specified by:
isSecure
in interfaceServletRequest
- Returns:
- is the request secure.
-
isUpgraded
public boolean isUpgraded()Is the request upgraded.- Returns:
- false
-
isUserInRole
public boolean isUserInRole(java.lang.String role)Is the user in the specified role.- Specified by:
isUserInRole
in interfaceHttpServletRequest
- Parameters:
role
- the role.- Returns:
- if the user in the specified role.
-
login
Login.- Specified by:
login
in interfaceHttpServletRequest
- Parameters:
username
- the username.password
- the password.- Throws:
ServletException
- when a serious error occurs.
-
logout
Logout.- Specified by:
logout
in interfaceHttpServletRequest
- Throws:
ServletException
- when a serious error occurs.
-
removeAttribute
public void removeAttribute(java.lang.String name)Remove the attribute.- Specified by:
removeAttribute
in interfaceServletRequest
- Parameters:
name
- the name.
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported)Set the async supported flag.- Parameters:
asyncSupported
- the async supported flag.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Set the attribute.- Specified by:
setAttribute
in interfaceServletRequest
- Parameters:
name
- the name.value
- the value.
-
setAuthType
public void setAuthType(java.lang.String authType)Set the auth type.- Parameters:
authType
- the auth type.
-
setCharacterEncoding
public void setCharacterEncoding(java.lang.String characterEncoding) throws java.io.UnsupportedEncodingExceptionSet the character encoding.- Specified by:
setCharacterEncoding
in interfaceServletRequest
- Parameters:
characterEncoding
- the character encoding.- Throws:
java.io.UnsupportedEncodingException
- when the encoding is not supported.
-
setContentLength
public void setContentLength(int contentLength)Set the content length.- Parameters:
contentLength
- the content length.
-
setContentType
public void setContentType(java.lang.String contentType)Set the content type.- Parameters:
contentType
- the content type.
-
setContextPath
public void setContextPath(java.lang.String contextPath)Set the context path.- Parameters:
contextPath
- the context path.
-
setCookies
Set the cookies.- Parameters:
cookies
- the cookies.
-
setDispatcherType
Set the dispatcher type.- Specified by:
setDispatcherType
in interfaceWebApplicationRequest
- Parameters:
dispatcherType
- the dispatcher type.
-
setHeader
public void setHeader(java.lang.String name, java.lang.String value)Set the header.- Parameters:
name
- the name.value
- the value (string).
-
setInputStream
public void setInputStream(java.io.InputStream inputStream)Set the input stream.- Parameters:
inputStream
- the input stream.
-
setLocalAddr
public void setLocalAddr(java.lang.String localAddress)Set the local address.- Parameters:
localAddress
- the local address.
-
setLocalName
public void setLocalName(java.lang.String localName)Set the local name.- Parameters:
localName
- the local name.
-
setLocalPort
public void setLocalPort(int localPort)Set the local port.- Parameters:
localPort
- the local port.
-
setMethod
public void setMethod(java.lang.String method)Set the method.- Parameters:
method
- the method.
-
setParameter
public void setParameter(java.lang.String name, java.lang.String[] values)Set the parameter values.- Parameters:
name
- the parameter name.values
- the values.
-
setPathInfo
public void setPathInfo(java.lang.String pathInfo)Set the path info.- Parameters:
pathInfo
- the path info.
-
setProtocol
public void setProtocol(java.lang.String protocol)Set the protocol.- Parameters:
protocol
- the protocol.
-
setQueryString
public void setQueryString(java.lang.String queryString)Set the query string.- Parameters:
queryString
- the query string.
-
setRemoteAddr
public void setRemoteAddr(java.lang.String remoteAddr)Set the remote address.- Parameters:
remoteAddr
- the remote address.
-
setRemoteHost
public void setRemoteHost(java.lang.String remoteHost)Set the remote host.- Parameters:
remoteHost
- the remote host.
-
setRemotePort
public void setRemotePort(int remotePort)Set the remote port.- Parameters:
remotePort
- the remote port.
-
setRequestedSessionId
public void setRequestedSessionId(java.lang.String requestedSessionId)Set the requested session id.- Parameters:
requestedSessionId
- the requested session id.
-
setRequestedSessionIdFromCookie
public void setRequestedSessionIdFromCookie(boolean requestedSessionIdFromCookie)Set the requested session id from cookie.- Parameters:
requestedSessionIdFromCookie
- the requested session id from cookie.
-
setRequestedSessionIdFromURL
public void setRequestedSessionIdFromURL(boolean requestedSessionIdFromURL)Set the request session id from URL flag.- Parameters:
requestedSessionIdFromURL
- the requested session if from URL flag.
-
setScheme
public void setScheme(java.lang.String scheme)Set the scheme.- Parameters:
scheme
- the scheme.
-
setServerName
public void setServerName(java.lang.String serverName)Set the server name.- Parameters:
serverName
- the server name.
-
setServerPort
public void setServerPort(int serverPort)Set the server port.- Parameters:
serverPort
- the server port.
-
setServletPath
public void setServletPath(java.lang.String servletPath)Set the servlet path.- Parameters:
servletPath
- the servlet path.
-
setUpgraded
public void setUpgraded(boolean upgraded)Set the upgraded flag.- Parameters:
upgraded
- the upgraded flag.
-
setUserPrincipal
public void setUserPrincipal(java.security.Principal userPrincipal)Set the user principal.- Parameters:
userPrincipal
- the user principal.
-
setWebApplication
Set the web application.- Parameters:
webApplication
- the web application.
-
startAsync
Start async.- Specified by:
startAsync
in interfaceServletRequest
- Returns:
- the async context.
- Throws:
java.lang.IllegalStateException
- when async is not supported.
-
unwrap
-
setAsyncStarted
public void setAsyncStarted(boolean asyncStarted) -
startAsync
public AsyncContext startAsync(ServletRequest request, ServletResponse response) throws java.lang.IllegalStateExceptionStart async.- Specified by:
startAsync
in interfaceServletRequest
- Parameters:
request
- the request.response
- the response.- Returns:
- the async context.
- Throws:
java.lang.IllegalStateException
- when async is not supported.
-
upgrade
public <T extends HttpUpgradeHandler> T upgrade(java.lang.Class<T> handlerClass) throws java.io.IOException, ServletExceptionUpgrade the request.- Specified by:
upgrade
in interfaceHttpServletRequest
- Type Parameters:
T
- the type.- Parameters:
handlerClass
- the handler class.- Returns:
- the upgrade handler.
- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a serious error occurs.
-
verifyMultipartFormData
Verify the method is of type "multipart/form-data"- Throws:
ServletException
- the exception thrown when it is not.
-
isFinished
public boolean isFinished()Is the Servlet input stream finished?- Specified by:
isFinished
in classServletInputStream
- Returns:
- true if it is, false otherwise.
-
isReady
public boolean isReady()Is the Servlet input stream ready?- Specified by:
isReady
in classServletInputStream
- Returns:
- true if it is, false otherwise.
-
setReadListener
Set the read listener.- Specified by:
setReadListener
in classServletInputStream
- Parameters:
listener
- the read listener.
-
read
public int read() throws java.io.IOExceptionRead from the Servlet input stream.- Specified by:
read
in classjava.io.InputStream
- Returns:
- the read value.
- Throws:
java.io.IOException
- when an I/O error occurs.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getRequestURIWithQueryString
public java.lang.String getRequestURIWithQueryString()
-