public class RequestAdapter extends RequestWrapper implements CauchoRequest
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JSP_EXCEPTION |
static java.lang.String |
SHUTDOWN |
_request
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Modifier | Constructor and Description |
---|---|
protected |
RequestAdapter() |
protected |
RequestAdapter(HttpServletRequest request,
WebApp app) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(HttpServletResponse response) |
void |
clientDisconnect() |
static RequestAdapter |
create()
Creates a new RequestAdapter.
|
static RequestAdapter |
create(HttpServletRequest request,
WebApp app)
Creates a new RequestAdapter.
|
protected void |
free()
Clears the adapter.
|
static void |
free(RequestAdapter reqAdapt)
Frees the adapter for reuse.
|
AbstractHttpRequest |
getAbstractHttpRequest() |
CauchoRequest |
getCauchoRequest() |
Cookie |
getCookie(java.lang.String name) |
protected java.lang.String |
getCookieName(SessionManager manager) |
Cookie[] |
getCookies()
Returns an array of all cookies sent by the client.
|
boolean |
getHasCookie() |
HttpSession |
getMemorySession() |
java.lang.String |
getPageContextPath() |
static java.lang.String |
getPageContextPath(HttpServletRequest request) |
java.lang.String |
getPagePathInfo()
Returns the path-info for the current page, i.e.
|
static java.lang.String |
getPagePathInfo(HttpServletRequest request)
Returns the path-info for the current page, i.e.
|
java.lang.String |
getPageQueryString()
Returns the query-string for the current page, i.e.
|
static java.lang.String |
getPageQueryString(HttpServletRequest request)
Returns the query-string for the current page, i.e.
|
java.lang.String |
getPageServletPath()
Returns the servlet-path for the current page, i.e.
|
static java.lang.String |
getPageServletPath(HttpServletRequest request)
Returns the servlet-path for the current page, i.e.
|
java.lang.String |
getPageURI()
Returns the URI for the current page: included or top-level.
|
static java.lang.String |
getPageURI(HttpServletRequest request) |
Part |
getPart(java.lang.String name) |
java.util.Collection<Part> |
getParts() |
int |
getRequestDepth(int depth) |
java.lang.String |
getRequestedSessionId()
Returns the session id.
|
protected HttpServletResponse |
getResponse() |
HttpSession |
getSession(boolean create)
Returns a session.
|
java.lang.String |
getSessionId() |
protected SessionManager |
getSessionManager() |
SocketLink |
getSocketLink() |
ReadStream |
getStream()
Returns the underlying read stream.
|
boolean |
getVaryCookies() |
WebApp |
getWebApp() |
boolean |
hasRequest() |
void |
init(HttpServletRequest request,
HttpServletResponse response,
WebApp app) |
boolean |
isComet() |
boolean |
isConnectionClosed() |
boolean |
isDuplex() |
boolean |
isLoginRequested() |
boolean |
isMultipartEnabled() |
boolean |
isRequestedSessionIdFromCookie()
Returns true if the session came from a cookie.
|
boolean |
isRequestedSessionIdFromURL()
Returns true if the session came URL-encoding.
|
boolean |
isRequestedSessionIdValid()
Returns true if the session is valid.
|
boolean |
isSessionIdFromCookie() |
boolean |
isSuspend() |
boolean |
isSyntheticCacheHeader() |
boolean |
isTop() |
boolean |
isUserInRole(java.lang.String role)
Checks the isUserInRole.
|
void |
killKeepalive(java.lang.String reason) |
boolean |
login(boolean isFail) |
void |
login(java.lang.String username,
java.lang.String password) |
void |
logout() |
void |
requestLogin() |
void |
setHasCookie() |
void |
setHeader(java.lang.String key,
java.lang.String value) |
void |
setResponse(CauchoResponse response) |
java.util.HashMap<java.lang.String,java.lang.String> |
setRoleMap(java.util.HashMap<java.lang.String,java.lang.String> map)
Sets the role map.
|
void |
setSessionId(java.lang.String sessionId) |
void |
setSyntheticCacheHeader(boolean isSynthetic) |
void |
setVaryCookie(java.lang.String cookie) |
void |
setWebApp(WebApp app) |
java.lang.String |
toString() |
addAsyncListener, addAsyncListener, complete, getAsyncContext, getAttribute, getAttributeNames, getAuthType, getCharacterEncoding, getContentLength, getContentType, getContextPath, getDateHeader, getDispatcherType, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getMethod, getParameter, getParameterMap, getParameterNames, getParameterValues, getPathInfo, getPathTranslated, getProtocol, getQueryString, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRemoteUser, getRequest, getRequestDispatcher, getRequestURI, getRequestURL, getScheme, getServerName, getServerPort, getServletContext, getServletPath, getServletResponse, getSession, getUserPrincipal, isAsyncStarted, isAsyncSupported, isInitial, isRequestedSessionIdFromUrl, isResumed, isSecure, isSuspended, isTimeout, removeAttribute, resume, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync, suspend, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServletResponse
getAuthType, getContextPath, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestURI, getRequestURL, getServletPath, getSession, getUserPrincipal, isRequestedSessionIdFromUrl
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
public static java.lang.String JSP_EXCEPTION
public static java.lang.String SHUTDOWN
protected RequestAdapter()
protected RequestAdapter(HttpServletRequest request, WebApp app)
public static RequestAdapter create(HttpServletRequest request, WebApp app)
public static RequestAdapter create()
public void init(HttpServletRequest request, HttpServletResponse response, WebApp app) throws ServletException
ServletException
public boolean isTop()
isTop
in interface CauchoRequest
public void setWebApp(WebApp app)
public AbstractHttpRequest getAbstractHttpRequest()
getAbstractHttpRequest
in interface CauchoRequest
protected HttpServletResponse getResponse()
public void setResponse(CauchoResponse response)
public ReadStream getStream() throws java.io.IOException
getStream
in interface CauchoRequest
java.io.IOException
public java.lang.String getPageURI()
getPageURI
in interface CauchoRequest
public static java.lang.String getPageURI(HttpServletRequest request)
public java.lang.String getPageContextPath()
getPageContextPath
in interface CauchoRequest
public static java.lang.String getPageContextPath(HttpServletRequest request)
public java.lang.String getPageServletPath()
getPageServletPath
in interface CauchoRequest
public static java.lang.String getPageServletPath(HttpServletRequest request)
public java.lang.String getPagePathInfo()
getPagePathInfo
in interface CauchoRequest
public static java.lang.String getPagePathInfo(HttpServletRequest request)
public java.lang.String getPageQueryString()
getPageQueryString
in interface CauchoRequest
public static java.lang.String getPageQueryString(HttpServletRequest request)
public int getRequestDepth(int depth)
getRequestDepth
in interface CauchoRequest
public void setHeader(java.lang.String key, java.lang.String value)
setHeader
in interface CauchoRequest
public void setSyntheticCacheHeader(boolean isSynthetic)
setSyntheticCacheHeader
in interface CauchoRequest
public boolean isSyntheticCacheHeader()
isSyntheticCacheHeader
in interface CauchoRequest
public WebApp getWebApp()
getWebApp
in interface CauchoRequest
public void setVaryCookie(java.lang.String cookie)
setVaryCookie
in interface CauchoRequest
public boolean getVaryCookies()
getVaryCookies
in interface CauchoRequest
public void setHasCookie()
setHasCookie
in interface CauchoRequest
public boolean getHasCookie()
getHasCookie
in interface CauchoRequest
public HttpSession getMemorySession()
getMemorySession
in interface CauchoRequest
public HttpSession getSession(boolean create)
RequestWrapper
getSession
in interface HttpServletRequest
getSession
in class RequestWrapper
create
- If true, then create a new session if none exists.public java.lang.String getRequestedSessionId()
RequestWrapper
getRequestedSessionId
in interface HttpServletRequest
getRequestedSessionId
in class RequestWrapper
public boolean isRequestedSessionIdValid()
RequestWrapper
isRequestedSessionIdValid
in interface HttpServletRequest
isRequestedSessionIdValid
in class RequestWrapper
public boolean isRequestedSessionIdFromCookie()
RequestWrapper
isRequestedSessionIdFromCookie
in interface HttpServletRequest
isRequestedSessionIdFromCookie
in class RequestWrapper
public boolean isRequestedSessionIdFromURL()
RequestWrapper
isRequestedSessionIdFromURL
in interface HttpServletRequest
isRequestedSessionIdFromURL
in class RequestWrapper
public boolean isSessionIdFromCookie()
isSessionIdFromCookie
in interface CauchoRequest
public java.lang.String getSessionId()
getSessionId
in interface CauchoRequest
public void setSessionId(java.lang.String sessionId)
setSessionId
in interface CauchoRequest
protected final SessionManager getSessionManager()
protected final java.lang.String getCookieName(SessionManager manager)
public Cookie[] getCookies()
RequestWrapper
getCookies
in interface HttpServletRequest
getCookies
in class RequestWrapper
public Cookie getCookie(java.lang.String name)
getCookie
in interface CauchoRequest
public boolean isComet()
isComet
in interface CauchoRequest
public boolean isDuplex()
isDuplex
in interface CauchoRequest
public void killKeepalive(java.lang.String reason)
killKeepalive
in interface CauchoRequest
public SocketLink getSocketLink()
getSocketLink
in interface CauchoRequest
public boolean isConnectionClosed()
isConnectionClosed
in interface CauchoRequest
public void clientDisconnect()
public java.util.HashMap<java.lang.String,java.lang.String> setRoleMap(java.util.HashMap<java.lang.String,java.lang.String> map)
public boolean isUserInRole(java.lang.String role)
isUserInRole
in interface HttpServletRequest
isUserInRole
in class RequestWrapper
public boolean isLoginRequested()
isLoginRequested
in interface CauchoRequest
public void requestLogin()
requestLogin
in interface CauchoRequest
public boolean login(boolean isFail)
login
in interface CauchoRequest
public boolean isSuspend()
isSuspend
in interface CauchoRequest
public boolean hasRequest()
hasRequest
in interface CauchoRequest
public boolean authenticate(HttpServletResponse response) throws java.io.IOException, ServletException
authenticate
in interface HttpServletRequest
java.io.IOException
ServletException
public Part getPart(java.lang.String name) throws java.io.IOException, ServletException
getPart
in interface HttpServletRequest
java.io.IOException
ServletException
public java.util.Collection<Part> getParts() throws java.io.IOException, ServletException
getParts
in interface HttpServletRequest
java.io.IOException
ServletException
public boolean isMultipartEnabled()
isMultipartEnabled
in interface CauchoRequest
public void login(java.lang.String username, java.lang.String password) throws ServletException
login
in interface HttpServletRequest
ServletException
public void logout() throws ServletException
logout
in interface HttpServletRequest
ServletException
public CauchoRequest getCauchoRequest()
public static void free(RequestAdapter reqAdapt)
protected void free()
free
in class RequestWrapper
public java.lang.String toString()
toString
in class java.lang.Object