Class ClientInvocation

    • Method Detail

      • extractResult

        public static <T> T extractResult​(GenericType<T> responseType,
                                          Response response,
                                          Annotation[] annotations)
        Extracts result from response throwing an appropriate exception if not a successful response.
        Type Parameters:
        T - type
        Parameters:
        responseType - generic type
        response - response entity
        annotations - array of annotations
        Returns:
        extracted result of type T
      • handleErrorStatus

        public static <T> T handleErrorStatus​(Response response)
        Throw an exception. Expecting a status of 400 or greater.
        Type Parameters:
        T - type
        Parameters:
        response - response entity
        Returns:
        unreachable
      • setDelegatingOutputStream

        public void setDelegatingOutputStream​(DelegatingOutputStream delegatingOutputStream)
      • setEntityStream

        public void setEntityStream​(OutputStream entityStream)
      • getUri

        public URI getUri()
      • setUri

        public void setUri​(URI uri)
      • getEntityAnnotations

        public Annotation[] getEntityAnnotations()
      • setEntityAnnotations

        public void setEntityAnnotations​(Annotation[] entityAnnotations)
      • getMethod

        public String getMethod()
      • setMethod

        public void setMethod​(String method)
      • getMutableProperties

        public Map<String,​Object> getMutableProperties()
      • getEntity

        public Object getEntity()
      • getEntityGenericType

        public Type getEntityGenericType()
      • getEntityClass

        public Class<?> getEntityClass()
      • setEntity

        public void setEntity​(Entity<?> entity)
      • setEntityObject

        public void setEntityObject​(Object ent)
      • isChunked

        public boolean isChunked()
      • setChunked

        public void setChunked​(boolean chunked)
      • invoke

        public ClientResponse invoke()
        Description copied from interface: Invocation
        Synchronously invoke the request and receive a response back.
        Specified by:
        invoke in interface Invocation
        Returns:
        response object as a result of the request invocation.
      • invoke

        public <T> T invoke​(Class<T> responseType)
        Description copied from interface: Invocation
        Synchronously invoke the request and receive a response of the specified type back.
        Specified by:
        invoke in interface Invocation
        Type Parameters:
        T - response type
        Parameters:
        responseType - Java type the response should be converted into.
        Returns:
        response object of the specified type as a result of the request invocation.
      • invoke

        public <T> T invoke​(GenericType<T> responseType)
        Description copied from interface: Invocation
        Synchronously invoke the request and receive a response of the specified generic type back.
        Specified by:
        invoke in interface Invocation
        Type Parameters:
        T - generic response type
        Parameters:
        responseType - type literal representing a generic Java type the response should be converted into.
        Returns:
        response object of the specified generic type as a result of the request invocation.
      • submit

        public Future<Response> submit()
        Description copied from interface: Invocation
        Submit the request for an asynchronous invocation and receive a future response back.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Specified by:
        submit in interface Invocation
        Returns:
        future response object as a result of the request invocation.
      • submit

        public <T> Future<T> submit​(Class<T> responseType)
        Description copied from interface: Invocation
        Submit the request for an asynchronous invocation and receive a future response of the specified type back.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Specified by:
        submit in interface Invocation
        Type Parameters:
        T - response type
        Parameters:
        responseType - Java type the response should be converted into.
        Returns:
        future response object of the specified type as a result of the request invocation.
      • submit

        public <T> Future<T> submit​(GenericType<T> responseType)
        Description copied from interface: Invocation
        Submit the request for an asynchronous invocation and receive a future response of the specified generic type back.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Specified by:
        submit in interface Invocation
        Type Parameters:
        T - generic response type
        Parameters:
        responseType - type literal representing a generic Java type the response should be converted into.
        Returns:
        future response object of the specified generic type as a result of the request invocation.
      • submit

        public <T> Future<T> submit​(InvocationCallback<T> callback)
        Description copied from interface: Invocation
        Submit the request for an asynchronous invocation and register an InvocationCallback to process the future result of the invocation.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Specified by:
        submit in interface Invocation
        Type Parameters:
        T - response type
        Parameters:
        callback - invocation callback for asynchronous processing of the request invocation result.
        Returns:
        future response object of the specified type as a result of the request invocation.
      • asyncInvocationExecutor

        public ExecutorService asyncInvocationExecutor()
      • reactive

        public Optional<org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.ReactiveInvocation> reactive()
        If the client's HTTP engine implements ReactiveClientHttpEngine then you can access the latter's Publisher via this method.
      • setClientInvoker

        public void setClientInvoker​(ClientInvoker clientInvoker)
      • setActualTarget

        public void setActualTarget​(WebTarget target)
      • getActualTarget

        public WebTarget getActualTarget()