Class Configuration

java.lang.Object
org.noise_planet.noisemodelling.webserver.Configuration

public class Configuration extends Object
Manage webserver configuration
  • Field Details

  • Constructor Details

    • Configuration

      public Configuration(boolean unsecure)
  • Method Details

    • createConfigurationFromArguments

      public static Configuration createConfigurationFromArguments(String[] args) throws IllegalArgumentException
      Creates a Configuration object from command-line arguments (backward compatible entry point). Delegates to createConfigurationFromCommandLine(String[], Options) using default options.
      Parameters:
      args - command-line arguments
      Returns:
      Configuration with properties set according to command-line arguments
      Throws:
      IllegalArgumentException - if required options are missing or invalid
    • buildOptions

      public static org.apache.commons.cli.Options buildOptions()
      Build the CLI Options definition used for both CLI and JSON parsing. Required flags defined here are also enforced when parsing from JSON.
    • createConfigurationFromCommandLine

      public static Configuration createConfigurationFromCommandLine(String[] args, org.apache.commons.cli.Options options) throws IllegalArgumentException
      Creates a Configuration object from command-line arguments using the provided Options definition.
      Parameters:
      args - command-line arguments
      options - Apache Commons CLI options definition
      Returns:
      Configuration configured from CLI
      Throws:
      IllegalArgumentException - if parsing fails
    • getApplicationRootUrl

      public String getApplicationRootUrl()
      Returns the application root URL.
      Returns:
      the application root URL
    • setApplicationRootUrl

      public void setApplicationRootUrl(String applicationRootUrl)
      Sets the application root URL.
      Parameters:
      applicationRootUrl - the application root URL to set
    • getScriptPath

      public String getScriptPath()
      Returns the script path.
      Returns:
      the script path
    • setScriptPath

      public void setScriptPath(String scriptPath)
      Sets the script path.
      Parameters:
      scriptPath - the script path to set
    • isUnsecure

      public boolean isUnsecure()
      Returns whether the server is in unsecure mode.
      Returns:
      true if unsecure mode is enabled, false otherwise
    • getWorkingDirectory

      public String getWorkingDirectory()
      Returns the working directory path.
      Returns:
      the working directory
    • setWorkingDirectory

      public void setWorkingDirectory(String workingDirectory)
      Sets the working directory path.
      Parameters:
      workingDirectory - the working directory to set
    • getSecureBaseEncryptionSecret

      public String getSecureBaseEncryptionSecret()
      Returns the encryption secret for the secure base.
      Returns:
      the secure base encryption secret
    • setSecureBaseEncryptionSecret

      public void setSecureBaseEncryptionSecret(String secureBaseEncryptionSecret)
      Sets the encryption secret for the secure base.
      Parameters:
      secureBaseEncryptionSecret - the encryption secret to set
    • getSecureBaseAdminUser

      public String getSecureBaseAdminUser()
      Returns the secure base admin user.
      Returns:
      the secure base admin user
    • setSecureBaseAdminUser

      public void setSecureBaseAdminUser(String secureBaseAdminUser)
      Sets the secure base admin user.
      Parameters:
      secureBaseAdminUser - the admin user to set
    • getSecureBaseAdminPassword

      public String getSecureBaseAdminPassword()
      Returns the secure base admin password.
      Returns:
      the secure base admin password
    • setSecureBaseAdminPassword

      public void setSecureBaseAdminPassword(String secureBaseAdminPassword)
      Sets the secure base admin password.
      Parameters:
      secureBaseAdminPassword - the admin password to set
    • getCustomConfiguration

      public Map<String,Object> getCustomConfiguration()
      Returns the custom configuration map.
      Returns:
      the custom configuration
    • setCustomConfiguration

      public void setCustomConfiguration(Map<String,Object> customConfiguration)
      Sets the custom configuration map.
      Parameters:
      customConfiguration - the custom configuration to set
    • getPort

      public int getPort()
      Returns:
      Server port
    • getWebSiteFullUrl

      public String getWebSiteFullUrl()
      Returns:
      Return the full website url to type in the browser window
    • setPort

      public void setPort(int port)
      Parameters:
      port - Server port