public class OslcClients extends Object
Modifier and Type | Method and Description |
---|---|
static OslcClientFactory |
basic(org.apache.http.auth.Credentials credentials)
Returns a factory to create an OSLC client handling BASIC authentication.
|
static OslcClientFactory |
basic(org.apache.http.client.CredentialsProvider credentialsProvider)
Returns a factory to create an OSLC client handling BASIC authentication,
with possibly various credentials being used depending on the server to address.
|
static OslcClient |
concurrent(OslcClient client)
Returns a thread-safe OSLC client meant to be used with an
Executor . |
static OslcClientFactory |
concurrent(OslcClientFactory factory)
Returns a factory to create a thread-safe OSLC client meant to be used with an
Executor . |
static org.apache.http.client.HttpClient |
createHttpClient()
Returns an HTTP client configured to execute HTTPS requests.
|
static OslcClientFactory |
jazzForm(org.apache.http.auth.Credentials credentials)
Returns a factory to create an OSLC client to connect to an IBM Jazz server,
using FORM based authentication.
|
static OslcClientFactory |
jazzForm(org.apache.http.client.CredentialsProvider credentialsProvider)
Returns a factory to create an OSLC client to connect to an IBM Jazz server,
using FORM based authentication, with possibly various credentials being used depending on the server to address.
|
static OslcClientFactory |
oauth(OAuthStore oauthStore,
OAuthHandler oauthHandler)
Returns a factory to create an OSLC client handling OAUTH authentication.
|
static OslcClientFactory |
unauthenticated()
Returns a factory to create an authentication-free OSLC client.
|
public static org.apache.http.client.HttpClient createHttpClient()
public static OslcClientFactory basic(org.apache.http.auth.Credentials credentials)
credentials
- the credentials to use when executing OSLC requests on the server.public static OslcClientFactory basic(org.apache.http.client.CredentialsProvider credentialsProvider)
credentialsProvider
- provides credentials which may vary depending on the targeted host.public static OslcClientFactory unauthenticated()
public static OslcClientFactory jazzForm(org.apache.http.auth.Credentials credentials)
credentials
- the credentials to use when executing OSLC requests on the server.public static OslcClientFactory jazzForm(org.apache.http.client.CredentialsProvider credentialsProvider)
credentialsProvider
- provides credentials which may vary depending on the targeted host.public static OslcClientFactory oauth(OAuthStore oauthStore, OAuthHandler oauthHandler)
Returns a factory to create an OSLC client handling OAUTH authentication.
An OAuthStore is used to store OAuth approved tokens for a specific user. Instantiate an OAuthStore and OslcClientFactory for each user requesting OSLC resources.
oauthStore
- the store from where OAuth tokens are requested and kept when approved.oauthHandler
- the handler enabling adapting the support of the OAuth protocol.public static OslcClientFactory concurrent(OslcClientFactory factory)
Returns a factory to create a thread-safe OSLC client meant to be used with an Executor
.
The returned factory shall be used to instantiate one OslcClient that can safely be shared for parallel requests executions. The OslcClient
instantiated by the factory uses a ThreadLocal to ensure one underlying client is used per thread. The OslcClient can safely be used by
Callable
instances executed with an ExecutorService
.
factory
- the underlying factory used to create an OSLC client, when a client is first needed for a specific thread.public static OslcClient concurrent(OslcClient client)
Returns a thread-safe OSLC client meant to be used with an Executor
.
The returned OslcClient can safely be shared for parallel requests executions. It uses a ThreadLocal to ensure one underlying client is used
per thread. The OslcClient can safely be used by Callable
instances executed with an ExecutorService
.
client
- the OslcClient whose factory can be used to created additional clients (one per thread).