Class CommandFactory.Builder

    • Method Detail

      • raiseTlsErrors

        public CommandFactory.Builder raiseTlsErrors​(boolean raise)
        Define if TLS errors should raise an error when executing requests or if they should be ignored. Setting this to false is required as the docker-db uses a self-signed certificate.

        Defaults to raise TLS errors.

        Parameters:
        raise - true if the CommandFactory should fail for TLS errors, false if it should ignore TLS errors.
        Returns:
        this instance for method chaining
      • certificate

        public CommandFactory.Builder certificate​(X509Certificate certificate)
        Use the given certificate for TLS connections.

        Defaults to using the certificates from the JVMs default key store.

        Mutually exclusive with setting raiseTlsErrors(boolean) to false.

        Parameters:
        certificate - certificate to use
        Returns:
        this instance for method chaining
      • serverUrl

        public CommandFactory.Builder serverUrl​(String serverUrl)
        Set the URL of the RPC interface, e.g. "https://<hostname>:443/jrpc".
        Parameters:
        serverUrl - RPC interface URL
        Returns:
        this instance for method chaining
        Throws:
        IllegalArgumentException - the URL has an invalid format
      • bearerTokenAuthentication

        public CommandFactory.Builder bearerTokenAuthentication​(String token)
        Authenticate via the given bearer token.
        Parameters:
        token - bearer token
        Returns:
        this instance for method chaining
      • basicAuthentication

        public CommandFactory.Builder basicAuthentication​(String username,
                                                          String password)
        Authenticate via basic authentication.
        Parameters:
        username - username for authenticating against the RPC interface
        password - password for authenticating against the RPC interface
        Returns:
        this instance for method chaining