Package org.apache.cxf.jaxrs.client
Class JAXRSClientFactory
java.lang.Object
org.apache.cxf.jaxrs.client.JAXRSClientFactory
Factory for creating proxy clients.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TCreates a proxystatic <T> Tcreate(String baseAddress, Class<T> cls, ClassLoader loader) Creates a proxy using a custom class loaderstatic <T> TCreates a proxystatic <T> TCreates a proxystatic <T> TCreates a proxy which will do basic authenticationstatic <T> TCreates a proxystatic <T> TCreates a thread safe proxystatic <T> TCreates a thread safe proxy and allows to specify time to keep state.static <T> TCreates a proxystatic <T> Tcreate(String baseAddress, Class<T> cls, List<?> providers, String username, String password, String configLocation) Creates a proxy which will do basic authenticationstatic <T> Tcreate(String baseAddress, Class<T> cls, List<?> providers, List<org.apache.cxf.feature.Feature> features, String configLocation) Creates a proxystatic <T> Tcreate(String baseAddress, Class<T> cls, List<?> providers, Map<String, Object> properties, boolean threadSafe) Creates a thread safe proxystatic <T> TCreates a proxystatic <T> TCreates a proxystatic <T> TCreates a proxystatic <T> TcreateFromModel(String baseAddress, Class<T> cls, String modelRef, String configLocation) Creates a proxy using user resource modelstatic <T> TcreateFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, boolean threadSafe) Creates a thread safe proxy using user resource modelstatic <T> TcreateFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, long timeToKeepState) Creates a thread safe proxy using user resource model and allows to specify time to keep state.static <T> TcreateFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, String configLocation) Creates a proxy using user resource modelstatic <T> TcreateFromModel(String baseAddress, Class<T> cls, List<org.apache.cxf.jaxrs.model.UserResource> modelBeans, String configLocation) Creates a proxy using user resource modelstatic <T> TcreateFromModel(String baseAddress, Class<T> cls, List<org.apache.cxf.jaxrs.model.UserResource> modelBeans, List<?> providers, String configLocation) Creates a proxy using user resource modelstatic <T> TfromClient(Client client, Class<T> cls) Creates a proxy, baseURI will be set to Client currentURIstatic <T> TfromClient(Client client, Class<T> cls, boolean inheritHeaders) Creates a proxy, baseURI will be set to Client currentURI
-
Method Details
-
create
Creates a proxy- Parameters:
baseAddress- baseAddresscls- resource class, if not interface then a CGLIB proxy will be created- Returns:
- typed proxy
-
create
Creates a proxy using a custom class loader- Parameters:
baseAddress- baseAddressloader- class loadercls- resource class, if not interface then a CGLIB proxy will be created- Returns:
- typed proxy
-
create
Creates a proxy- Parameters:
baseURI- baseURIcls- resource class, if not interface then a CGLIB proxy will be created- Returns:
- typed proxy
-
create
Creates a proxy- Parameters:
baseURI- baseURIcls- resource class, if not interface then a CGLIB proxy will be createdinheritHeaders- if true then existing proxy headers will be inherited by subresource proxies if any- Returns:
- typed proxy
-
create
Creates a proxy- Parameters:
baseAddress- baseAddrescls- resource class, if not interface then a CGLIB proxy will be createdproperties- additional properties- Returns:
- typed proxy
-
create
Creates a proxy- Parameters:
baseAddress- baseAddresscls- resource class, if not interface then a CGLIB proxy will be createdconfigLocation- classpath location of the 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- baseAddresscls- 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}"configLocation- classpath location of the configuration resourcevarValues- values to replace root Path template variables- Returns:
- typed proxy
-
create
Creates a proxy- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providers- Returns:
- typed proxy
-
create
Creates a thread safe proxy- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providersthreadSafe- 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, Map<String, Object> properties, boolean threadSafe) Creates a thread safe proxy- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providersthreadSafe- if true then a thread-safe proxy will be createdproperties- additional properties- Returns:
- typed proxy
-
create
public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, long timeToKeepState) Creates a thread safe proxy and allows to specify time to keep state.- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providerstimeToKeepState- how long to keep this state- Returns:
- typed proxy
-
create
public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, String configLocation) Creates a proxy- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providersconfigLocation- classpath location of the configuration resource- Returns:
- typed proxy
-
create
public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, List<org.apache.cxf.feature.Feature> features, String configLocation) Creates a proxy- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providersfeatures- the features which will be applied to the clientconfigLocation- classpath location of the 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- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdusername- usernamepassword- passwordconfigLocation- classpath location of the configuration resource- Returns:
- typed proxy
-
create
public static <T> T create(String baseAddress, Class<T> cls, List<?> providers, String username, String password, String configLocation) Creates a proxy which will do basic authentication- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdproviders- list of providersusername- usernamepassword- passwordconfigLocation- classpath location of the 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- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdmodelRef- 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- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdmodelRef- model locationproviders- list of providersconfigLocation- classpath location of the configuration resource- 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- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdmodelRef- model locationproviders- list of providersthreadSafe- if true then thread-safe proxy will be created- Returns:
- typed proxy
-
createFromModel
public static <T> T createFromModel(String baseAddress, Class<T> cls, String modelRef, List<?> providers, long timeToKeepState) Creates a thread safe proxy using user resource model and allows to specify time to keep state.- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdmodelRef- model locationproviders- list of providerstimeToKeepState- how long to keep this state- Returns:
- typed proxy
-
createFromModel
public static <T> T createFromModel(String baseAddress, Class<T> cls, List<org.apache.cxf.jaxrs.model.UserResource> modelBeans, String configLocation) Creates a proxy using user resource model- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdmodelBeans- model beansconfigLocation- classpath location of the configuration resource- Returns:
- typed proxy
-
createFromModel
public static <T> T createFromModel(String baseAddress, Class<T> cls, List<org.apache.cxf.jaxrs.model.UserResource> modelBeans, List<?> providers, String configLocation) Creates a proxy using user resource model- Parameters:
baseAddress- baseAddresscls- proxy class, if not interface then a CGLIB proxy will be createdmodelBeans- model beansproviders- list of providersconfigLocation- classpath location of the configuration resource- Returns:
- typed proxy
-
fromClient
Creates a proxy, baseURI will be set to Client currentURI- Parameters:
client- Client instancecls- proxy class, if not interface then a CGLIB proxy will be created- Returns:
- typed proxy
-
fromClient
Creates a proxy, baseURI will be set to Client currentURI- Parameters:
client- Client instancecls- proxy class, if not interface then a CGLIB proxy will be createdinheritHeaders- if true then existing Client headers will be inherited by new proxy and subresource proxies if any- Returns:
- typed proxy
-