Package com.atlassian.bamboo.variable
Class VariableConfigurationServiceImpl
java.lang.Object
com.atlassian.bamboo.variable.VariableConfigurationServiceImpl
- All Implemented Interfaces:
VariableConfigurationService
public class VariableConfigurationServiceImpl
extends Object
implements VariableConfigurationService
-
Constructor Summary
ConstructorDescriptionVariableConfigurationServiceImpl
(@NotNull ScopedExclusionService scopedExclusionService, @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull VariableDefinitionFactory variableDefinitionFactory) -
Method Summary
Modifier and TypeMethodDescription@NotNull VariableDefinition
createGlobalVariable
(@NotNull String variableKey, @NotNull String variableValue) Creates new Global variable.@NotNull VariableDefinition
createPlanVariable
(@NotNull Plan plan, @NotNull String variableKey, @NotNull String variableValue) Creates new Plan variable.createProjectVariable
(long projectId, @NotNull String variableKey, @NotNull String variableValue) Create a project variable.@NotNull VariableDefinition
createUniqueGlobalVariable
(@NotNull String variableKey, @NotNull String variableValue) Creates new global variable.@NotNull VariableDefinition
createUniquePlanVariable
(@NotNull Plan plan, @NotNull String variableKey, @NotNull String variableValue) Creates new Plan variable.@NotNull VariableDefinition
createVariableForEnvironment
(long environmentId, @NotNull String variableKey, @NotNull String variableValue) Creates new variable for Deployment Environmentvoid
deleteVariableDefinition
(@NotNull VariableDefinition variableDefinition) RemovesVariableDefinition
void
setDeploymentEnvironmentVariables
(long environmentId, @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete deployment environment variables list.void
setPlanVariables
(@NotNull Chain plan, @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete plan variables list.void
setProjectVariables
(long projectId, @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete project variables list.@NotNull VariableDefinition
updateVariableDefinition
(@NotNull VariableDefinition variableDefinition, String previousValue) UpdatesVariableDefinition
-
Constructor Details
-
VariableConfigurationServiceImpl
public VariableConfigurationServiceImpl(@NotNull @NotNull ScopedExclusionService scopedExclusionService, @NotNull @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull @NotNull VariableDefinitionFactory variableDefinitionFactory)
-
-
Method Details
-
createUniquePlanVariable
@NotNull public @NotNull VariableDefinition createUniquePlanVariable(@NotNull @NotNull Plan plan, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Description copied from interface:VariableConfigurationService
Creates new Plan variable. If a variable with the same key prefix and value already exists nothing will be created and existing variable is returned. If a variable with the same key but different value already exists, this method will add unique suffix to the key and create a new variable.- Specified by:
createUniquePlanVariable
in interfaceVariableConfigurationService
- Parameters:
plan
- plan the variable belongs tovariableKey
- variable key.variableValue
- variable value- Returns:
- created
VariableDefinition
-
createUniqueGlobalVariable
@NotNull public @NotNull VariableDefinition createUniqueGlobalVariable(@NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Description copied from interface:VariableConfigurationService
Creates new global variable. If a variable with the same key prefix and value already exists nothing will be created and existing variable is returned. If a variable with the same key but different value already exists, this method will add unique suffix to the key and create a new variable.- Specified by:
createUniqueGlobalVariable
in interfaceVariableConfigurationService
- Parameters:
variableKey
- variable key.variableValue
- variable value- Returns:
- created
VariableDefinition
-
createPlanVariable
@NotNull public @NotNull VariableDefinition createPlanVariable(@NotNull @NotNull Plan plan, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Description copied from interface:VariableConfigurationService
Creates new Plan variable.- Specified by:
createPlanVariable
in interfaceVariableConfigurationService
- Parameters:
plan
- plan the variable belongs tovariableKey
- variable key.variableValue
- variable value- Returns:
- created
VariableDefinition
-
createVariableForEnvironment
@NotNull public @NotNull VariableDefinition createVariableForEnvironment(long environmentId, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Description copied from interface:VariableConfigurationService
Creates new variable for Deployment Environment- Specified by:
createVariableForEnvironment
in interfaceVariableConfigurationService
variableKey
- variable key.variableValue
- variable value- Returns:
- created
VariableDefinition
-
createProjectVariable
public VariableDefinition createProjectVariable(long projectId, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Description copied from interface:VariableConfigurationService
Create a project variable.- Specified by:
createProjectVariable
in interfaceVariableConfigurationService
- Returns:
-
createGlobalVariable
@NotNull public @NotNull VariableDefinition createGlobalVariable(@NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Description copied from interface:VariableConfigurationService
Creates new Global variable.- Specified by:
createGlobalVariable
in interfaceVariableConfigurationService
variableValue
- variable value- Returns:
- created
VariableDefinition
-
updateVariableDefinition
@NotNull public @NotNull VariableDefinition updateVariableDefinition(@NotNull @NotNull VariableDefinition variableDefinition, String previousValue) Description copied from interface:VariableConfigurationService
UpdatesVariableDefinition
- Specified by:
updateVariableDefinition
in interfaceVariableConfigurationService
-
deleteVariableDefinition
Description copied from interface:VariableConfigurationService
RemovesVariableDefinition
- Specified by:
deleteVariableDefinition
in interfaceVariableConfigurationService
-
setPlanVariables
public void setPlanVariables(@NotNull @NotNull Chain plan, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Description copied from interface:VariableConfigurationService
Creates complete plan variables list. All pre-existing variables are updated to values provided or removed if new value is not provided. New variables are created if necessary.- Specified by:
setPlanVariables
in interfaceVariableConfigurationService
-
setProjectVariables
public void setProjectVariables(long projectId, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Description copied from interface:VariableConfigurationService
Creates complete project variables list. All pre-existing variables are updated to values provided or removed if new value is not provided. New variables are created if necessary.- Specified by:
setProjectVariables
in interfaceVariableConfigurationService
-
setDeploymentEnvironmentVariables
public void setDeploymentEnvironmentVariables(long environmentId, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Description copied from interface:VariableConfigurationService
Creates complete deployment environment variables list. All pre-existing variables are updated to values provided or removed if new value is not provided. New variables are created if necessary.- Specified by:
setDeploymentEnvironmentVariables
in interfaceVariableConfigurationService
-