Class LauncherSettings

java.lang.Object
com.codingchili.core.configuration.system.LauncherSettings
All Implemented Interfaces:
Configurable, Serializable

public class LauncherSettings extends Object implements Configurable
Contains the settings for the launcher.
See Also:
Serialized Form
  • Constructor Details

    • LauncherSettings

      public LauncherSettings()
  • Method Details

    • getPath

      public String getPath()
      Description copied from interface: Configurable
      Get the path of a loaded configuration file.
      Specified by:
      getPath in interface Configurable
      Returns:
      the directory path to the configuration file.
    • getVersion

      public String getVersion()
      Returns:
      the launcher version.
    • setVersion

      public LauncherSettings setVersion(String version)
      Parameters:
      version - sets the launcher version.
      Returns:
      fluent
    • isWarnOnDefaultsLoaded

      public boolean isWarnOnDefaultsLoaded()
      Returns:
      true if a warning should be logged when a configuration file is not found and the configurable is loaded from the java class. To avoid these errors add your java configurable to the Configuration.
    • setWarnOnDefaultsLoaded

      public LauncherSettings setWarnOnDefaultsLoaded(boolean warnOnDefaultsLoaded)
      Parameters:
      warnOnDefaultsLoaded - set to true to disable warnings when default settings are loaded. Default settings will be loaded when the path to a configurable is not available.
      Returns:
      fluent
    • getBlocks

      public HashMap<String,​List<String>> getBlocks()
      Returns:
      get the configured deployment blocks.
    • setBlocks

      public LauncherSettings setBlocks(HashMap<String,​List<String>> blocks)
      Parameters:
      blocks - set the configured deployment blocks.
      Returns:
      fluent
    • getBlock

      public List<String> getBlock(String block)
      Parameters:
      block - name of the block to retrieve
      Returns:
      a list of services attached to the block
    • addBlock

      public LauncherSettings addBlock(String name, List<String> blocks)
      Parameters:
      name - the name of the service block to add
      blocks - a list of nodes to be deployed
      Returns:
      fluent
    • getHosts

      public HashMap<String,​String> getHosts()
      Returns:
      a list of hosts mapped to blocks.
    • setHosts

      public LauncherSettings setHosts(HashMap<String,​String> hosts)
      Parameters:
      hosts - sets the host to block mapping.
      Returns:
      fluent
    • addHost

      public LauncherSettings addHost(String host, String block)
      Parameters:
      host - the host that should be mapped to a service block
      block - the block that the host should be mapped to
      Returns:
      fluent
    • getConfigurationDirectory

      public String getConfigurationDirectory()
      Returns:
      the path to the configuration directory to use.
    • setConfigurationDirectory

      public void setConfigurationDirectory(String configurationDirectory)
      Parameters:
      configurationDirectory - the path to the configuration directory to use.
    • getApplication

      public String getApplication()
      Returns:
      the configured application name.
    • setApplication

      public LauncherSettings setApplication(String application)
      Parameters:
      application - set the name of the application.
      Returns:
      fluent
    • hosts

      public HashMap<String,​String> hosts()
      Returns:
      a list of hosts mapped to blocks.
    • blocks

      public HashMap<String,​List<String>> blocks()
      Returns:
      names of blocks, each with a list of services attached.
    • deployable

      public LauncherSettings deployable(Class service)
      Sets the given service class as the default block to be deployed.
      Parameters:
      service - the service to be deployed
      Returns:
      fluent
    • isClustered

      public boolean isClustered()
      Returns:
      true if clustering is enabled.
    • setClustered

      public LauncherSettings setClustered(boolean clustering)
      Parameters:
      clustering - enables or disables clustering.
      Returns:
      fluent
    • getAuthor

      public String getAuthor()
      Returns:
      author string used in startup text.
    • setAuthor

      public LauncherSettings setAuthor(String author)
      Parameters:
      author - set the author string visible in the startup text.
      Returns:
      the author of the application