Class HTTPVaultConnectorBuilder

  • All Implemented Interfaces:
    VaultConnectorBuilder

    public final class HTTPVaultConnectorBuilder
    extends Object
    implements VaultConnectorBuilder
    Vault Connector Builder implementation for HTTP Vault connectors.
    Since:
    0.8.0
    Author:
    Stefan Kalscheuer
    • Constructor Detail

      • HTTPVaultConnectorBuilder

        public HTTPVaultConnectorBuilder()
        Default empty constructor. Initializes factory with default values.
    • Method Detail

      • withHost

        public HTTPVaultConnectorBuilder withHost​(String host)
        Set hostname (default: 127.0.0.1).
        Parameters:
        host - Hostname or IP address
        Returns:
        self
      • withTLS

        public HTTPVaultConnectorBuilder withTLS​(boolean useTLS)
        Set TLS usage (default: TRUE).
        Parameters:
        useTLS - use TLS or not
        Returns:
        self
      • withTLS

        public HTTPVaultConnectorBuilder withTLS​(boolean useTLS,
                                                 String version)
        Set TLS usage (default: TRUE).
        Parameters:
        useTLS - Use TLS or not.
        version - Supported TLS version (TLSv1.2, TLSv1.1, TLSv1.0, TLS).
        Returns:
        self
        Since:
        0.8 Added version parameter (#22).
      • withTLS

        public HTTPVaultConnectorBuilder withTLS​(String version)
        Convenience Method for TLS usage (enabled by default).
        Parameters:
        version - Supported TLS version (TLSv1.2, TLSv1.1, TLSv1.0, TLS).
        Returns:
        self
        Since:
        0.8 Added version parameter (#22).
      • withPrefix

        public HTTPVaultConnectorBuilder withPrefix​(String prefix)
        Set API prefix. Default is "/v1/" and changes should not be necessary for current state of development.
        Parameters:
        prefix - Vault API prefix (default: "/v1/"
        Returns:
        self
      • withTrustedCA

        public HTTPVaultConnectorBuilder withTrustedCA​(X509Certificate cert)
        Add a trusted CA certificate for HTTPS connections.
        Parameters:
        cert - path to certificate file
        Returns:
        self
        Since:
        0.8.0
      • withNumberOfRetries

        public HTTPVaultConnectorBuilder withNumberOfRetries​(int numberOfRetries)
        Define the number of retries to attempt on 5xx errors.
        Parameters:
        numberOfRetries - The number of retries to attempt on 5xx errors (default: 0)
        Returns:
        self
        Since:
        0.6.0
      • withTimeout

        public HTTPVaultConnectorBuilder withTimeout​(int milliseconds)
        Define a custom timeout for the HTTP connection.
        Parameters:
        milliseconds - Timeout value in milliseconds.
        Returns:
        self
        Since:
        0.6.0