Package org.apache.xmlrpc.webserver
Class HttpServletRequestImpl
java.lang.Object
org.apache.xmlrpc.webserver.HttpServletRequestImpl
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest
Stub implementation of a
HttpServletRequest
with lots of unimplemented methods. I implemented only those, which
are required for testing the XmlRpcServlet.
Perhaps someone else is adding more at a later time?-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Mapprivate Stringprivate intprivate final Mapprivate Stringprivate final javax.servlet.ServletInputStreamprivate Stringprivate Mapprivate final Mapprivate booleanprivate Stringprivate Stringprivate BufferedReaderprivate javax.servlet.ServletInputStreamprivate final Socketprivate StringFields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
ConstructorsConstructorDescriptionHttpServletRequestImpl(Socket pSocket) Creates a new instance, which reads input from the given socket. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate voidaddParameter(Map pParams, String pKey, String pValue) booleanauthenticate(javax.servlet.http.HttpServletResponse response) javax.servlet.AsyncContextgetAttribute(String pKey) intlongjavax.servlet.http.Cookie[]longgetDateHeader(String arg0) javax.servlet.DispatcherTypegetHeaders(String pHeader) protected Stringjavax.servlet.ServletInputStreamintgetIntHeader(String pHeader) intgetParameter(String pName) String[]getParameterValues(String pName) javax.servlet.http.PartgetParts()getRealPath(String pPath) intjavax.servlet.RequestDispatchergetRequestDispatcher(String pUri) intjavax.servlet.ServletContextjavax.servlet.http.HttpSessionjavax.servlet.http.HttpSessiongetSession(boolean pCreate) booleanbooleanbooleanbooleanbooleanbooleanbooleanisSecure()booleanisUserInRole(String pRole) voidvoidlogout()private voidparseParameter(Map pParams, String pParam, String pEncoding) protected voidprivate voidparsePostData(Map pParams, InputStream pStream, String pEncoding) private voidparseQueryString(Map pParams, String pQueryString, String pEncoding) voidRead the header lines, one by one.protected StringreadLine(byte[] pBuffer) voidremoveAttribute(String pKey) voidsetAttribute(String pKey, Object pValue) voidsetCharacterEncoding(String pEncoding) javax.servlet.AsyncContextjavax.servlet.AsyncContextstartAsync(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) javax.servlet.http.HttpUpgradeHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
-
Field Details
-
socket
-
istream
private final javax.servlet.ServletInputStream istream -
sistream
private javax.servlet.ServletInputStream sistream -
reader
-
postParametersParsed
private boolean postParametersParsed -
method
-
protocol
-
uri
-
queryString
-
httpVersion
-
headers
-
parts
-
attributes
-
parameters
-
characterEncoding
-
contentBytesRemaining
private int contentBytesRemaining
-
-
Constructor Details
-
HttpServletRequestImpl
Creates a new instance, which reads input from the given socket.- Parameters:
pSocket- The socket, to which the client is connected.- Throws:
IOException- Accessing the sockets input stream failed.
-
-
Method Details
-
readHttpHeaders
Read the header lines, one by one. Note, that the size of the buffer is a limitation of the maximum header length! -
readLine
- Throws:
IOException
-
addHeader
-
getAuthType
- Specified by:
getAuthTypein interfacejavax.servlet.http.HttpServletRequest
-
getContextPath
- Specified by:
getContextPathin interfacejavax.servlet.http.HttpServletRequest
-
getCookies
public 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
-
getHeaderNames
- Specified by:
getHeaderNamesin interfacejavax.servlet.http.HttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfacejavax.servlet.http.HttpServletRequest
-
getPart
- Specified by:
getPartin interfacejavax.servlet.http.HttpServletRequest
-
getParts
- Specified by:
getPartsin interfacejavax.servlet.http.HttpServletRequest
-
authenticate
public boolean authenticate(javax.servlet.http.HttpServletResponse response) - Specified by:
authenticatein 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
-
getQueryString
- Specified by:
getQueryStringin interfacejavax.servlet.http.HttpServletRequest
-
getRemoteUser
- Specified by:
getRemoteUserin interfacejavax.servlet.http.HttpServletRequest
-
login
- Specified by:
loginin interfacejavax.servlet.http.HttpServletRequest
-
logout
public void logout()- Specified by:
logoutin interfacejavax.servlet.http.HttpServletRequest
-
getRequestURI
- Specified by:
getRequestURIin interfacejavax.servlet.http.HttpServletRequest
-
getRequestURL
- Specified by:
getRequestURLin interfacejavax.servlet.http.HttpServletRequest
-
getAsyncContext
public javax.servlet.AsyncContext getAsyncContext()- Specified by:
getAsyncContextin interfacejavax.servlet.ServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfacejavax.servlet.ServletRequest
-
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfacejavax.servlet.ServletRequest
-
getServletContext
public javax.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfacejavax.servlet.ServletRequest
-
startAsync
public javax.servlet.AsyncContext startAsync(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) - Specified by:
startAsyncin interfacejavax.servlet.ServletRequest
-
startAsync
public javax.servlet.AsyncContext startAsync()- Specified by:
startAsyncin interfacejavax.servlet.ServletRequest
-
getDispatcherType
public javax.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherTypein interfacejavax.servlet.ServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionIdin interfacejavax.servlet.http.HttpServletRequest
-
getServletPath
- Specified by:
getServletPathin interfacejavax.servlet.http.HttpServletRequest
-
getSession
public javax.servlet.http.HttpSession getSession()- Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
-
getSession
public javax.servlet.http.HttpSession getSession(boolean pCreate) - Specified by:
getSessionin interfacejavax.servlet.http.HttpServletRequest
-
getUserPrincipal
- Specified by:
getUserPrincipalin 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
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValidin interfacejavax.servlet.http.HttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfacejavax.servlet.http.HttpServletRequest
-
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
-
getContentLength
public int getContentLength()- Specified by:
getContentLengthin interfacejavax.servlet.ServletRequest
-
getContentType
- Specified by:
getContentTypein interfacejavax.servlet.ServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfacejavax.servlet.ServletRequest- Throws:
IOException
-
getLocale
- Specified by:
getLocalein interfacejavax.servlet.ServletRequest
-
getLocales
- Specified by:
getLocalesin interfacejavax.servlet.ServletRequest
-
addParameter
-
parseQueryString
private void parseQueryString(Map pParams, String pQueryString, String pEncoding) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
parseParameter
private void parseParameter(Map pParams, String pParam, String pEncoding) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
parsePostData
- Throws:
IOException
-
parseParameters
protected void parseParameters() -
getParameter
- Specified by:
getParameterin interfacejavax.servlet.ServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfacejavax.servlet.ServletRequest
-
getParameterNames
- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest
-
getProtocol
- Specified by:
getProtocolin interfacejavax.servlet.ServletRequest
-
getReader
- Specified by:
getReaderin interfacejavax.servlet.ServletRequest- Throws:
IOException
-
getRealPath
- Specified by:
getRealPathin interfacejavax.servlet.ServletRequest
-
getLocalAddr
- Specified by:
getLocalAddrin interfacejavax.servlet.ServletRequest
-
getLocalName
- Specified by:
getLocalNamein interfacejavax.servlet.ServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPortin interfacejavax.servlet.ServletRequest
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfacejavax.servlet.ServletRequest
-
getRemoteHost
- Specified by:
getRemoteHostin interfacejavax.servlet.ServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePortin interfacejavax.servlet.ServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin 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
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfacejavax.servlet.ServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfacejavax.servlet.ServletRequest
-
setAttribute
- Specified by:
setAttributein interfacejavax.servlet.ServletRequest
-
getHttpVersion
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLongin interfacejavax.servlet.ServletRequest
-
changeSessionId
- Specified by:
changeSessionIdin interfacejavax.servlet.http.HttpServletRequest
-
upgrade
- Specified by:
upgradein interfacejavax.servlet.http.HttpServletRequest
-