public class VariableDefinitionManagerImpl extends Object implements VariableDefinitionManager
Constructor and Description |
---|
VariableDefinitionManagerImpl(VariableDefinitionDao variableDefinitionDao,
AuditLogService auditLogService,
EncryptedVariableDefinitionAccessor encryptedVariableDefinitionAccessor) |
Modifier and Type | Method and Description |
---|---|
int |
countDeploymentEnvironmentVariables(long environmentId)
Count list of environment variables associated with a given deployment environment
|
VariableContextBuilder |
createVariableContextBuilder() |
void |
deleteVariableDefinition(VariableDefinition variableDefinition)
Delete variable definition
|
void |
deleteVariablesForPlan(Plan plan)
Removes variable definitions form specified plan
|
VariableDefinition |
findVariableDefinition(long id)
Find variable definition of specified id
|
List<VariableDefinition> |
getDeploymentEnvironmentVariables(long environmentId)
Get list of environment variables associated with a given deployment environment
|
List<VariableDefinition> |
getDeploymentVersionVariables(long deploymentVersionId)
Get list of environment variables associated with a given deployment version
|
List<VariableDefinition> |
getGlobalNotOverriddenEnvironmentVariables(long environmentId) |
List<VariableDefinition> |
getGlobalNotOverriddenVariables(long projectId)
Get list of all global variables that are not overridden by project variables for a given project
|
List<VariableDefinition> |
getGlobalNotOverriddenVariables(PlanIdentifier plan)
Get list of all global variables that are not overridden by plan or project variables for a given plan
|
VariableDefinition |
getGlobalVariableByKey(String key)
Retrieves a specific global variable by key.
|
List<VariableDefinition> |
getGlobalVariables()
Get list of all global variables
|
List<VariableDefinition> |
getInheritedNotOverriddenVariables(PlanIdentifier plan)
Get list of all variables that are inherited by plan, that is all global, project and (in case of branches) default plan variables that are not overridden by a plan or plan branch.
|
List<VariableDefinition> |
getInheritedVariables(PlanIdentifier plan)
Get list of all variables that are inherited by plan, that is all global, project and (in case of branches) default plan variables.
|
VariableDefinition |
getPlanVariableByKey(PlanIdentifier plan,
String key)
Retrieves a specific variable for the plan with the given key
|
List<VariableDefinition> |
getPlanVariables(PlanIdentifier plan)
Get list of plan variables associated with a given plan
|
List<VariableDefinition> |
getProjectVariables(long projectId)
Get list of environment variables associated with a given project
|
Map<String,String> |
getSimpleVariableMapByType(VariableContext variableContext,
VariableType variableType)
Filter variable context by variable type and return as simple key/value map
|
void |
remove(VariableDefinition variableDefinition) |
void |
save(VariableDefinition variableDefinition) |
void |
saveVariableDefinition(VariableDefinition variableDefinition)
Save variable definition
|
void |
saveVariableDefinition(VariableDefinition variableDefinition,
String previousValue)
Save variable definition
|
void |
saveVariableDefinitions(List<VariableDefinition> variableDefinitions)
Save all variable definitions on the list
|
public VariableDefinitionManagerImpl(VariableDefinitionDao variableDefinitionDao, AuditLogService auditLogService, EncryptedVariableDefinitionAccessor encryptedVariableDefinitionAccessor)
@Nullable public VariableDefinition findVariableDefinition(long id)
VariableDefinitionAccessor
findVariableDefinition
in interface VariableDefinitionAccessor
id
- id of variable definitionpublic void saveVariableDefinition(@NotNull VariableDefinition variableDefinition)
VariableDefinitionManager
saveVariableDefinition
in interface VariableDefinitionManager
variableDefinition
- variable definition to be savedpublic void saveVariableDefinition(@NotNull VariableDefinition variableDefinition, @Nullable String previousValue)
VariableDefinitionManager
saveVariableDefinition
in interface VariableDefinitionManager
variableDefinition
- variable definition to be savedpreviousValue
- previous variable valuepublic void deleteVariableDefinition(@NotNull VariableDefinition variableDefinition)
VariableDefinitionManager
deleteVariableDefinition
in interface VariableDefinitionManager
variableDefinition
- variable definition to be deletedpublic void deleteVariablesForPlan(@NotNull Plan plan)
VariableDefinitionManager
deleteVariablesForPlan
in interface VariableDefinitionManager
@NotNull public List<VariableDefinition> getGlobalVariables()
VariableDefinitionAccessor
getGlobalVariables
in interface VariableDefinitionAccessor
@Nullable public VariableDefinition getGlobalVariableByKey(String key)
VariableDefinitionAccessor
getGlobalVariableByKey
in interface VariableDefinitionAccessor
key
- of the variable@Nullable public VariableDefinition getPlanVariableByKey(@NotNull PlanIdentifier plan, @NotNull String key)
VariableDefinitionAccessor
getPlanVariableByKey
in interface VariableDefinitionAccessor
plan
- variable belongs tokey
- of variable@NotNull public List<VariableDefinition> getPlanVariables(@NotNull PlanIdentifier plan)
VariableDefinitionAccessor
getPlanVariables
in interface VariableDefinitionAccessor
plan
- Plan whose associated variables should be returned@NotNull public List<VariableDefinition> getProjectVariables(long projectId)
VariableDefinitionAccessor
getProjectVariables
in interface VariableDefinitionAccessor
projectId
- id of a Projectpublic int countDeploymentEnvironmentVariables(long environmentId)
VariableDefinitionAccessor
countDeploymentEnvironmentVariables
in interface VariableDefinitionAccessor
environmentId
- id of Deployment environment@NotNull public List<VariableDefinition> getDeploymentEnvironmentVariables(long environmentId)
VariableDefinitionAccessor
getDeploymentEnvironmentVariables
in interface VariableDefinitionAccessor
environmentId
- id of Deployment environment@NotNull public List<VariableDefinition> getDeploymentVersionVariables(long deploymentVersionId)
VariableDefinitionAccessor
getDeploymentVersionVariables
in interface VariableDefinitionAccessor
deploymentVersionId
- id of Deployment environment@NotNull public List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull PlanIdentifier plan)
VariableDefinitionAccessor
getGlobalNotOverriddenVariables
in interface VariableDefinitionAccessor
plan
- Plan whose associated variables should be used@NotNull public List<VariableDefinition> getInheritedVariables(@NotNull PlanIdentifier plan)
VariableDefinitionAccessor
getInheritedVariables
in interface VariableDefinitionAccessor
@NotNull public List<VariableDefinition> getInheritedNotOverriddenVariables(@NotNull PlanIdentifier plan)
VariableDefinitionAccessor
getInheritedNotOverriddenVariables
in interface VariableDefinitionAccessor
@NotNull public List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull long projectId)
VariableDefinitionAccessor
getGlobalNotOverriddenVariables
in interface VariableDefinitionAccessor
projectId
- id of a project@NotNull public List<VariableDefinition> getGlobalNotOverriddenEnvironmentVariables(long environmentId)
getGlobalNotOverriddenEnvironmentVariables
in interface VariableDefinitionAccessor
@NotNull public Map<String,String> getSimpleVariableMapByType(@NotNull VariableContext variableContext, @NotNull VariableType variableType)
VariableDefinitionAccessor
getSimpleVariableMapByType
in interface VariableDefinitionAccessor
@NotNull public VariableContextBuilder createVariableContextBuilder()
createVariableContextBuilder
in interface VariableDefinitionManager
public void remove(VariableDefinition variableDefinition)
public void save(VariableDefinition variableDefinition)
public void saveVariableDefinitions(List<VariableDefinition> variableDefinitions)
VariableDefinitionManager
saveVariableDefinitions
in interface VariableDefinitionManager
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.