public class RestClientFactory extends Object
Factory for creating jersey Client instances that can deserialize json returned from the Confluence REST API into confluence java api model objects.
Example usage :
Client client = RestClientFactory.newClient();
Consumers who need to register additional jersey providers might do the following :
JacksonJsonProvider defaultProvider = RestClientFactory.createProvider(RestClientFactory.createJacksonModule()); MyDelegatingProvider extraProvider = new MyDelegatingProvider(defaultProvider); Client client = RestClientFactory.newClient(defaultProvider, extraProvider);
Constructor and Description |
---|
RestClientFactory() |
Modifier and Type | Method and Description |
---|---|
static com.sun.jersey.api.client.config.ClientConfig |
createConfig(Object... providers)
Helper method to create a jersey client config with the given providers registered.
|
static org.codehaus.jackson.map.Module |
createJacksonModule() |
static org.codehaus.jackson.jaxrs.JacksonJsonProvider |
createProvider(org.codehaus.jackson.map.Module jacksonModule)
Creates
Provider instance to perform custom serialization needed for
using the remote API model objects. |
static com.sun.jersey.api.client.Client |
newClient()
Create a client with default configuration suitable for remotely communicating with the
Confluence REST API.
|
static com.sun.jersey.api.client.Client |
newClient(org.codehaus.jackson.map.Module jacksonModule) |
static com.sun.jersey.api.client.Client |
newClient(Object provider,
Object... providers) |
public static com.sun.jersey.api.client.Client newClient()
public static com.sun.jersey.api.client.Client newClient(org.codehaus.jackson.map.Module jacksonModule)
public static com.sun.jersey.api.client.Client newClient(Object provider, Object... providers)
public static com.sun.jersey.api.client.config.ClientConfig createConfig(Object... providers)
providers
- instances of providers annotated with Provider
public static org.codehaus.jackson.map.Module createJacksonModule()
public static org.codehaus.jackson.jaxrs.JacksonJsonProvider createProvider(org.codehaus.jackson.map.Module jacksonModule)
Provider
instance to perform custom serialization needed for
using the remote API model objects. Registers the jacksonModule with the provider.jacksonModule
- custom serialization module to register with the providerCopyright © 2003–2016 Atlassian. All rights reserved.