Package com.atlassian.bamboo.variable
Class VariableDefinitionAccessorImpl
- java.lang.Object
-
- com.atlassian.bamboo.variable.VariableDefinitionAccessorImpl
-
- All Implemented Interfaces:
EncryptedVariableDefinitionAccessor
,VariableDefinitionAccessor
public class VariableDefinitionAccessorImpl extends Object implements EncryptedVariableDefinitionAccessor
-
-
Constructor Summary
Constructors Constructor Description VariableDefinitionAccessorImpl(VariableDefinitionDao variableDefinitionDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Long
countAllProjectsVariables()
Count all project variables.int
countDeploymentEnvironmentVariables(long environmentId)
Count list of environment variables associated with a given deployment environment@NotNull List<Long>
findAllProjectsIdsUsingProjectVariables()
Get list of all project variables@Nullable VariableDefinition
findVariableDefinition(long id)
Find variable definition of specified id@NotNull List<VariableDefinition>
getDeploymentEnvironmentVariables(long environmentId)
Get list of environment variables associated with a given deployment environment@NotNull List<VariableDefinition>
getDeploymentVersionVariables(long deploymentVersionId)
Get list of environment variables associated with a given deployment version@NotNull List<VariableDefinition>
getGlobalNotOverriddenEnvironmentVariables(long environmentId)
@NotNull List<VariableDefinition>
getGlobalNotOverriddenVariables(@org.jetbrains.annotations.NotNull long projectId)
Get list of all global variables that are not overridden by project variables for a given project@NotNull List<VariableDefinition>
getGlobalNotOverriddenVariables(@NotNull PlanIdentifier plan)
Get list of all global variables that are not overridden by plan or project variables for a given plan@Nullable VariableDefinition
getGlobalVariableByKey(String key)
Retrieves a specific global variable by key.@NotNull List<VariableDefinition>
getGlobalVariables()
Get list of all global variables@NotNull List<VariableDefinition>
getInheritedNotOverriddenVariables(@NotNull 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.@NotNull List<VariableDefinition>
getInheritedVariables(@NotNull 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.@Nullable VariableDefinition
getPlanVariableByKey(@NotNull PlanIdentifier plan, @NotNull String key)
Retrieves a specific variable for the plan with the given key@NotNull List<VariableDefinition>
getPlanVariables(@NotNull PlanIdentifier plan)
Get list of plan variables associated with a given plan@NotNull List<VariableDefinition>
getProjectVariables(long projectId)
Get list of environment variables associated with a given project@NotNull Map<String,String>
getSimpleVariableMapByType(@NotNull VariableContext variableContext, @NotNull VariableType variableType)
Filter variable context by variable type and return as simple key/value map
-
-
-
Constructor Detail
-
VariableDefinitionAccessorImpl
public VariableDefinitionAccessorImpl(VariableDefinitionDao variableDefinitionDao)
-
-
Method Detail
-
findVariableDefinition
@Nullable public @Nullable VariableDefinition findVariableDefinition(long id)
Description copied from interface:VariableDefinitionAccessor
Find variable definition of specified id- Specified by:
findVariableDefinition
in interfaceVariableDefinitionAccessor
- Parameters:
id
- id of variable definition- Returns:
- variable definition of specified id or null if not found
-
getGlobalVariables
@NotNull public @NotNull List<VariableDefinition> getGlobalVariables()
Description copied from interface:VariableDefinitionAccessor
Get list of all global variables- Specified by:
getGlobalVariables
in interfaceVariableDefinitionAccessor
- Returns:
- sorted list of all global variables
-
findAllProjectsIdsUsingProjectVariables
@NotNull public @NotNull List<Long> findAllProjectsIdsUsingProjectVariables()
Description copied from interface:VariableDefinitionAccessor
Get list of all project variables- Specified by:
findAllProjectsIdsUsingProjectVariables
in interfaceVariableDefinitionAccessor
- Returns:
- sorted list of all project variables
-
countAllProjectsVariables
@NotNull public @NotNull Long countAllProjectsVariables()
Description copied from interface:VariableDefinitionAccessor
Count all project variables.- Specified by:
countAllProjectsVariables
in interfaceVariableDefinitionAccessor
- Returns:
- Long count of project variables.
-
getGlobalVariableByKey
@Nullable public @Nullable VariableDefinition getGlobalVariableByKey(String key)
Description copied from interface:VariableDefinitionAccessor
Retrieves a specific global variable by key.- Specified by:
getGlobalVariableByKey
in interfaceVariableDefinitionAccessor
- Parameters:
key
- of the variable- Returns:
- global variable with specified key or null if none found.
-
getPlanVariableByKey
@Nullable public @Nullable VariableDefinition getPlanVariableByKey(@NotNull @NotNull PlanIdentifier plan, @NotNull @NotNull String key)
Description copied from interface:VariableDefinitionAccessor
Retrieves a specific variable for the plan with the given key- Specified by:
getPlanVariableByKey
in interfaceVariableDefinitionAccessor
- Parameters:
plan
- variable belongs tokey
- of variable- Returns:
- plan variable with specified key or null if none found.
-
getPlanVariables
@NotNull public @NotNull List<VariableDefinition> getPlanVariables(@NotNull @NotNull PlanIdentifier plan)
Description copied from interface:VariableDefinitionAccessor
Get list of plan variables associated with a given plan- Specified by:
getPlanVariables
in interfaceVariableDefinitionAccessor
- Parameters:
plan
- Plan whose associated variables should be returned- Returns:
- sorted list of plan variables
-
countDeploymentEnvironmentVariables
public int countDeploymentEnvironmentVariables(long environmentId)
Description copied from interface:VariableDefinitionAccessor
Count list of environment variables associated with a given deployment environment- Specified by:
countDeploymentEnvironmentVariables
in interfaceVariableDefinitionAccessor
- Parameters:
environmentId
- id of Deployment environment- Returns:
-
getDeploymentEnvironmentVariables
@NotNull public @NotNull List<VariableDefinition> getDeploymentEnvironmentVariables(long environmentId)
Description copied from interface:VariableDefinitionAccessor
Get list of environment variables associated with a given deployment environment- Specified by:
getDeploymentEnvironmentVariables
in interfaceVariableDefinitionAccessor
- Parameters:
environmentId
- id of Deployment environment- Returns:
- sorted list of variables
-
getDeploymentVersionVariables
@NotNull public @NotNull List<VariableDefinition> getDeploymentVersionVariables(long deploymentVersionId)
Description copied from interface:VariableDefinitionAccessor
Get list of environment variables associated with a given deployment version- Specified by:
getDeploymentVersionVariables
in interfaceVariableDefinitionAccessor
- Parameters:
deploymentVersionId
- id of Deployment environment- Returns:
- sorted list of variables
-
getProjectVariables
@NotNull public @NotNull List<VariableDefinition> getProjectVariables(long projectId)
Description copied from interface:VariableDefinitionAccessor
Get list of environment variables associated with a given project- Specified by:
getProjectVariables
in interfaceVariableDefinitionAccessor
- Parameters:
projectId
- id of a Project- Returns:
- sorted list of variables
-
getGlobalNotOverriddenVariables
@NotNull public @NotNull List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull @org.jetbrains.annotations.NotNull long projectId)
Description copied from interface:VariableDefinitionAccessor
Get list of all global variables that are not overridden by project variables for a given project- Specified by:
getGlobalNotOverriddenVariables
in interfaceVariableDefinitionAccessor
- Parameters:
projectId
- id of a project- Returns:
- sorted list of global only variables
-
getGlobalNotOverriddenVariables
@NotNull public @NotNull List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull @NotNull PlanIdentifier plan)
Description copied from interface:VariableDefinitionAccessor
Get list of all global variables that are not overridden by plan or project variables for a given plan- Specified by:
getGlobalNotOverriddenVariables
in interfaceVariableDefinitionAccessor
- Parameters:
plan
- Plan whose associated variables should be used- Returns:
- sorted list of global only variables
-
getInheritedVariables
@NotNull public @NotNull List<VariableDefinition> getInheritedVariables(@NotNull @NotNull PlanIdentifier plan)
Description copied from interface:VariableDefinitionAccessor
Get list of all variables that are inherited by plan, that is all global, project and (in case of branches) default plan variables.- Specified by:
getInheritedVariables
in interfaceVariableDefinitionAccessor
- Returns:
- sorted list of global and project variables
-
getInheritedNotOverriddenVariables
@NotNull public @NotNull List<VariableDefinition> getInheritedNotOverriddenVariables(@NotNull @NotNull PlanIdentifier plan)
Description copied from interface:VariableDefinitionAccessor
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.- Specified by:
getInheritedNotOverriddenVariables
in interfaceVariableDefinitionAccessor
- Returns:
- sorted list of global and project variables
-
getGlobalNotOverriddenEnvironmentVariables
@NotNull public @NotNull List<VariableDefinition> getGlobalNotOverriddenEnvironmentVariables(long environmentId)
- Specified by:
getGlobalNotOverriddenEnvironmentVariables
in interfaceVariableDefinitionAccessor
-
getSimpleVariableMapByType
@NotNull public @NotNull Map<String,String> getSimpleVariableMapByType(@NotNull @NotNull VariableContext variableContext, @NotNull @NotNull VariableType variableType)
Description copied from interface:VariableDefinitionAccessor
Filter variable context by variable type and return as simple key/value map- Specified by:
getSimpleVariableMapByType
in interfaceVariableDefinitionAccessor
- Returns:
-
-