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 parameters
    `javax.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 by `HttpRequest.getUri()`.
    `void` | `setRequestUri​(URI baseUri, URI requestUri)` | Updates the object returned by `HttpRequest.getUri()`.
    `boolean` | `wasForwarded()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DelegatingHttpRequest

          public DelegatingHttpRequest​(HttpRequest delegate)

  - ### Method Detail

    - #### getMutableHeaders

          public javax.ws.rs.core.MultivaluedMap<String,​String> getMutableHeaders()

      Specified by:
        `getMutableHeaders` in interface `HttpRequest`

    - #### setHttpMethod

          public void setHttpMethod​(String method)

      Specified by:
        `setHttpMethod` in interface `HttpRequest`

    - #### 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 interface `HttpRequest`
      Returns:
        uri info

    - #### setRequestUri

          public void setRequestUri​(URI requestUri)
                             throws IllegalStateException

      Description copied from interface: `HttpRequest`
      Updates the object returned by `HttpRequest.getUri()`.
      Specified by:
        `setRequestUri` in interface `HttpRequest`
      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 by `HttpRequest.getUri()`.
      Specified by:
        `setRequestUri` in interface `HttpRequest`
      Parameters:
        `baseUri` - base uri
        `requestUri` - request uri
      Throws:
        `IllegalStateException`

    - #### getHttpHeaders

          public javax.ws.rs.core.HttpHeaders getHttpHeaders()

      Specified by:
        `getHttpHeaders` in interface `HttpRequest`

    - #### getInputStream

          public InputStream getInputStream()

      Specified by:
        `getInputStream` in interface `HttpRequest`

    - #### 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 interface `HttpRequest`
      Parameters:
        `stream` - input stream

    - #### getHttpMethod

          public String getHttpMethod()

      Specified by:
        `getHttpMethod` in interface `HttpRequest`

    - #### getFormParameters

          public javax.ws.rs.core.MultivaluedMap<String,​String> getFormParameters()

      Description copied from interface: `HttpRequest`
      application/x-www-form-urlencoded parameters

      This is here because @FormParam needs it and for when there are servlet filters that eat up the input stream

      Specified by:
        `getFormParameters` in interface `HttpRequest`
      Returns:
        null if no parameters, this is encoded map

    - #### getDecodedFormParameters

          public javax.ws.rs.core.MultivaluedMap<String,​String> getDecodedFormParameters()

      Specified by:
        `getDecodedFormParameters` in interface `HttpRequest`

    - #### formParametersRead

          public boolean formParametersRead()

      Description copied from interface: `HttpRequest`
      Were form parameters read before marshalling to body?
      Specified by:
        `formParametersRead` in interface `HttpRequest`
      Returns:

    - #### getAttribute

          public Object getAttribute​(String attribute)

      Description copied from interface: `HttpRequest`
      Map of contextual data. Similar to HttpServletRequest attributes
      Specified by:
        `getAttribute` in interface `HttpRequest`
      Parameters:
        `attribute` - attribute name
      Returns:
        attribute

    - #### setAttribute

          public void setAttribute​(String name,
                                   Object value)

      Specified by:
        `setAttribute` in interface `HttpRequest`

    - #### removeAttribute

          public void removeAttribute​(String name)

      Specified by:
        `removeAttribute` in interface `HttpRequest`

    - #### getAttributeNames

          public Enumeration<String> getAttributeNames()

      Specified by:
        `getAttributeNames` in interface `HttpRequest`

    - #### isInitial

          public boolean isInitial()

      Specified by:
        `isInitial` in interface `HttpRequest`

    - #### getAsyncContext

          public ResteasyAsynchronousContext getAsyncContext()

      Specified by:
        `getAsyncContext` in interface `HttpRequest`

    - #### forward

          public void forward​(String path)

      Specified by:
        `forward` in interface `HttpRequest`

    - #### wasForwarded

          public boolean wasForwarded()

      Specified by:
        `wasForwarded` in interface `HttpRequest`

    - #### 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 interface `HttpRequest`
      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 interface `HttpRequest`
      Returns:
        a `String` containing the IP address of the client that sent the request