Apache CXF API

org.apache.cxf.jaxrs.client
Class JAXRSClientFactory

java.lang.Object
  extended by org.apache.cxf.jaxrs.client.JAXRSClientFactory

public final class JAXRSClientFactory
extends Object

Factory for creating proxy clients.


Method Summary
static
<T> T
create(String baseAddress, Class<T> cls)
          Creates a proxy
static
<T> T
create(String baseAddress, Class<T> cls, List<?> providers)
          Creates a proxy
static
<T> T
create(String baseAddress, Class<T> cls, List<?> providers, boolean threadSafe)
          Creates a thread safe proxy
static
<T> T
create(String baseAddress, Class<T> cls, List<?> providers, String configLocation)
          Creates a proxy
static
<T> T
create(String baseAddress, Class<T> cls, String configLocation)
          Creates a proxy
static
<T> T
create(String baseAddress, Class<T> cls, String configLocation, Object... varValues)
          Creates a proxy
static
<T> T
create(String baseAddress, Class<T> cls, String username, String password, String configLocation)
          Creates a proxy which will do basic authentication
static
<T> T
create(URI baseURI, Class<T> cls)
          Creates a proxy
static
<T> T
create(URI baseURI, Class<T> cls, boolean inheritHeaders)
          Creates a proxy
static
<T> T
createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, List<?> providers, String configLocation)
          Creates a proxy using user resource model
static
<T> T
createFromModel(String baseAddress, Class<T> cls, List<UserResource> modelBeans, String configLocation)
          Creates a proxy using user resource model
static
<T> T
createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, boolean threadSafe)
          Creates a thread safe proxy using user resource model
static
<T> T
createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, String configLocation)
          Creates a proxy using user resource model
static
<T> T
createFromModel(String baseAddress, Class<T> cls, String modelRef, String configLocation)
          Creates a proxy using user resource model
static
<T> T
fromClient(Client client, Class<T> cls)
          Creates a proxy, baseURI will be set to Client currentURI
static
<T> T
fromClient(Client client, Class<T> cls, boolean inheritHeaders)
          Creates a proxy, baseURI will be set to Client currentURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static <T> T create(String baseAddress,
                           Class<T> cls)
Creates a proxy

Parameters:
baseAddress - baseAddress
cls - resource class, if not interface then a CGLIB proxy will be created
Returns:
typed proxy

create

public static <T> T create(URI baseURI,
                           Class<T> cls)
Creates a proxy

Parameters:
baseURI - baseURI
cls - resource class, if not interface then a CGLIB proxy will be created
Returns:
typed proxy

create

public static <T> T create(URI baseURI,
                           Class<T> cls,
                           boolean inheritHeaders)
Creates a proxy

Parameters:
baseURI - baseURI
cls - resource class, if not interface then a CGLIB proxy will be created
inheritHeaders - if true then existing proxy headers will be inherited by subresource proxies if any
Returns:
typed proxy

create

public static <T> T create(String baseAddress,
                           Class<T> cls,
                           String configLocation)
Creates a proxy

Parameters:
baseAddress - baseAddress
cls - resource class, if not interface then a CGLIB proxy will be created
config - classpath location of Spring configuration resource
Returns:
typed proxy

create

public static <T> T create(String baseAddress,
                           Class<T> cls,
                           String configLocation,
                           Object... varValues)
Creates a proxy

Parameters:
baseAddress - baseAddress
cls - resource class, if not interface then a CGLIB proxy will be created This class is expected to have a root JAXRS Path annotation containing template variables, for ex, "/path/{id1}/{id2}"
config - classpath location of Spring configuration resource
varValues - values to replace root Path template variables
Returns:
typed proxy

create

public static <T> T create(String baseAddress,
                           Class<T> cls,
                           List<?> providers)
Creates a proxy

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
providers - list of providers
Returns:
typed proxy

create

public static <T> T create(String baseAddress,
                           Class<T> cls,
                           List<?> providers,
                           boolean threadSafe)
Creates a thread safe proxy

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
providers - list of providers
threadSafe - if true then a thread-safe proxy will be created
Returns:
typed proxy

create

public static <T> T create(String baseAddress,
                           Class<T> cls,
                           List<?> providers,
                           String configLocation)
Creates a proxy

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
providers - list of providers
config - classpath location of Spring configuration resource
Returns:
typed proxy

create

public static <T> T create(String baseAddress,
                           Class<T> cls,
                           String username,
                           String password,
                           String configLocation)
Creates a proxy which will do basic authentication

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
username - username
password - password
config - classpath location of Spring configuration resource
Returns:
typed proxy

createFromModel

public static <T> T createFromModel(String baseAddress,
                                    Class<T> cls,
                                    String modelRef,
                                    String configLocation)
Creates a proxy using user resource model

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
modelRef - model location
Returns:
typed proxy

createFromModel

public static <T> T createFromModel(String baseAddress,
                                    Class<T> cls,
                                    String modelRef,
                                    List<?> providers,
                                    String configLocation)
Creates a proxy using user resource model

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
modelRef - model location
providers - list of providers
Returns:
typed proxy

createFromModel

public static <T> T createFromModel(String baseAddress,
                                    Class<T> cls,
                                    String modelRef,
                                    List<?> providers,
                                    boolean threadSafe)
Creates a thread safe proxy using user resource model

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
modelRef - model location
providers - list of providers
threadSafe - if true then thread-safe proxy will be created
Returns:
typed proxy

createFromModel

public static <T> T createFromModel(String baseAddress,
                                    Class<T> cls,
                                    List<UserResource> modelBeans,
                                    String configLocation)
Creates a proxy using user resource model

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
modelBeans - model beans
Returns:
typed proxy

createFromModel

public static <T> T createFromModel(String baseAddress,
                                    Class<T> cls,
                                    List<UserResource> modelBeans,
                                    List<?> providers,
                                    String configLocation)
Creates a proxy using user resource model

Parameters:
baseAddress - baseAddress
cls - proxy class, if not interface then a CGLIB proxy will be created
modelBeans - model beans
providers - list of providers
Returns:
typed proxy

fromClient

public static <T> T fromClient(Client client,
                               Class<T> cls)
Creates a proxy, baseURI will be set to Client currentURI

Parameters:
client - Client instance
cls - proxy class, if not interface then a CGLIB proxy will be created
Returns:
typed proxy

fromClient

public static <T> T fromClient(Client client,
                               Class<T> cls,
                               boolean inheritHeaders)
Creates a proxy, baseURI will be set to Client currentURI

Parameters:
client - Client instance
cls - proxy class, if not interface then a CGLIB proxy will be created
inheritHeaders - if true then existing Client headers will be inherited by new proxy and subresource proxies if any
Returns:
typed proxy

Apache CXF API

Apache CXF