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 boolean
formParametersRead()
Were form parameters read before marshalling to body?void
forward(String path)
ResteasyAsynchronousContext
getAsyncContext()
Object
getAttribute(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.HttpHeaders
getHttpHeaders()
String
getHttpMethod()
InputStream
getInputStream()
javax.ws.rs.core.MultivaluedMap<String,String>
getMutableHeaders()
String
getRemoteAddress()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.String
getRemoteHost()
Returns the fully qualified name of the client or the last proxy that sent the request.javax.ws.rs.core.UriInfo
getUri()
This method *MUST* always return the same instance.boolean
isInitial()
void
removeAttribute(String name)
void
setAttribute(String name, Object value)
void
setHttpMethod(String method)
void
setInputStream(InputStream stream)
If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream().void
setRequestUri(URI requestUri)
Updates the object returned byHttpRequest.getUri()
.void
setRequestUri(URI baseUri, URI requestUri)
Updates the object returned byHttpRequest.getUri()
.boolean
wasForwarded()
-
-
-
Constructor Detail
-
DelegatingHttpRequest
public DelegatingHttpRequest(HttpRequest delegate)
-
-
Method Detail
-
getMutableHeaders
public javax.ws.rs.core.MultivaluedMap<String,String> getMutableHeaders()
- Specified by:
getMutableHeaders
in interfaceHttpRequest
-
setHttpMethod
public void setHttpMethod(String method)
- Specified by:
setHttpMethod
in interfaceHttpRequest
-
getUri
public javax.ws.rs.core.UriInfo getUri()
Description copied from interface:HttpRequest
This method *MUST* always return the same instance.- Specified by:
getUri
in interfaceHttpRequest
- Returns:
- uri info
-
setRequestUri
public void setRequestUri(URI requestUri) throws IllegalStateException
Description copied from interface:HttpRequest
Updates the object returned byHttpRequest.getUri()
.- Specified by:
setRequestUri
in interfaceHttpRequest
- Parameters:
requestUri
- request uri- Throws:
IllegalStateException
-
setRequestUri
public void setRequestUri(URI baseUri, URI requestUri) throws IllegalStateException
Description copied from interface:HttpRequest
Updates the object returned byHttpRequest.getUri()
.- Specified by:
setRequestUri
in interfaceHttpRequest
- Parameters:
baseUri
- base urirequestUri
- request uri- Throws:
IllegalStateException
-
getHttpHeaders
public javax.ws.rs.core.HttpHeaders getHttpHeaders()
- Specified by:
getHttpHeaders
in interfaceHttpRequest
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStream
in interfaceHttpRequest
-
setInputStream
public void setInputStream(InputStream stream)
Description copied from interface:HttpRequest
If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream(). It will only override it for the resteasy HttpRequest- Specified by:
setInputStream
in interfaceHttpRequest
- Parameters:
stream
- input stream
-
getHttpMethod
public String getHttpMethod()
- Specified by:
getHttpMethod
in interfaceHttpRequest
-
getFormParameters
public javax.ws.rs.core.MultivaluedMap<String,String> getFormParameters()
Description copied from interface:HttpRequest
application/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:
getFormParameters
in interfaceHttpRequest
- Returns:
- null if no parameters, this is encoded map
-
getDecodedFormParameters
public javax.ws.rs.core.MultivaluedMap<String,String> getDecodedFormParameters()
- Specified by:
getDecodedFormParameters
in interfaceHttpRequest
-
formParametersRead
public boolean formParametersRead()
Description copied from interface:HttpRequest
Were form parameters read before marshalling to body?- Specified by:
formParametersRead
in interfaceHttpRequest
- Returns:
-
getAttribute
public Object getAttribute(String attribute)
Description copied from interface:HttpRequest
Map of contextual data. Similar to HttpServletRequest attributes- Specified by:
getAttribute
in interfaceHttpRequest
- Parameters:
attribute
- attribute name- Returns:
- attribute
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttribute
in interfaceHttpRequest
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttribute
in interfaceHttpRequest
-
getAttributeNames
public Enumeration<String> getAttributeNames()
- Specified by:
getAttributeNames
in interfaceHttpRequest
-
isInitial
public boolean isInitial()
- Specified by:
isInitial
in interfaceHttpRequest
-
getAsyncContext
public ResteasyAsynchronousContext getAsyncContext()
- Specified by:
getAsyncContext
in interfaceHttpRequest
-
forward
public void forward(String path)
- Specified by:
forward
in interfaceHttpRequest
-
wasForwarded
public boolean wasForwarded()
- Specified by:
wasForwarded
in interfaceHttpRequest
-
getRemoteHost
public String getRemoteHost()
Description copied from interface:HttpRequest
Returns 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:
getRemoteHost
in interfaceHttpRequest
- Returns:
- a
String
containing the fully qualified name of the client
-
getRemoteAddress
public String getRemoteAddress()
Description copied from interface:HttpRequest
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.- Specified by:
getRemoteAddress
in interfaceHttpRequest
- Returns:
- a
String
containing the IP address of the client that sent the request
-
-