Package org.apache.catalina.filters
Class RemoteIpFilter.XForwardedRequest
- java.lang.Object
- 
- javax.servlet.ServletRequestWrapper
- 
- javax.servlet.http.HttpServletRequestWrapper
- 
- org.apache.catalina.filters.RemoteIpFilter.XForwardedRequest
 
 
 
- 
- All Implemented Interfaces:
- HttpServletRequest,- ServletRequest
 - Enclosing class:
- RemoteIpFilter
 
 public static class RemoteIpFilter.XForwardedRequest extends HttpServletRequestWrapper 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.util.List<java.lang.String>>headersprotected java.lang.StringlocalNameprotected intlocalPortprotected java.lang.StringremoteAddrprotected java.lang.StringremoteHostprotected java.lang.Stringschemeprotected booleansecureprotected java.lang.StringserverNameprotected intserverPort- 
Fields inherited from interface javax.servlet.http.HttpServletRequestBASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
- 
 - 
Constructor SummaryConstructors Constructor Description XForwardedRequest(HttpServletRequest request)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDateHeader(java.lang.String name)The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.java.lang.StringgetHeader(java.lang.String name)The default behavior of this method is to return getHeader(String name) on the wrapped request object.protected java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>>getHeaderEntry(java.lang.String name)java.util.Enumeration<java.lang.String>getHeaderNames()The default behavior of this method is to return getHeaderNames() on the wrapped request object.java.util.Enumeration<java.lang.String>getHeaders(java.lang.String name)The default behavior of this method is to return getHeaders(String name) on the wrapped request object.intgetIntHeader(java.lang.String name)The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.java.lang.StringgetLocalName()The default behavior of this method is to return getLocalName() on the wrapped request object.intgetLocalPort()The default behavior of this method is to return getLocalPort() on the wrapped request object.java.lang.StringgetRemoteAddr()The default behavior of this method is to return getRemoteAddr() on the wrapped request object.java.lang.StringgetRemoteHost()The default behavior of this method is to return getRemoteHost() on the wrapped request object.java.lang.StringBuffergetRequestURL()The default behavior of this method is to return getRequestURL() on the wrapped request object.java.lang.StringgetScheme()The default behavior of this method is to return getScheme() on the wrapped request object.java.lang.StringgetServerName()The default behavior of this method is to return getServerName() on the wrapped request object.intgetServerPort()The default behavior of this method is to return getServerPort() on the wrapped request object.PushBuildernewPushBuilder()Obtain a builder for generating push requests.voidremoveHeader(java.lang.String name)voidsetHeader(java.lang.String name, java.lang.String value)voidsetLocalName(java.lang.String localName)voidsetLocalPort(int localPort)voidsetRemoteAddr(java.lang.String remoteAddr)voidsetRemoteHost(java.lang.String remoteHost)voidsetScheme(java.lang.String scheme)voidsetSecure(boolean secure)voidsetServerName(java.lang.String serverName)voidsetServerPort(int serverPort)- 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapperauthenticate, changeSessionId, getAuthType, getContextPath, getCookies, getHttpServletMapping, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, upgrade
 - 
Methods inherited from class javax.servlet.ServletRequestWrappergetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemotePort, getRequest, getRequestDispatcher, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface javax.servlet.ServletRequestgetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemotePort, getRequestDispatcher, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
 
- 
 
- 
- 
- 
Field Detail- 
headersprotected final java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers 
 - 
localNameprotected java.lang.String localName 
 - 
localPortprotected int localPort 
 - 
remoteAddrprotected java.lang.String remoteAddr 
 - 
remoteHostprotected java.lang.String remoteHost 
 - 
schemeprotected java.lang.String scheme 
 - 
secureprotected boolean secure 
 - 
serverNameprotected java.lang.String serverName 
 - 
serverPortprotected int serverPort 
 
- 
 - 
Constructor Detail- 
XForwardedRequestpublic XForwardedRequest(HttpServletRequest request) 
 
- 
 - 
Method Detail- 
getDateHeaderpublic long getDateHeader(java.lang.String name) Description copied from class:javax.servlet.http.HttpServletRequestWrapperThe default behavior of this method is to return getDateHeader(String name) on the wrapped request object.- Specified by:
- getDateHeaderin interface- HttpServletRequest
- Overrides:
- getDateHeaderin class- HttpServletRequestWrapper
- Parameters:
- name- a- Stringspecifying the name of the header
- Returns:
- a longvalue representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the request
 
 - 
getHeaderpublic java.lang.String getHeader(java.lang.String name) Description copied from class:javax.servlet.http.HttpServletRequestWrapperThe default behavior of this method is to return getHeader(String name) on the wrapped request object.- Specified by:
- getHeaderin interface- HttpServletRequest
- Overrides:
- getHeaderin class- HttpServletRequestWrapper
- Parameters:
- name- a- Stringspecifying the header name
- Returns:
- a Stringcontaining the value of the requested header, ornullif the request does not have a header of that name
 
 - 
getHeaderEntryprotected java.util.Map.Entry<java.lang.String,java.util.List<java.lang.String>> getHeaderEntry(java.lang.String name) 
 - 
getHeaderNamespublic java.util.Enumeration<java.lang.String> getHeaderNames() Description copied from class:javax.servlet.http.HttpServletRequestWrapperThe default behavior of this method is to return getHeaderNames() on the wrapped request object.- Specified by:
- getHeaderNamesin interface- HttpServletRequest
- Overrides:
- getHeaderNamesin class- HttpServletRequestWrapper
- Returns:
- an enumeration of all the header names sent with this request; if the request has no headers, an empty
             enumeration; if the servlet container does not allow servlets to use this method, null
 
 - 
