Package org.apache.openejb.server.httpd
Class HttpRequestImpl
java.lang.Object
org.apache.openejb.server.httpd.HttpRequestImpl
- All Implemented Interfaces:
jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletRequest,Serializable,HttpRequest
A class to take care of HTTP Requests. It parses headers, content, form and url
parameters.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.openejb.server.httpd.HttpRequest
HttpRequest.Method -
Field Summary
FieldsFields inherited from interface org.apache.openejb.server.httpd.HttpRequest
HEADER_ACCEPT, HEADER_ACCEPT_ENCODING, HEADER_ACCEPT_LANGUAGE, HEADER_CACHE_CONTROL, HEADER_CONNECTION, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, HEADER_HOST, HEADER_SET_COOKIE, HEADER_USER_AGENT, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSEFields inherited from interface jakarta.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInternalParameter(String key, String val) voidaddQueryParams(String query) booleanauthenticate(jakarta.servlet.http.HttpServletResponse httpServletResponse) voiddestroy()jakarta.servlet.AsyncContextgetAttribute(String name) intlongprotected Stringjakarta.servlet.http.Cookie[]longjakarta.servlet.DispatcherTypegetFormParameter(String name) Gets a form parameter based on the name passed in.Gets a header based the header name passed in.getHeaders(String s) jakarta.servlet.ServletInputStreamprotected Map<?,?> intintGets the request method.getParameter(String name) Gets a form or URL query parameter based on the name passed in.Deprecated.String[]jakarta.servlet.http.PartCollection<jakarta.servlet.http.Part>getParts()intjakarta.servlet.RequestDispatcherintjakarta.servlet.ServletConnectionjakarta.servlet.ServletContextgetSession(boolean create) protected URIgetURI()Gets the URI for the current URL page.voidinit()voidinitPathFromContext(String context) voidinitServletPath(String servlet) booleanbooleanbooleanbooleanbooleanbooleanisSecure()booleanvoidvoidlogout()voidvoidparseURI(StringTokenizer lineParts) parses the URI into the different partsvoidprotected booleanreadMessage(InputStream input) parses the request into the 3 different parts, request, headers, and bodyvoidvoidsetApplication(WebContext app) voidsetAttribute(String name, Object value) voidvoidvoidvoidvoidjakarta.servlet.AsyncContextjakarta.servlet.AsyncContextstartAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) <T extends jakarta.servlet.http.HttpUpgradeHandler>
TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.http.HttpServletRequest
getHttpServletMapping, getTrailerFields, isTrailerFieldsReady, newPushBuilder
-
Field Details
-
SERVLET_CONTEXT_INTERFACES
-
SERVLET_CONTEXT_HANDLER
-
-
Constructor Details
-
HttpRequestImpl
-
-
Method Details
-
setUri
-
getHeader
Gets a header based the header name passed in.- Specified by:
getHeaderin interfacejakarta.servlet.http.HttpServletRequest- Parameters:
name- The name of the header to get- Returns:
- The value of the header
-
getHeaderNames
- Specified by:
getHeaderNamesin interfacejakarta.servlet.http.HttpServletRequest
-
getHeaders
- Specified by:
getHeadersin interfacejakarta.servlet.http.HttpServletRequest
-
getIntHeader
- Specified by:
getIntHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getFormParameter
Gets a form parameter based on the name passed in.- Parameters:
name- The name of the form parameter to get- Returns:
- The value of the parameter
-
getFormParameters
-
getMethod
Gets the request method.- Specified by:
getMethodin interfacejakarta.servlet.http.HttpServletRequest- Returns:
- the request method
-
getPart
public jakarta.servlet.http.Part getPart(String s) throws IOException, jakarta.servlet.ServletException - Specified by:
getPartin interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
upgrade
public <T extends jakarta.servlet.http.HttpUpgradeHandler> T upgrade(Class<T> httpUpgradeHandlerClass) throws IOException, jakarta.servlet.ServletException - Specified by:
upgradein interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
getParts
public Collection<jakarta.servlet.http.Part> getParts() throws IOException, jakarta.servlet.ServletException- Specified by:
getPartsin interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
noPathInfo
public void noPathInfo() -
getPathInfo
- Specified by:
getPathInfoin interfacejakarta.servlet.http.HttpServletRequest
-
getPathTranslated
- Specified by:
getPathTranslatedin interfacejakarta.servlet.http.HttpServletRequest
-
getQueryString
- Specified by:
getQueryStringin interfacejakarta.servlet.http.HttpServletRequest
-
getRemoteUser
- Specified by:
getRemoteUserin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestedSessionId
- Specified by:
getRequestedSessionIdin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURI
- Specified by:
getRequestURIin interfacejakarta.servlet.http.HttpServletRequest
-
getRequestURL
- Specified by:
getRequestURLin interfacejakarta.servlet.http.HttpServletRequest
-
getServletPath
- Specified by:
getServletPathin interfacejakarta.servlet.http.HttpServletRequest
-
initServletPath
-
addQueryParams
-
getURI
Gets the URI for the current URL page.- Specified by:
getURIin interfaceHttpRequest- Returns:
- the URI
-
getContentLength
public int getContentLength()- Specified by:
getContentLengthin interfaceHttpRequest- Specified by:
getContentLengthin interfacejakarta.servlet.ServletRequest
-
getContentLengthLong
public long getContentLengthLong()- Specified by:
getContentLengthLongin interfacejakarta.servlet.ServletRequest
-
getContentType
- Specified by:
getContentTypein interfaceHttpRequest- Specified by:
getContentTypein interfacejakarta.servlet.ServletRequest
-
getDispatcherType
public jakarta.servlet.DispatcherType getDispatcherType()- Specified by:
getDispatcherTypein interfacejakarta.servlet.ServletRequest
-
getRequestId
- Specified by:
getRequestIdin interfacejakarta.servlet.ServletRequest
-
getProtocolRequestId
- Specified by:
getProtocolRequestIdin interfacejakarta.servlet.ServletRequest
-
getServletConnection
public jakarta.servlet.ServletConnection getServletConnection()- Specified by:
getServletConnectionin interfacejakarta.servlet.ServletRequest
-
getInputStream
- Specified by:
getInputStreamin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getLocalAddr
- Specified by:
getLocalAddrin interfacejakarta.servlet.ServletRequest
-
getLocale
- Specified by:
getLocalein interfacejakarta.servlet.ServletRequest
-
getLocales
- Specified by:
getLocalesin interfacejakarta.servlet.ServletRequest
-
getLocalName
- Specified by:
getLocalNamein interfacejakarta.servlet.ServletRequest
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPortin interfacejakarta.servlet.ServletRequest
-
readMessage
parses the request into the 3 different parts, request, headers, and body- Parameters:
input- the data input for this page- Throws:
IOException- if an exception is thrown
-
print
-
parseURI
parses the URI into the different parts- Parameters:
lineParts- a StringTokenizer of the URI- Throws:
IOException- if an exeption is thrown
-
authenticate
public boolean authenticate(jakarta.servlet.http.HttpServletResponse httpServletResponse) throws IOException, jakarta.servlet.ServletException - Specified by:
authenticatein interfacejakarta.servlet.http.HttpServletRequest- Throws:
IOExceptionjakarta.servlet.ServletException
-
getAuthType
- Specified by:
getAuthTypein interfacejakarta.servlet.http.HttpServletRequest
-
getContextPath
- Specified by:
getContextPathin interfacejakarta.servlet.http.HttpServletRequest
-
extractContextPath
-
getCookies
public jakarta.servlet.http.Cookie[] getCookies()- Specified by:
getCookiesin interfacejakarta.servlet.http.HttpServletRequest
-
getInternalCookies
-
getDateHeader
- Specified by:
getDateHeaderin interfacejakarta.servlet.http.HttpServletRequest
-
getCookie
-
getSession
- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
getSocketURI
-
getUserPrincipal
- Specified by:
getUserPrincipalin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()- Specified by:
isRequestedSessionIdFromCookiein interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()- Specified by:
isRequestedSessionIdFromURLin interfacejakarta.servlet.http.HttpServletRequest
-
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()- Specified by:
isRequestedSessionIdValidin interfacejakarta.servlet.http.HttpServletRequest
-
isUserInRole
- Specified by:
isUserInRolein interfacejakarta.servlet.http.HttpServletRequest
-
login
- Specified by:
loginin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
logout
public void logout() throws jakarta.servlet.ServletException- Specified by:
logoutin interfacejakarta.servlet.http.HttpServletRequest- Throws:
jakarta.servlet.ServletException
-
getSession
- Specified by:
getSessionin interfacejakarta.servlet.http.HttpServletRequest
-
changeSessionId
- Specified by:
changeSessionIdin interfacejakarta.servlet.http.HttpServletRequest
-
getAsyncContext
public jakarta.servlet.AsyncContext getAsyncContext()- Specified by:
getAsyncContextin interfacejakarta.servlet.ServletRequest
-
getAttribute
- Specified by:
getAttributein interfaceHttpRequest- Specified by:
getAttributein interfacejakarta.servlet.ServletRequest
-
getAttributeNames
- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletRequest
-
getCharacterEncoding
- Specified by:
getCharacterEncodingin interfacejakarta.servlet.ServletRequest
-
setAttribute
- Specified by:
setAttributein interfaceHttpRequest- Specified by:
setAttributein interfacejakarta.servlet.ServletRequest
-
setCharacterEncoding
- Specified by:
setCharacterEncodingin interfacejakarta.servlet.ServletRequest- Throws:
UnsupportedEncodingException
-
startAsync
public jakarta.servlet.AsyncContext startAsync()- Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest
-
startAsync
public jakarta.servlet.AsyncContext startAsync(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse) - Specified by:
startAsyncin interfacejakarta.servlet.ServletRequest
-
addInternalParameter
-
getParameter
Description copied from interface:HttpRequestGets a form or URL query parameter based on the name passed in.- Specified by:
getParameterin interfaceHttpRequest- Specified by:
getParameterin interfacejakarta.servlet.ServletRequest
-
getParameterMap
- Specified by:
getParameterMapin interfacejakarta.servlet.ServletRequest
-
getParameterNames
- Specified by:
getParameterNamesin interfacejakarta.servlet.ServletRequest
-
getParameterValues
- Specified by:
getParameterValuesin interfacejakarta.servlet.ServletRequest
-
getProtocol
- Specified by:
getProtocolin interfacejakarta.servlet.ServletRequest
-
getReader
- Specified by:
getReaderin interfacejakarta.servlet.ServletRequest- Throws:
IOException
-
getParameters
Deprecated.Description copied from interface:HttpRequestGets all the form and URL query parameters- Specified by:
getParametersin interfaceHttpRequest- Returns:
- All the form and URL query parameters
-
getRemoteAddr
- Specified by:
getRemoteAddrin interfaceHttpRequest- Specified by:
getRemoteAddrin interfacejakarta.servlet.ServletRequest
-
getRemoteHost
- Specified by:
getRemoteHostin interfacejakarta.servlet.ServletRequest
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePortin interfacejakarta.servlet.ServletRequest
-
getRequestDispatcher
- Specified by:
getRequestDispatcherin interfacejakarta.servlet.ServletRequest
-
getScheme
- Specified by:
getSchemein interfacejakarta.servlet.ServletRequest
-
getServerName
- Specified by:
getServerNamein interfacejakarta.servlet.ServletRequest
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfacejakarta.servlet.ServletRequest
-
getServletContext
public jakarta.servlet.ServletContext getServletContext()- Specified by:
getServletContextin interfacejakarta.servlet.ServletRequest
-
isAsyncStarted
public boolean isAsyncStarted()- Specified by:
isAsyncStartedin interfacejakarta.servlet.ServletRequest
-
isAsyncSupported
public boolean isAsyncSupported()- Specified by:
isAsyncSupportedin interfacejakarta.servlet.ServletRequest
-
isSecure
public boolean isSecure()- Specified by:
isSecurein interfacejakarta.servlet.ServletRequest
-
removeAttribute
- Specified by:
removeAttributein interfacejakarta.servlet.ServletRequest
-
setPath
-
requestRawPath
-
initPathFromContext
-
setEndListener
-
setApplication
-
setBeginListener
-
init
public void init() -
destroy
public void destroy()
-