Interface OslcClientFactory

    • 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 every OslcResource 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 - an int (or String representing an int) 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 - an int (or String representing an int) to configure the timeout until a connection is established.
        • com.sodius.oslc.client.http.conn-manager.timeout - an int (or String representing an int) to configure the timeout when requesting a connection from the connection manager.
        • org.apache.http.client.config.RequestConfig - a instance of RequestConfig to use instead of the default one.
        • org.apache.http.conn.HttpClientConnectionManager - a instance of org.apache.http.conn.HttpClientConnectionManager to use instead of the default one.
        • org.apache.http.conn.routing.HttpRoutePlanner - a instance of HttpRoutePlanner to use instead of the default one.
        • org.apache.http.conn.ssl.SSLConnectionSocketFactory - a instance of SSLConnectionSocketFactory 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 is null 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 use proxyCredentials() 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 and https.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)