org.glassfish.jersey.client
Class JerseyInvocation.Builder

java.lang.Object
  extended by org.glassfish.jersey.client.JerseyInvocation.Builder
All Implemented Interfaces:
Invocation.Builder, SyncInvoker, Configurable<Invocation.Builder>
Enclosing class:
JerseyInvocation

public static class JerseyInvocation.Builder
extends Object
implements Invocation.Builder

Jersey-specific client invocation builder.


Constructor Summary
protected JerseyInvocation.Builder(URI uri, ClientConfig configuration)
          Create new Jersey-specific client invocation builder.
 
Method Summary
 JerseyInvocation.Builder accept(MediaType... mediaTypes)
           
 JerseyInvocation.Builder accept(String... mediaTypes)
           
 Invocation.Builder acceptEncoding(String... encodings)
           
 JerseyInvocation.Builder acceptLanguage(Locale... locales)
           
 JerseyInvocation.Builder acceptLanguage(String... locales)
           
 AsyncInvoker async()
           
 JerseyInvocation build(String method)
           
 JerseyInvocation build(String method, Entity<?> entity)
           
 JerseyInvocation buildDelete()
           
 JerseyInvocation buildGet()
           
 JerseyInvocation buildPost(Entity<?> entity)
           
 JerseyInvocation buildPut(Entity<?> entity)
           
 JerseyInvocation.Builder cacheControl(CacheControl cacheControl)
           
 JerseyInvocation.Builder cookie(Cookie cookie)
           
 JerseyInvocation.Builder cookie(String name, String value)
           
 Response delete()
           
<T> T
delete(Class<T> responseType)
           
<T> T
delete(GenericType<T> responseType)
           
 Response get()
           
<T> T
get(Class<T> responseType)
           
<T> T
get(GenericType<T> responseType)
           
 ClientConfig getConfiguration()
           
 Response head()
           
 JerseyInvocation.Builder header(String name, Object value)
           
 JerseyInvocation.Builder headers(MultivaluedMap<String,Object> headers)
           
 Response method(String name)
           
<T> T
method(String name, Class<T> responseType)
           
 Response method(String name, Entity<?> entity)
           
<T> T
method(String name, Entity<?> entity, Class<T> responseType)
           
<T> T
method(String name, Entity<?> entity, GenericType<T> responseType)
           
<T> T
method(String name, GenericType<T> responseType)
           
 Response options()
           
<T> T
options(Class<T> responseType)
           
<T> T
options(GenericType<T> responseType)
           
 Response post(Entity<?> entity)
           
<T> T
post(Entity<?> entity, Class<T> responseType)
           
<T> T
post(Entity<?> entity, GenericType<T> responseType)
           
 JerseyInvocation.Builder preInitialize()
          Pre initializes the configuration of this invocation builder in order to improve performance during the first request.
 JerseyInvocation.Builder property(String name, Object value)
           
 Response put(Entity<?> entity)
           
<T> T
put(Entity<?> entity, Class<T> responseType)
           
<T> T
put(Entity<?> entity, GenericType<T> responseType)
           
 JerseyInvocation.Builder register(Class<?> providerClass)
           
 JerseyInvocation.Builder register(Class<?> providerClass, Class<?>... contracts)
           
 JerseyInvocation.Builder register(Class<?> providerClass, int bindingPriority)
           
 JerseyInvocation.Builder register(Class<?> providerClass, Map<Class<?>,Integer> contracts)
           
 JerseyInvocation.Builder register(Object provider)
           
 JerseyInvocation.Builder register(Object provider, Class<?>... contracts)
           
 JerseyInvocation.Builder register(Object provider, int bindingPriority)
           
 JerseyInvocation.Builder register(Object provider, Map<Class<?>,Integer> contracts)
           
 JerseyInvocation.Builder replaceWith(Configuration config)
           
 Response trace()
           
<T> T
trace(Class<T> responseType)
           
<T> T
trace(GenericType<T> responseType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JerseyInvocation.Builder

protected JerseyInvocation.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)
Specified by:
build in interface Invocation.Builder

build

public JerseyInvocation build(String method,
                              Entity<?> entity)
Specified by:
build in interface Invocation.Builder

buildGet

public JerseyInvocation buildGet()
Specified by:
buildGet in interface Invocation.Builder

buildDelete

public JerseyInvocation buildDelete()
Specified by:
buildDelete in interface Invocation.Builder

buildPost

public JerseyInvocation buildPost(Entity<?> entity)
Specified by:
buildPost in interface Invocation.Builder

buildPut

public JerseyInvocation buildPut(Entity<?> entity)
Specified by:
buildPut in interface Invocation.Builder

async

public AsyncInvoker async()
Specified by:
async in interface Invocation.Builder

accept

public JerseyInvocation.Builder accept(String... mediaTypes)
Specified by:
accept in interface Invocation.Builder

accept

public JerseyInvocation.Builder accept(MediaType... mediaTypes)
Specified by:
accept in interface Invocation.Builder

acceptEncoding

public Invocation.Builder acceptEncoding(String... encodings)
Specified by:
acceptEncoding in interface Invocation.Builder

acceptLanguage

public JerseyInvocation.Builder acceptLanguage(Locale... locales)
Specified by:
acceptLanguage in interface Invocation.Builder

acceptLanguage

public JerseyInvocation.Builder acceptLanguage(String... locales)
Specified by:
acceptLanguage in interface Invocation.Builder

cookie

