Package com.sodius.oslc.client
Interface OslcClientFactory
-
public interface OslcClientFactory
Instantiates 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 OslcClientFactory
attribute(String name, Object value)
Assigns a default attribute to inject on everyOslcResource
used by the OslcClient created with this factory.OslcClient
create()
Instantiates an OslcClient.OslcClientFactory
header(String name, String value)
Assigns a default header to inject on every request executed by the OslcClient created with this factory.OslcClientFactory
locale(Enumeration<Locale> locales)
Informs the factory of the preferred locales, in case error messages shall be generated.OslcClientFactory
locale(Locale... locales)
Informs the factory of the preferred locales, in case error messages shall be generated.OslcClientFactory
proxy(org.apache.http.HttpHost proxy)
Gives the factory the proxy to use for executing HTTP requests.OslcClientFactory
proxyCredentials(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 everyOslcResource
used 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
(orString
representing 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
(orString
representing anint
) to configure the timeout until a connection is established.com.sodius.oslc.client.http.conn-manager.timeout
- anint
(orString
representing anint
) to configure the timeout when requesting a connection from the connection manager.org.apache.http.client.config.RequestConfig
- an instance ofRequestConfig
to use instead of the default one.org.apache.http.conn.HttpClientConnectionManager
- an instance oforg.apache.http.conn.HttpClientConnectionManager
to use instead of the default one.org.apache.http.conn.routing.HttpRoutePlanner
- an instance ofHttpRoutePlanner
to use instead of the default one.org.apache.http.conn.ssl.SSLConnectionSocketFactory
- an instance ofSSLConnectionSocketFactory
to use instead of the default one.javax.net.ssl.TrustManager
- an instance ofjavax.net.ssl.TrustManager
to 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 isnull
or 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.proxyHost
andhttps.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)
-
-