org.jboss.resteasy.core.interception

## Class ResponseContainerRequestContext

- java.lang.Object
- - org.jboss.resteasy.core.interception.PreMatchContainerRequestContext
  - - org.jboss.resteasy.core.interception.ResponseContainerRequestContext

- All Implemented Interfaces:
    ContainerRequestContext

      public class ResponseContainerRequestContext
      extends PreMatchContainerRequestContext

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    - ### Fields inherited from class org.jboss.resteasy.core.interception.PreMatchContainerRequestContext

      `httpRequest, response`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResponseContainerRequestContext(HttpRequest request)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abortWith(Response response)` Abort the filter chain with a response.
    `void` | `setEntityStream(InputStream entityStream)` Set a new entity input stream.
    `void` | `setMethod(String method)` Set the request method.
    `void` | `setRequestUri(URI requestUri)` Set a new request URI using the current base URI of the application to resolve the application-specific request URI part.
    `void` | `setRequestUri(URI baseUri, URI requestUri)` Set a new request URI using a new base URI to resolve the application-specific request URI part.
    `void` | `setSecurityContext(SecurityContext context)` Set a new injectable security context information for the current request.

    - ### Methods inherited from class org.jboss.resteasy.core.interception.PreMatchContainerRequestContext

      `getAcceptableLanguages, getAcceptableMediaTypes, getCookies, getDate, getEntityStream, getHeaders, getHeaderString, getHttpRequest, getLanguage, getLength, getMediaType, getMethod, getProperty, getPropertyNames, getRequest, getResponseAbortedWith, getSecurityContext, getUriInfo, hasEntity, removeProperty, setProperty`

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

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

- - ### Constructor Detail

    - #### ResponseContainerRequestContext

          public ResponseContainerRequestContext(HttpRequest request)

  - ### Method Detail

    - #### abortWith

          public void abortWith(Response response)

      Description copied from interface: `ContainerRequestContext`
      Abort the filter chain with a response. This method breaks the filter chain processing and returns the provided response back to the client. The provided response goes through the chain of applicable response filters.
      Specified by:
        `abortWith` in interface `ContainerRequestContext`
      Overrides:
        `abortWith` in class `PreMatchContainerRequestContext`
      Parameters:
        `response` - response to be sent back to the client.

    - #### setSecurityContext

          public void setSecurityContext(SecurityContext context)

      Description copied from interface: `ContainerRequestContext`
      Set a new injectable security context information for the current request. The `SecurityContext.getUserPrincipal()` must return `null` if the current request has not been authenticated.
      Specified by:
        `setSecurityContext` in interface `ContainerRequestContext`
      Overrides:
        `setSecurityContext` in class `PreMatchContainerRequestContext`
      Parameters:
        `context` - new injectable request security context information.

    - #### setEntityStream

          public void setEntityStream(InputStream entityStream)

      Description copied from interface: `ContainerRequestContext`
      Set a new entity input stream. The JAX-RS runtime is responsible for closing the intput stream.
      Specified by:
        `setEntityStream` in interface `ContainerRequestContext`
      Overrides:
        `setEntityStream` in class `PreMatchContainerRequestContext`
      Parameters:
        `entityStream` - new entity input stream.

    - #### setMethod

          public void setMethod(String method)

      Description copied from interface: `ContainerRequestContext`
      Set the request method.

      Note that the method is usable only in pre-matching filters, prior to the resource matching occurs. Trying to invoke the method in a filter bound to a resource method results in an `IllegalStateException` being thrown.

      Specified by:
        `setMethod` in interface `ContainerRequestContext`
      Overrides:
        `setMethod` in class `PreMatchContainerRequestContext`
      Parameters:
        `method` - new request method.
      See Also:
        `HttpMethod`

    - #### setRequestUri

          public void setRequestUri(URI baseUri,
                           URI requestUri)
                             throws IllegalStateException

      Description copied from interface: `ContainerRequestContext`
      Set a new request URI using a new base URI to resolve the application-specific request URI part.

      Note that the method is usable only in pre-matching filters, prior to the resource matching occurs. Trying to invoke the method in a filter bound to a resource method results in an `IllegalStateException` being thrown.

      Specified by:
        `setRequestUri` in interface `ContainerRequestContext`
      Overrides:
        `setRequestUri` in class `PreMatchContainerRequestContext`
      Parameters:
        `baseUri` - base URI that will be used to resolve the application-specific part of the request URI.
        `requestUri` - new URI of the request.
      Throws:
        `IllegalStateException` - in case the method is not invoked from a `pre-matching` request filter.
      See Also:
        `ContainerRequestContext.setRequestUri(java.net.URI)`

    - #### setRequestUri

          public void setRequestUri(URI requestUri)
                             throws IllegalStateException

      Description copied from interface: `ContainerRequestContext`
      Set a new request URI using the current base URI of the application to resolve the application-specific request URI part.

      Note that the method is usable only in pre-matching filters, prior to the resource matching occurs. Trying to invoke the method in a filter bound to a resource method results in an `IllegalStateException` being thrown.

      Specified by:
        `setRequestUri` in interface `ContainerRequestContext`
      Overrides:
        `setRequestUri` in class `PreMatchContainerRequestContext`
      Parameters:
        `requestUri` - new URI of the request.
      Throws:
        `IllegalStateException` - in case the method is not invoked from a `pre-matching` request filter.
      See Also:
        `ContainerRequestContext.setRequestUri(java.net.URI, java.net.URI)`

Copyright © 2014. All Rights Reserved.