Class ServerConfBuilder


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

      • setPort

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

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

        public ServerConfBuilder 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 ServerConfBuilder setAuthenticationMethod​(String method)
        Sets the authentication mode.
        Parameters:
        method - the authentication method.
        Returns:
        this.
      • setAuthenticationRealm

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

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

        public ServerConfBuilder 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 ServerConfBuilder setAuthenticationRestricted​(String roles)
        Sets the authentication roles.
        Parameters:
        roles - the authentication roles.
        Returns:
        this.
      • setAuthenticationUsers

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

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

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

        public ServerConfBuilder 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 ServerConfBuilder 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 ServerConfBuilder 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 ServerConfBuilder setTrustStoreLocation​(String trustStoreLocation)
        Sets the location of the trust store file.
        Parameters:
        trustStoreLocation - the location of the trust store file.
        Returns:
        this.
      • setTrustStorePassword

        public ServerConfBuilder 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 ServerConfBuilder 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 ServerConfBuilder enableHeadlessMode()
        Enables the headless mode.
        Returns:
        this
      • disableHeadlessMode

        public ServerConfBuilder disableHeadlessMode()
        Disables the headless mode.
        Returns:
        this
      • build

        public Conf build()