Class GroupConfiguration
java.lang.Object
eu.cloudnetservice.driver.service.ServiceConfigurationBase
eu.cloudnetservice.driver.service.GroupConfiguration
- All Implemented Interfaces:
Named,DefaultedDocPropertyHolder,DocPropertyHolder,Cloneable
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a builder for a group configuration.Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>> -
Field Summary
FieldsFields inherited from class eu.cloudnetservice.driver.service.ServiceConfigurationBase
deployments, includes, properties, templates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGroupConfiguration(@NonNull String name, @NonNull Set<String> jvmOptions, @NonNull Set<String> processParameters, @NonNull Map<String, String> environmentVariables, @NonNull Set<String> targetEnvironments, @NonNull Set<ServiceTemplate> templates, @NonNull Set<ServiceDeployment> deployments, @NonNull Set<ServiceRemoteInclusion> includes, @NonNull Document properties) Constructs a new group configuration instance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance to create a group configuration.builder(@NonNull GroupConfiguration group) Constructs a new builder which inherits the properties of the given group configuration, allowing to change certain properties of a group.clone()Get the environment variables which should get appended to all environments of services which are created based on this configuration.Get the jvm options which should get applied to the service command line.name()Get the unique name identifier of this object in the related scope.Get the process parameters which should get appended to the command line.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.Methods inherited from class eu.cloudnetservice.driver.service.ServiceConfigurationBase
deployments, inclusions, propertyHolder, templatesMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Field Details
-
name
-
jvmOptions
-
processParameters
-
environmentVariables
-
targetEnvironments
-
-
Constructor Details
-
GroupConfiguration
protected GroupConfiguration(@NonNull @NonNull String name, @NonNull @NonNull Set<String> jvmOptions, @NonNull @NonNull Set<String> processParameters, @NonNull @NonNull Map<String, String> environmentVariables, @NonNull @NonNull Set<String> targetEnvironments, @NonNull @NonNull Set<ServiceTemplate> templates, @NonNull @NonNull Set<ServiceDeployment> deployments, @NonNull @NonNull Set<ServiceRemoteInclusion> includes, @NonNull @NonNull Document properties) Constructs a new group configuration instance.- Parameters:
name- the name of the group.jvmOptions- the jvm options of the group to apply to all services inheriting from it.processParameters- the process parameters of the group to apply to all services inheriting from it.environmentVariables- the environment variables to apply to all services inheriting from it.targetEnvironments- the environments to apply this group configuration to.templates- the templates of the group to apply to all services inheriting from it.deployments- the deployments of the group to apply to all services inheriting from it.includes- the includes of the group to apply to all services inheriting from it.properties- the properties for extra information to store.- Throws:
NullPointerException- if one of the given parameters is null.
-
-
Method Details
-
builder
Constructs a new builder instance to create a group configuration.- Returns:
- a new builder for a group.
-
builder
@NonNull public static @NonNull GroupConfiguration.Builder builder(@NonNull @NonNull GroupConfiguration group) 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
-
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:
jvmOptionsin classServiceConfigurationBase- Returns:
- the jvm options to set for services created based on this configuration.
-
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:
processParametersin classServiceConfigurationBase- Returns:
- the process parameters to set for services created based on this configuration.
-
environmentVariables
Get the environment variables which should get appended to all environments of services which are created based on this configuration.- Specified by:
environmentVariablesin classServiceConfigurationBase- Returns:
- the environment variables to set for services created based on this configuration.
-
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
-