Class ServerConfigBuilder


  • public class ServerConfigBuilder
    extends Object
    An helper class for build a Conf used for configuring embedded http-server.
    • Method Detail

      • setPort

        public ServerConfigBuilder setPort​(int port)
        Sets the http server port.
        Parameters:
        port - the http port.
        Returns:
        this.
      • setListener

        public ServerConfigBuilder setListener​(String listener)
        Sets the http server listener.
        Parameters:
        listener - the http listener.
        Returns:
        this.
      • enableUI

        public ServerConfigBuilder enableUI​(boolean enable)
        Sets if the Web UI must be enable.
        Parameters:
        enable - true to enable the Web UI, false otherwise.
        Returns:
        this.
      • setAuthenticationMethod

        public ServerConfigBuilder setAuthenticationMethod​(String method)
        Sets the authentication mode.
        Parameters:
        method - the authentication method.
        Returns:
        this.
      • setAuthenticationRealm

        public ServerConfigBuilder setAuthenticationRealm​(String realm)
        Sets the authentication realm.
        Parameters:
        realm - the authentication realM
        Returns:
        this.
      • setAuthenticationRoles

        public ServerConfigBuilder setAuthenticationRoles​(String roles)
        Sets the authentication roles.
        Parameters:
        roles - the authentication roles.
        Returns:
        this.
      • setBasicSilentAuthentication

        public ServerConfigBuilder setBasicSilentAuthentication​(boolean silent)
        Sets if the basic authentication must be silent. The server will respond with a 403 Forbidden HTTP response status code instead of a 401 Unauthorized (default is false).
        Parameters:
        silent - is basic authentication must be silent.
        Returns:
        this.
      • setAuthenticationRestricted

        public ServerConfigBuilder setAuthenticationRestricted​(String roles)
        Sets the authentication roles.
        Parameters:
        roles - the authentication roles.
        Returns:
        this.
      • setAuthenticationUsers

        public ServerConfigBuilder setAuthenticationUsers​(String users)
        Sets the authentication users.
        Parameters:
        users - the list users to authenticate separated by comma.
        Returns:
        this.
      • setIgnoreSslHostnameVerification

        public ServerConfigBuilder setIgnoreSslHostnameVerification​(boolean ignore)
        Enables the SSL.
        Returns:
        this.
      • setKeyStoreLocation

        public ServerConfigBuilder setKeyStoreLocation​(String keyStoreLocation)
        Sets the location of the key store file.
        Parameters:
        keyStoreLocation - the location of the key store file.
        Returns:
        this.
      • setKeyStorePassword

        public ServerConfigBuilder setKeyStorePassword​(String keyStorePassword)
        Sets the store password for the key store file.
        Parameters:
        keyStorePassword - the store password for the key store file.
        Returns:
        this.
      • setKeyStoreType

        public ServerConfigBuilder setKeyStoreType​(String keyStoreType)
        Sets the file format of the key store file.
        Parameters:
        keyStoreType - the file format of the key store file.
        Returns:
        this.
      • setKeyPassword

        public ServerConfigBuilder setKeyPassword​(String keyPassword)
        Sets the password of the private key in the key store file.
        Parameters:
        keyPassword - the password of the private key in the key store file.
        Returns:
        this.
      • setTrustStoreLocation

        public ServerConfigBuilder setTrustStoreLocation​(String trustStoreLocation)
        Sets the location of the trust store file.
        Parameters:
        trustStoreLocation - the location of the trust store file.
        Returns:
        this.
      • setTrustStorePassword

        public ServerConfigBuilder setTrustStorePassword​(String trustStorePassword)
        Sets the store password for the trust store file.
        Parameters:
        trustStorePassword - the store password for the trust store file.
        Returns:
        this.
      • setTrustStoreType

        public ServerConfigBuilder setTrustStoreType​(String trustStoreType)
        Sets the file format of the key trust file.
        Parameters:
        trustStoreType - the file format of the key trust file.
        Returns:
        this.
      • enableHeadlessMode

        public ServerConfigBuilder enableHeadlessMode()
        Enables the headless mode.
        Returns:
        this
      • disableHeadlessMode

        public ServerConfigBuilder disableHeadlessMode()
        Disables the headless mode.
        Returns:
        this