Class GroupConfiguration

java.lang.Object
eu.cloudnetservice.driver.service.ServiceConfigurationBase
eu.cloudnetservice.driver.service.GroupConfiguration
All Implemented Interfaces:
Named, DefaultedDocPropertyHolder, DocPropertyHolder, Cloneable

public class GroupConfiguration extends ServiceConfigurationBase implements Cloneable, Named
Represents a group configuration. A group is used to combine multiple tasks and/or environments together and allows including shared jvm options, process parameters, templates, deployments and includes.
Since:
4.0
  • Field Details

    • name

      protected final String name
    • jvmOptions

      protected final Set<String> jvmOptions
    • processParameters

      protected final Set<String> processParameters
    • environmentVariables

      protected final Map<String,String> environmentVariables
    • targetEnvironments

      protected final Set<String> targetEnvironments
  • Constructor Details

  • Method Details

    • builder

      @NonNull public static @NonNull GroupConfiguration.Builder builder()
      Constructs a new builder instance to create a group configuration.
      Returns:
      a new builder for a group.
    • builder

      Constructs a new builder which inherits the properties of the given group configuration, allowing to change certain properties of a group. This is useful if you have a group which already exists and just want to change a specific option of it.

      Calling the build method right after creating the builder will result in a new group which is identical to the given group.

      Parameters:
      group - the group to copy the properties of.
      Returns:
      a new builder which holds the same properties as the given group.
      Throws:
      NullPointerException - if the given group configuration is null.
    • name

      @NonNull public @NonNull String name()
      Get the unique name identifier of this object in the related scope.
      Specified by:
      name in interface Named
      Returns:
      the unique name identifier of this object in the related scope.
    • jvmOptions

      Get the jvm options which should get applied to the service command line. JVM options are there to configure the behaviour of the jvm, for example the garbage collector.
      Specified by:
      jvmOptions in class ServiceConfigurationBase
      Returns:
      the jvm options to set for services created based on this configuration.
    • processParameters

      @NonNull public @Unmodifiable @NonNull Collection<String> processParameters()
      Get the process parameters which should get appended to the command line. Process parameters are there to configure the application, for example setting an option like --online-mode=true.
      Specified by:
      processParameters in class ServiceConfigurationBase
      Returns:
      the process parameters to set for services created based on this configuration.
    • environmentVariables

      @NonNull public @Unmodifiable @NonNull Map<String,String> environmentVariables()
      Get the environment variables which should get appended to all environments of services which are created based on this configuration.
      Specified by:
      environmentVariables in class ServiceConfigurationBase
      Returns:
      the environment variables to set for services created based on this configuration.
    • targetEnvironments

      @NonNull public @Unmodifiable @NonNull Collection<String> targetEnvironments()
      Get the environments to which this group configuration will always be applied, even if the base task of a service does not implement the group directly. An example use case is a global template which should be applied to all proxies.
      Returns:
      the environments to apply this group configuration always to.
    • clone

      Overrides:
      clone in class Object