Package com.sodius.oslc.client
Interface OslcClientFactory
public interface OslcClientFactory
Instantiates an OslcClient.
This interface is not intended to be implemented by clients.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAssigns a default attribute to inject on everyOslcResourceused by the OslcClient created with this factory.create()Instantiates an OslcClient.Assigns a default header to inject on every request executed by the OslcClient created with this factory.locale(Enumeration<Locale> locales) Informs the factory of the preferred locales, in case error messages shall be generated.Informs the factory of the preferred locales, in case error messages shall be generated.proxy(org.apache.http.HttpHost proxy) Gives the factory the proxy to use for executing HTTP requests.proxyCredentials(org.apache.http.auth.Credentials credentials) Gives the factory the credentials to use for proxy.
-
Method Details
-
create
OslcClient create()Instantiates an OslcClient.- Returns:
- a new OslcClient instance.
-
attribute
Assigns a default attribute to inject on everyOslcResourceused by the OslcClient created with this factory.An attribute can also be used to tweak the configuration of the underlying HttpClient:
com.sodius.oslc.client.http.socket.timeout- anint(orStringrepresenting anint) to configure the socket timeout, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.com.sodius.oslc.client.http.connection.timeout- anint(orStringrepresenting anint) to configure the timeout until a connection is established.com.sodius.oslc.client.http.conn-manager.timeout- anint(orStringrepresenting anint) to configure the timeout when requesting a connection from the connection manager.org.apache.http.HttpRequestInterceptor- an instance oforg.apache.http.HttpRequestInterceptorto intercept each request.org.apache.http.HttpResponseInterceptor- an instance oforg.apache.http.HttpResponseInterceptorto intercept each response.org.apache.http.client.config.RequestConfig- an instance ofRequestConfigto use instead of the default one.org.apache.http.conn.HttpClientConnectionManager- an instance oforg.apache.http.conn.HttpClientConnectionManagerto use instead of the default one.org.apache.http.conn.routing.HttpRoutePlanner- an instance ofHttpRoutePlannerto use instead of the default one.org.apache.http.conn.ssl.SSLConnectionSocketFactory- an instance ofSSLConnectionSocketFactoryto use instead of the default one.javax.net.ssl.TrustManager- an instance ofjavax.net.ssl.TrustManagerto use instead of the default one.
- Parameters:
name- the attribute name.value- the attribute value.- Returns:
- the receiver
- Since:
- 1.14.0
- See Also:
-
header
Assigns a default header to inject on every request executed by the OslcClient created with this factory.- Parameters:
name- the header name.value- the header value (the header is ignored if the value isnullor empty)- Returns:
- the receiver
-
locale
Informs the factory of the preferred locales, in case error messages shall be generated.- Parameters:
locales- the locales, in order of preference- Returns:
- the receiver
-
locale
Informs the factory of the preferred locales, in case error messages shall be generated.- Parameters:
locales- the locales, in order of preference- Returns:
- the receiver
-
proxy
Gives the factory the proxy to use for executing HTTP requests. Also useproxyCredentials()method if proxy requires authentication.When a proxy is not explicitly set with this method, the underlying client will use standard Java system properties (e.g.
https.proxyHostandhttps.proxyPort), if present, for configuring the proxy.- Parameters:
proxy- the proxy to use- Returns:
- the receiver
- Since:
- 1.14.0
- See Also:
-
proxyCredentials
Gives the factory the credentials to use for proxy.- Parameters:
credentials- the credentials to use for proxy.- Returns:
- the receiver
- Since:
- 1.14.0
- See Also:
-