Package org.jboss.resteasy.util
Class DelegatingHttpRequest
- java.lang.Object
-
- org.jboss.resteasy.util.DelegatingHttpRequest
-
- All Implemented Interfaces:
HttpRequest
- Direct Known Subclasses:
PrefixedFormFieldsHttpRequest
public class DelegatingHttpRequest extends Object implements HttpRequest
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Constructor Summary
Constructors Constructor Description DelegatingHttpRequest(HttpRequest delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanformParametersRead()Were form parameters read before marshalling to body?voidforward(String path)ResteasyAsynchronousContextgetAsyncContext()ObjectgetAttribute(String attribute)Map of contextual data.Enumeration<String>getAttributeNames()javax.ws.rs.core.MultivaluedMap<String,String>getDecodedFormParameters()javax.ws.rs.core.MultivaluedMap<String,String>getFormParameters()application/x-www-form-urlencoded parametersjavax.ws.rs.core.HttpHeadersgetHttpHeaders()StringgetHttpMethod()InputStreamgetInputStream()javax.ws.rs.core.MultivaluedMap<String,String>getMutableHeaders()StringgetRemoteAddress()Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.StringgetRemoteHost()Returns the fully qualified name of the client or the last proxy that sent the request.javax.ws.rs.core.UriInfogetUri()This method *MUST* always return the same instance.booleanisInitial()voidremoveAttribute(String name)voidsetAttribute(String name, Object value)voidsetHttpMethod(String method)voidsetInputStream(InputStream stream)If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream().voidsetRequestUri(URI requestUri)Updates the object returned byHttpRequest.getUri().voidsetRequestUri(URI baseUri, URI requestUri)Updates the object returned byHttpRequest.getUri().booleanwasForwarded()
-
-
-
Constructor Detail
-
DelegatingHttpRequest
public DelegatingHttpRequest(HttpRequest delegate)
-
-
Method Detail
-
getMutableHeaders
public javax.ws.rs.core.MultivaluedMap<String,String> getMutableHeaders()
- Specified by:
getMutableHeadersin interfaceHttpRequest
-
setHttpMethod
public void setHttpMethod(String method)
- Specified by:
setHttpMethodin interfaceHttpRequest
-
getUri
public javax.ws.rs.core.UriInfo getUri()
Description copied from interface:HttpRequestThis method *MUST* always return the same instance.- Specified by:
getUriin interfaceHttpRequest- Returns:
- uri info
-
setRequestUri
public void setRequestUri(URI requestUri) throws IllegalStateException
Description copied from interface:HttpRequestUpdates the object returned byHttpRequest.getUri().- Specified by:
setRequestUriin interfaceHttpRequest- Parameters:
requestUri- request uri- Throws:
IllegalStateException
-
setRequestUri
public void setRequestUri(URI baseUri, URI requestUri) throws IllegalStateException
Description copied from interface:HttpRequestUpdates the object returned byHttpRequest.getUri().- Specified by:
setRequestUriin interfaceHttpRequest- Parameters:
baseUri- base urirequestUri- request uri- Throws:
IllegalStateException
-
getHttpHeaders
public javax.ws.rs.core.HttpHeaders getHttpHeaders()
- Specified by:
getHttpHeadersin interfaceHttpRequest
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStreamin interfaceHttpRequest
-
setInputStream
public void setInputStream(InputStream stream)
Description copied from interface:HttpRequestIf you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). It will only override it for the resteasy HttpRequest- Specified by:
setInputStreamin interfaceHttpRequest- Parameters:
stream- input stream
-
getHttpMethod
public String getHttpMethod()
- Specified by:
getHttpMethodin interfaceHttpRequest
-
getFormParameters
public javax.ws.rs.core.MultivaluedMap<String,String> getFormParameters()
Description copied from interface:HttpRequestapplication/x-www-form-urlencoded parametersThis is here because @FormParam needs it and for when there are servlet filters that eat up the input stream
- Specified by:
getFormParametersin interfaceHttpRequest- Returns:
- null if no parameters, this is encoded map
-
getDecodedFormParameters
public javax.ws.rs.core.MultivaluedMap<String,String> getDecodedFormParameters()
- Specified by:
getDecodedFormParametersin interfaceHttpRequest
-
formParametersRead
public boolean formParametersRead()
Description copied from interface:HttpRequestWere form parameters read before marshalling to body?- Specified by:
formParametersReadin interfaceHttpRequest- Returns:
-
getAttribute
public Object getAttribute(String attribute)
Description copied from interface:HttpRequestMap of contextual data. Similar to HttpServletRequest attributes- Specified by:
getAttributein interfaceHttpRequest- Parameters:
attribute- attribute name- Returns:
- attribute
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttributein interfaceHttpRequest
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceHttpRequest
-
getAttributeNames
public Enumeration<String> getAttributeNames()
- Specified by:
getAttributeNamesin interfaceHttpRequest
-
isInitial
public boolean isInitial()
- Specified by:
isInitialin interfaceHttpRequest
-
getAsyncContext
public ResteasyAsynchronousContext getAsyncContext()
- Specified by:
getAsyncContextin interfaceHttpRequest
-
forward
public void forward(String path)
- Specified by:
forwardin interfaceHttpRequest
-
wasForwarded
public boolean wasForwarded()
- Specified by:
wasForwardedin interfaceHttpRequest
-
getRemoteHost
public String getRemoteHost()
Description copied from interface:HttpRequestReturns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address.- Specified by:
getRemoteHostin interfaceHttpRequest- Returns:
- a
Stringcontaining the fully qualified name of the client
-
getRemoteAddress
public String getRemoteAddress()
Description copied from interface:HttpRequestReturns the Internet Protocol (IP) address of the client or last proxy that sent the request.- Specified by:
getRemoteAddressin interfaceHttpRequest- Returns:
- a
Stringcontaining the IP address of the client that sent the request
-
-