Class JerseyInvocation.Builder

    • Constructor Detail

      • Builder

        protected Builder​(URI uri,
                          ClientConfig configuration)
        Create new Jersey-specific client invocation builder.
        Parameters:
        uri - invoked request URI.
        configuration - Jersey client configuration.
    • Method Detail

      • build

        public JerseyInvocation build​(String method)
        Description copied from interface: Invocation.Builder
        Build a request invocation using an arbitrary request method name.
        Specified by:
        build in interface Invocation.Builder
        Parameters:
        method - request method name.
        Returns:
        invocation encapsulating the built request.
      • build

        public JerseyInvocation build​(String method,
                                      Entity<?> entity)
        Description copied from interface: Invocation.Builder
        Build a request invocation using an arbitrary request method name and request entity.
        Specified by:
        build in interface Invocation.Builder
        Parameters:
        method - request method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation encapsulating the built request.
      • buildPost

        public JerseyInvocation buildPost​(Entity<?> entity)
        Description copied from interface: Invocation.Builder
        Build a POST request invocation.
        Specified by:
        buildPost in interface Invocation.Builder
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation encapsulating the built POST request.
      • buildPut

        public JerseyInvocation buildPut​(Entity<?> entity)
        Description copied from interface: Invocation.Builder
        Build a PUT request invocation.
        Specified by:
        buildPut in interface Invocation.Builder
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation encapsulating the built PUT request.
      • async

        public AsyncInvoker async()
        Description copied from interface: Invocation.Builder
        Access the asynchronous uniform request invocation interface to asynchronously invoke the built request.
        Specified by:
        async in interface Invocation.Builder
        Returns:
        asynchronous uniform request invocation interface.
      • get

        public <T> T get​(Class<T> responseType)
                  throws ProcessingException,
                         WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP GET method for the current request synchronously.
        Specified by:
        get in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • get

        public <T> T get​(GenericType<T> responseType)
                  throws ProcessingException,
                         WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP GET method for the current request synchronously.
        Specified by:
        get in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response
      • put

        public Response put​(Entity<?> entity)
                     throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke HTTP PUT method for the current request synchronously.
        Specified by:
        put in interface SyncInvoker
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • put

        public <T> T put​(Entity<?> entity,
                         Class<T> responseType)
                  throws ProcessingException,
                         WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP PUT method for the current request synchronously.
        Specified by:
        put in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • put

        public <T> T put​(Entity<?> entity,
                         GenericType<T> responseType)
                  throws ProcessingException,
                         WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP PUT method for the current request synchronously.
        Specified by:
        put in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • post

        public Response post​(Entity<?> entity)
                      throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke HTTP POST method for the current request synchronously.
        Specified by:
        post in interface SyncInvoker
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • post

        public <T> T post​(Entity<?> entity,
                          Class<T> responseType)
                   throws ProcessingException,
                          WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP POST method for the current request synchronously.
        Specified by:
        post in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • post

        public <T> T post​(Entity<?> entity,
                          GenericType<T> responseType)
                   throws ProcessingException,
                          WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP POST method for the current request synchronously.
        Specified by:
        post in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • delete

        public Response delete()
                        throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke HTTP DELETE method for the current request synchronously.
        Specified by:
        delete in interface SyncInvoker
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • delete

        public <T> T delete​(Class<T> responseType)
                     throws ProcessingException,
                            WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP DELETE method for the current request synchronously.
        Specified by:
        delete in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • delete

        public <T> T delete​(GenericType<T> responseType)
                     throws ProcessingException,
                            WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP DELETE method for the current request synchronously.
        Specified by:
        delete in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • head

        public Response head()
                      throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke HTTP HEAD method for the current request synchronously.
        Specified by:
        head in interface SyncInvoker
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • options

        public Response options()
                         throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke HTTP OPTIONS method for the current request synchronously.
        Specified by:
        options in interface SyncInvoker
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • options

        public <T> T options​(Class<T> responseType)
                      throws ProcessingException,
                             WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP OPTIONS method for the current request synchronously.
        Specified by:
        options in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • options

        public <T> T options​(GenericType<T> responseType)
                      throws ProcessingException,
                             WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP OPTIONS method for the current request synchronously.
        Specified by:
        options in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • trace

        public Response trace()
                       throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke HTTP TRACE method for the current request synchronously.
        Specified by:
        trace in interface SyncInvoker
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • trace

        public <T> T trace​(Class<T> responseType)
                    throws ProcessingException,
                           WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP TRACE method for the current request synchronously.
        Specified by:
        trace in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • trace

        public <T> T trace​(GenericType<T> responseType)
                    throws ProcessingException,
                           WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke HTTP TRACE method for the current request synchronously.
        Specified by:
        trace in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • method

        public Response method​(String name)
                        throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke an arbitrary method for the current request synchronously.
        Specified by:
        method in interface SyncInvoker
        Parameters:
        name - method name.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • method

        public <T> T method​(String name,
                            Class<T> responseType)
                     throws ProcessingException,
                            WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke an arbitrary method for the current request synchronously.
        Specified by:
        method in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        name - method name.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • method

        public <T> T method​(String name,
                            GenericType<T> responseType)
                     throws ProcessingException,
                            WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke an arbitrary method for the current request synchronously.
        Specified by:
        method in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        name - method name.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • method

        public Response method​(String name,
                               Entity<?> entity)
                        throws ProcessingException
        Description copied from interface: SyncInvoker
        Invoke an arbitrary method for the current request synchronously.
        Specified by:
        method in interface SyncInvoker
        Parameters:
        name - method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • method

        public <T> T method​(String name,
                            Entity<?> entity,
                            Class<T> responseType)
                     throws ProcessingException,
                            WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke an arbitrary method for the current request synchronously.
        Specified by:
        method in interface SyncInvoker
        Type Parameters:
        T - response entity type.
        Parameters:
        name - method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • method

        public <T> T method​(String name,
                            Entity<?> entity,
                            GenericType<T> responseType)
                     throws ProcessingException,
                            WebApplicationException
        Description copied from interface: SyncInvoker
        Invoke an arbitrary method for the current request synchronously.
        Specified by:
        method in interface SyncInvoker
        Type Parameters:
        T - generic response entity type.
        Parameters:
        name - method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • rx

        public <T extends RxInvoker> T rx​(Class<T> clazz)
        Description copied from interface: Invocation.Builder
        Access a reactive invoker based on a RxInvoker subclass provider. Note that corresponding RxInvokerProvider must be registered in the client runtime.

        This method is an extension point for JAX-RS implementations to support other types representing asynchronous computations.

        Specified by:
        rx in interface Invocation.Builder
        Type Parameters:
        T - generic invoker type.
        Parameters:
        clazz - RxInvoker subclass.
        Returns:
        reactive invoker instance.
        See Also:
        Configurable.register(Class)