public JerseyInvocation.Builder cookie(Cookie cookie)
Specified by:
cookie in interface Invocation.Builder

cookie

public JerseyInvocation.Builder cookie(String name,
                                       String value)
Specified by:
cookie in interface Invocation.Builder

cacheControl

public JerseyInvocation.Builder cacheControl(CacheControl cacheControl)
Specified by:
cacheControl in interface Invocation.Builder

header

public JerseyInvocation.Builder header(String name,
                                       Object value)
Specified by:
header in interface Invocation.Builder

headers

public JerseyInvocation.Builder headers(MultivaluedMap<String,Object> headers)
Specified by:
headers in interface Invocation.Builder

get

public Response get()
             throws ProcessingException
Specified by:
get in interface SyncInvoker
Throws:
ProcessingException

get

public <T> T get(Class<T> responseType)
      throws ProcessingException,
             WebApplicationException
Specified by:
get in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

get

public <T> T get(GenericType<T> responseType)
      throws ProcessingException,
             WebApplicationException
Specified by:
get in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

put

public Response put(Entity<?> entity)
             throws ProcessingException
Specified by:
put in interface SyncInvoker
Throws:
ProcessingException

put

public <T> T put(Entity<?> entity,
                 Class<T> responseType)
      throws ProcessingException,
             WebApplicationException
Specified by:
put in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

put

public <T> T put(Entity<?> entity,
                 GenericType<T> responseType)
      throws ProcessingException,
             WebApplicationException
Specified by:
put in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

post

public Response post(Entity<?> entity)
              throws ProcessingException
Specified by:
post in interface SyncInvoker
Throws:
ProcessingException

post

public <T> T post(Entity<?> entity,
                  Class<T> responseType)
       throws ProcessingException,
              WebApplicationException
Specified by:
post in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

post

public <T> T post(Entity<?> entity,
                  GenericType<T> responseType)
       throws ProcessingException,
              WebApplicationException
Specified by:
post in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

delete

public Response delete()
                throws ProcessingException
Specified by:
delete in interface SyncInvoker
Throws:
ProcessingException

delete

public <T> T delete(Class<T> responseType)
         throws ProcessingException,
                WebApplicationException
Specified by:
delete in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

delete

public <T> T delete(GenericType<T> responseType)
         throws ProcessingException,
                WebApplicationException
Specified by:
delete in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

head

public Response head()
              throws ProcessingException
Specified by:
head in interface SyncInvoker
Throws:
ProcessingException

options

public Response options()
                 throws ProcessingException
Specified by:
options in interface SyncInvoker
Throws:
ProcessingException

options

public <T> T options(Class<T> responseType)
          throws ProcessingException,
                 WebApplicationException
Specified by:
options in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

options

public <T> T options(GenericType<T> responseType)
          throws ProcessingException,
                 WebApplicationException
Specified by:
options in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

trace

public Response trace()
               throws ProcessingException
Specified by:
trace in interface SyncInvoker
Throws:
ProcessingException

trace

public <T> T trace(Class<T> responseType)
        throws ProcessingException,
               WebApplicationException
Specified by:
trace in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

trace

public <T> T trace(GenericType<T> responseType)
        throws ProcessingException,
               WebApplicationException
Specified by:
trace in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

method

public Response method(String name)
                throws ProcessingException
Specified by:
method in interface SyncInvoker
Throws:
ProcessingException

method

public <T> T method(String name,
                    Class<T> responseType)
         throws ProcessingException,
                WebApplicationException
Specified by:
method in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

method

public <T> T method(String name,
                    GenericType<T> responseType)
         throws ProcessingException,
                WebApplicationException
Specified by:
method in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

method

public Response method(String name,
                       Entity<?> entity)
                throws ProcessingException
Specified by:
method in interface SyncInvoker
Throws:
ProcessingException

method

public <T> T method(String name,
                    Entity<?> entity,
                    Class<T> responseType)
         throws ProcessingException,
                WebApplicationException
Specified by:
method in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

method

public <T> T method(String name,
                    Entity<?> entity,
                    GenericType<T> responseType)
         throws ProcessingException,
                WebApplicationException
Specified by:
method in interface SyncInvoker
Throws:
ProcessingException
WebApplicationException

property

public JerseyInvocation.Builder property(String name,
                                         Object value)
Specified by:
property in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Class<?> providerClass)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Class<?> providerClass,
                                         int bindingPriority)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Class<?> providerClass,
                                         Class<?>... contracts)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Class<?> providerClass,
                                         Map<Class<?>,Integer> contracts)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Object provider)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Object provider,
                                         int bindingPriority)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Object provider,
                                         Class<?>... contracts)
Specified by:
register in interface Configurable<Invocation.Builder>

register

public JerseyInvocation.Builder register(Object provider,
                                         Map<Class<?>,Integer> contracts)
Specified by:
register in interface Configurable<Invocation.Builder>

replaceWith

public JerseyInvocation.Builder replaceWith(Configuration config)
Specified by:
replaceWith in interface Configurable<Invocation.Builder>

getConfiguration

public ClientConfig getConfiguration()
Specified by:
getConfiguration in interface Configurable<Invocation.Builder>

preInitialize

public JerseyInvocation.Builder preInitialize()
Pre initializes the configuration of this invocation builder in order to improve performance during the first request.

Once this method is called no other method implementing Configurable must be called on this pre initialized invocation builder otherwise invocation builder will change back to uninitialized.

Returns:
Jersey invocation builder.


Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.