Package org.jboss.resteasy.core.interception.jaxrs

## Class ContainerResponseContextImpl

- java.lang.Object
- - org.jboss.resteasy.core.interception.jaxrs.ContainerResponseContextImpl

- All Implemented Interfaces:
    `javax.ws.rs.container.ContainerResponseContext`, `SuspendableContainerResponseContext`

      public class ContainerResponseContextImpl
      extends Object
      implements SuspendableContainerResponseContext

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected HttpResponse` | `httpResponse` |
    `protected BuiltResponse` | `jaxrsResponse` |
    `protected HttpRequest` | `request` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ContainerResponseContextImpl​(HttpRequest request, HttpResponse httpResponse, BuiltResponse serverResponse)` | Deprecated.
    `ContainerResponseContextImpl​(HttpRequest request, HttpResponse httpResponse, BuiltResponse serverResponse, ResponseContainerRequestContext requestContext, javax.ws.rs.container.ContainerResponseFilter[] responseFilters, Consumer<Throwable> onComplete, ServerResponseWriter.RunnableWithIOException continuation)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `filter()` |
    `Set<String>` | `getAllowedMethods()` |
    `Map<String,​javax.ws.rs.core.NewCookie>` | `getCookies()` |
    `Date` | `getDate()` |
    `Object` | `getEntity()` |
    `Annotation[]` | `getEntityAnnotations()` |
    `Class<?>` | `getEntityClass()` |
    `OutputStream` | `getEntityStream()` |
    `javax.ws.rs.core.EntityTag` | `getEntityTag()` |
    `Type` | `getEntityType()` |
    `javax.ws.rs.core.MultivaluedMap<String,​Object>` | `getHeaders()` |
    `String` | `getHeaderString​(String name)` |
    `HttpResponse` | `getHttpResponse()` |
    `BuiltResponse` | `getJaxrsResponse()` |
    `Locale` | `getLanguage()` |
    `Date` | `getLastModified()` |
    `int` | `getLength()` |
    `javax.ws.rs.core.Link` | `getLink​(String relation)` |
    `javax.ws.rs.core.Link.Builder` | `getLinkBuilder​(String relation)` |
    `Set<javax.ws.rs.core.Link>` | `getLinks()` |
    `URI` | `getLocation()` |
    `javax.ws.rs.core.MediaType` | `getMediaType()` |
    `int` | `getStatus()` |
    `javax.ws.rs.core.Response.StatusType` | `getStatusInfo()` |
    `javax.ws.rs.core.MultivaluedMap<String,​String>` | `getStringHeaders()` |
    `boolean` | `hasEntity()` |
    `boolean` | `hasLink​(String relation)` |
    `void` | `resume()` | Resumes the current response, and proceeds to the next response filter, if any, or to send the response.
    `void` | `resume​(Throwable t)` | Aborts the current response with the given exception.
    `void` | `setEntity​(Object entity)` |
    `void` | `setEntity​(Object entity, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `void` | `setEntityStream​(OutputStream entityStream)` |
    `void` | `setStatus​(int code)` |
    `void` | `setStatusInfo​(javax.ws.rs.core.Response.StatusType statusInfo)` |
    `void` | `suspend()` | Suspends the current response.

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

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

- - ### Field Detail

    - #### request

          protected final HttpRequest request

    - #### httpResponse

          protected final HttpResponse httpResponse

    - #### jaxrsResponse

          protected final BuiltResponse jaxrsResponse

  - ### Constructor Detail

    - #### ContainerResponseContextImpl

          @Deprecated
          public ContainerResponseContextImpl​(HttpRequest request,
                                              HttpResponse httpResponse,
                                              BuiltResponse serverResponse)

      Deprecated.

    - #### ContainerResponseContextImpl

          public ContainerResponseContextImpl​(HttpRequest request,
                                              HttpResponse httpResponse,
                                              BuiltResponse serverResponse,
                                              ResponseContainerRequestContext requestContext,
                                              javax.ws.rs.container.ContainerResponseFilter[] responseFilters,
                                              Consumer<Throwable> onComplete,
                                              ServerResponseWriter.RunnableWithIOException continuation)

  - ### Method Detail

    - #### getJaxrsResponse

          public BuiltResponse getJaxrsResponse()

    - #### getHttpResponse

          public HttpResponse getHttpResponse()

    - #### getStatus

          public int getStatus()

      Specified by:
        `getStatus` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### setStatus

          public void setStatus​(int code)

      Specified by:
        `setStatus` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getStatusInfo

          public javax.ws.rs.core.Response.StatusType getStatusInfo()

      Specified by:
        `getStatusInfo` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### setStatusInfo

          public void setStatusInfo​(javax.ws.rs.core.Response.StatusType statusInfo)

      Specified by:
        `setStatusInfo` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getEntityClass

          public Class<?> getEntityClass()

      Specified by:
        `getEntityClass` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getEntityType

          public Type getEntityType()

      Specified by:
        `getEntityType` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### setEntity

          public void setEntity​(Object entity)

      Specified by:
        `setEntity` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### setEntity

          public void setEntity​(Object entity,
                                Annotation[] annotations,
                                javax.ws.rs.core.MediaType mediaType)

      Specified by:
        `setEntity` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getHeaders

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

      Specified by:
        `getHeaders` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getAllowedMethods

          public Set<String> getAllowedMethods()

      Specified by:
        `getAllowedMethods` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getDate

          public Date getDate()

      Specified by:
        `getDate` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLanguage

          public Locale getLanguage()

      Specified by:
        `getLanguage` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLength

          public int getLength()

      Specified by:
        `getLength` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getMediaType

          public javax.ws.rs.core.MediaType getMediaType()

      Specified by:
        `getMediaType` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getCookies

          public Map<String,​javax.ws.rs.core.NewCookie> getCookies()

      Specified by:
        `getCookies` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getEntityTag

          public javax.ws.rs.core.EntityTag getEntityTag()

      Specified by:
        `getEntityTag` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLastModified

          public Date getLastModified()

      Specified by:
        `getLastModified` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLocation

          public URI getLocation()

      Specified by:
        `getLocation` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLinks

          public Set<javax.ws.rs.core.Link> getLinks()

      Specified by:
        `getLinks` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### hasLink

          public boolean hasLink​(String relation)

      Specified by:
        `hasLink` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLink

          public javax.ws.rs.core.Link getLink​(String relation)

      Specified by:
        `getLink` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getLinkBuilder

          public javax.ws.rs.core.Link.Builder getLinkBuilder​(String relation)

      Specified by:
        `getLinkBuilder` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### hasEntity

          public boolean hasEntity()

      Specified by:
        `hasEntity` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getEntity

          public Object getEntity()

      Specified by:
        `getEntity` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getEntityStream

          public OutputStream getEntityStream()

      Specified by:
        `getEntityStream` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### setEntityStream

          public void setEntityStream​(OutputStream entityStream)

      Specified by:
        `setEntityStream` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getEntityAnnotations

          public Annotation[] getEntityAnnotations()

      Specified by:
        `getEntityAnnotations` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getStringHeaders

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

      Specified by:
        `getStringHeaders` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### getHeaderString

          public String getHeaderString​(String name)

      Specified by:
        `getHeaderString` in interface `javax.ws.rs.container.ContainerResponseContext`

    - #### suspend

          public void suspend()

      Description copied from interface: `SuspendableContainerResponseContext`
      Suspends the current response. This makes the current request asynchronous. No further response filter is executed until this response is resumed. No reply is going to be sent to the client until this response is resumed either with `SuspendableContainerResponseContext.resume()` or aborted with `SuspendableContainerResponseContext.resume(Throwable)` or `ResponseContainerRequestContext.abortWith(javax.ws.rs.core.Response)`.
      Specified by:
        `suspend` in interface `SuspendableContainerResponseContext`

    - #### resume

          public void resume()

      Description copied from interface: `SuspendableContainerResponseContext`
      Resumes the current response, and proceeds to the next response filter, if any, or to send the response.
      Specified by:
        `resume` in interface `SuspendableContainerResponseContext`

    - #### resume

          public void resume​(Throwable t)

      Description copied from interface: `SuspendableContainerResponseContext`
      Aborts the current response with the given exception. This behaves as if the request filter threw this exception synchronously, which means that the exception will not be mapped by exception mappers, the response filters will stop running, and the async response callbacks will be called with this exception.
      Specified by:
        `resume` in interface `SuspendableContainerResponseContext`
      Parameters:
        `t` - the exception to send back to the client, as an internal server error.

    - #### filter

          public void filter()
                      throws IOException

      Throws:
        `IOException`