Package com.sodius.oslc.client
Interface OslcClientFactory
-
public interface OslcClientFactoryInstantiates an OslcClient.This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OslcClientFactoryattribute(String name, Object value)Assigns a default attribute to inject on everyOslcResourceused by the OslcClient created with this factory.OslcClientcreate()Instantiates an OslcClient.OslcClientFactoryheader(String name, String value)Assigns a default header to inject on every request executed by the OslcClient created with this factory.OslcClientFactorylocale(Enumeration<Locale> locales)Informs the factory of the preferred locales, in case error messages shall be generated.OslcClientFactorylocale(Locale... locales)Informs the factory of the preferred locales, in case error messages shall be generated.OslcClientFactoryproxy(org.apache.http.HttpHost proxy)Gives the factory the proxy to use for executing HTTP requests.OslcClientFactoryproxyCredentials(org.apache.http.auth.Credentials credentials)Gives the factory the credentials to use for proxy.
-
-
-
Method Detail
-
create
OslcClient create()
Instantiates an OslcClient.- Returns:
- a new OslcClient instance.
-
attribute
OslcClientFactory attribute(String name, Object value)
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.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:
OslcResource.attribute(String, Object)
-
header
OslcClientFactory header(String name, String value)
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
OslcClientFactory locale(Locale... locales)
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
OslcClientFactory locale(Enumeration<Locale> locales)
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
OslcClientFactory proxy(org.apache.http.HttpHost 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(Credentials)
-
proxyCredentials
OslcClientFactory proxyCredentials(org.apache.http.auth.Credentials credentials)
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:
proxy(HttpHost)
-
-