Package org.jboss.resteasy.plugins.server.netty

## Class NettyHttpRequest

- java.lang.Object
- - org.jboss.resteasy.plugins.server.BaseHttpRequest
  - - org.jboss.resteasy.plugins.server.netty.NettyHttpRequest

- All Implemented Interfaces:
    `HttpRequest`

      public class NettyHttpRequest
      extends BaseHttpRequest

  Abstraction for an inbound http request on the server, or a response from a server to a client

  We have this abstraction so that we can reuse marshalling objects in a client framework and serverside framework

  Version:
    $Revision: 1 $
  Author:
    Bill Burke, Norman Maurer, Kristoffer Sjogren

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Map<String,​Object>` | `attributes` |
    `protected SynchronousDispatcher` | `dispatcher` |
    `protected ResteasyHttpHeaders` | `httpHeaders` |
    `protected String` | `httpMethod` |
    `protected InputStream` | `inputStream` |
    `protected NettyHttpResponse` | `response` |

    - ### Fields inherited from class org.jboss.resteasy.plugins.server.BaseHttpRequest

      `decodedFormParameters, formParameters, uri`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NettyHttpRequest​(io.netty.channel.ChannelHandlerContext ctx, ResteasyHttpHeaders httpHeaders, ResteasyUriInfo uri, String httpMethod, SynchronousDispatcher dispatcher, NettyHttpResponse response, boolean is100ContinueExpected)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `forward​(String path)` |
    `ResteasyAsynchronousContext` | `getAsyncContext()` |
    `Object` | `getAttribute​(String attribute)` | Map of contextual data.
    `Enumeration<String>` | `getAttributeNames()` |
    `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.
    `NettyHttpResponse` | `getResponse()` |
    `boolean` | `is100ContinueExpected()` |
    `boolean` | `isFlushed()` |
    `boolean` | `isKeepAlive()` |
    `void` | `releaseContentBuffer()` |
    `void` | `removeAttribute​(String name)` |
    `void` | `setAttribute​(String name, Object value)` |
    `void` | `setContentBuffer​(io.netty.buffer.ByteBuf content)` |
    `void` | `setHttpMethod​(String method)` |
    `void` | `setInputStream​(InputStream stream)` | If you are using a servlet container, this will *NOT* override the HttpServletRequest.getInputStream().
    `boolean` | `wasForwarded()` |

    - ### Methods inherited from class org.jboss.resteasy.plugins.server.BaseHttpRequest

      `formParametersRead, getDecodedFormParameters, getFormParameters, getUri, isInitial, setRequestUri, setRequestUri`

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

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

- - ### Field Detail

    - #### httpHeaders

          protected ResteasyHttpHeaders httpHeaders

    - #### dispatcher

          protected SynchronousDispatcher dispatcher

    - #### httpMethod

          protected String httpMethod

    - #### inputStream

          protected InputStream inputStream

    - #### attributes

          protected Map<String,​Object> attributes

    - #### response

          protected NettyHttpResponse response

  - ### Constructor Detail

    - #### NettyHttpRequest

          public NettyHttpRequest​(io.netty.channel.ChannelHandlerContext ctx,
                                  ResteasyHttpHeaders httpHeaders,
                                  ResteasyUriInfo uri,
                                  String httpMethod,
                                  SynchronousDispatcher dispatcher,
                                  NettyHttpResponse response,
                                  boolean is100ContinueExpected)

  - ### Method Detail

    - #### getMutableHeaders

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

    - #### setHttpMethod

          public void setHttpMethod​(String method)

    - #### getAttributeNames

          public Enumeration<String> getAttributeNames()

    - #### getAsyncContext

          public ResteasyAsynchronousContext getAsyncContext()

    - #### isFlushed

          public boolean isFlushed()

    - #### getAttribute

          public Object getAttribute​(String attribute)

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

    - #### setAttribute

          public void setAttribute​(String name,
                                   Object value)

    - #### removeAttribute

          public void removeAttribute​(String name)

    - #### getHttpHeaders

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

    - #### getInputStream

          public InputStream getInputStream()

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

    - #### getHttpMethod

          public String getHttpMethod()

    - #### getResponse

          public NettyHttpResponse getResponse()

    - #### isKeepAlive

          public boolean isKeepAlive()

    - #### is100ContinueExpected

          public boolean is100ContinueExpected()

    - #### forward

          public void forward​(String path)

    - #### wasForwarded

          public boolean wasForwarded()

    - #### setContentBuffer

          public void setContentBuffer​(io.netty.buffer.ByteBuf content)

    - #### releaseContentBuffer

          public void releaseContentBuffer()

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