getHeaderspublic java.util.Enumeration<java.lang.String> getHeaders(java.lang.String name) Description copied from class:javax.servlet.http.HttpServletRequestWrapperThe default behavior of this method is to return getHeaders(String name) on the wrapped request object.- Specified by:
- getHeadersin interface- HttpServletRequest
- Overrides:
- getHeadersin class- HttpServletRequestWrapper
- Parameters:
- name- a- Stringspecifying the header name
- Returns:
- an Enumerationcontaining the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null
 
 - 
getIntHeaderpublic int getIntHeader(java.lang.String name) Description copied from class:javax.servlet.http.HttpServletRequestWrapperThe default behavior of this method is to return getIntHeader(String name) on the wrapped request object.- Specified by:
- getIntHeaderin interface- HttpServletRequest
- Overrides:
- getIntHeaderin class- HttpServletRequestWrapper
- Parameters:
- name- a- Stringspecifying the name of a request header
- Returns:
- an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
 
 - 
getLocalNamepublic java.lang.String getLocalName() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getLocalName() on the wrapped request object.- Specified by:
- getLocalNamein interface- ServletRequest
- Overrides:
- getLocalNamein class- ServletRequestWrapper
- Returns:
- a Stringcontaining the host name of the IP on which the request was received.
 
 - 
getLocalPortpublic int getLocalPort() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getLocalPort() on the wrapped request object.- Specified by:
- getLocalPortin interface- ServletRequest
- Overrides:
- getLocalPortin class- ServletRequestWrapper
- Returns:
- an integer specifying the port number
 
 - 
getRemoteAddrpublic java.lang.String getRemoteAddr() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getRemoteAddr() on the wrapped request object.- Specified by:
- getRemoteAddrin interface- ServletRequest
- Overrides:
- getRemoteAddrin class- ServletRequestWrapper
- Returns:
- a Stringcontaining the IP address of the client that sent the request
 
 - 
getRemoteHostpublic java.lang.String getRemoteHost() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getRemoteHost() on the wrapped request object.- Specified by:
- getRemoteHostin interface- ServletRequest
- Overrides:
- getRemoteHostin class- ServletRequestWrapper
- Returns:
- a Stringcontaining the fully qualified name of the client
 
 - 
getSchemepublic java.lang.String getScheme() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getScheme() on the wrapped request object.- Specified by:
- getSchemein interface- ServletRequest
- Overrides:
- getSchemein class- ServletRequestWrapper
- Returns:
- a Stringcontaining the name of the scheme used to make this request
 
 - 
getServerNamepublic java.lang.String getServerName() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getServerName() on the wrapped request object.- Specified by:
- getServerNamein interface- ServletRequest
- Overrides:
- getServerNamein class- ServletRequestWrapper
- Returns:
- a Stringcontaining the name of the server
 
 - 
getServerPortpublic int getServerPort() Description copied from class:javax.servlet.ServletRequestWrapperThe default behavior of this method is to return getServerPort() on the wrapped request object.- Specified by:
- getServerPortin interface- ServletRequest
- Overrides:
- getServerPortin class- ServletRequestWrapper
- Returns:
- an integer specifying the port number
 
 - 
removeHeaderpublic void removeHeader(java.lang.String name) 
 - 
setHeaderpublic void setHeader(java.lang.String name, java.lang.String value)
 - 
setLocalNamepublic void setLocalName(java.lang.String localName) 
 - 
setLocalPortpublic void setLocalPort(int localPort) 
 - 
setRemoteAddrpublic void setRemoteAddr(java.lang.String remoteAddr) 
 - 
setRemoteHostpublic void setRemoteHost(java.lang.String remoteHost) 
 - 
setSchemepublic void setScheme(java.lang.String scheme) 
 - 
setSecurepublic void setSecure(boolean secure) 
 - 
setServerNamepublic void setServerName(java.lang.String serverName) 
 - 
setServerPortpublic void setServerPort(int serverPort) 
 - 
getRequestURLpublic java.lang.StringBuffer getRequestURL() Description copied from class:javax.servlet.http.HttpServletRequestWrapperThe default behavior of this method is to return getRequestURL() on the wrapped request object.- Specified by:
- getRequestURLin interface- HttpServletRequest
- Overrides:
- getRequestURLin class- HttpServletRequestWrapper
- Returns:
- a StringBufferobject containing the reconstructed URL
 
 - 
newPushBuilderpublic PushBuilder newPushBuilder() Description copied from class:javax.servlet.http.HttpServletRequestWrapperObtain a builder for generating push requests.PushBuilderdocuments how this request will be used as the basis for a push request. Each call to this method will return a new instance, independent of any previous instance obtained.The default behavior of this method is to return HttpServletRequest.newPushBuilder()on the wrapped request object.- Specified by:
- newPushBuilderin interface- HttpServletRequest
- Overrides:
- newPushBuilderin class- HttpServletRequestWrapper
- Returns:
- A builder that can be used to generate push requests based on this request or nullif push is not supported. Note that even if a PushBuilder instance is returned, by the time thatPushBuilder.push()is called, it may no longer be valid to push a request and the push request will be ignored.
 
 
- 
 
-