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 LongcountAllProjectsVariables()Count all project variables.intcountDeploymentEnvironmentVariables(long environmentId)Count list of environment variables associated with a given deployment environment@NotNull List<Long>findAllProjectsIdsUsingProjectVariables()Get list of all project variables@Nullable VariableDefinitionfindVariableDefinition(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 VariableDefinitiongetGlobalVariableByKey(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 VariableDefinitiongetPlanVariableByKey(@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:VariableDefinitionAccessorFind variable definition of specified id- Specified by:
findVariableDefinitionin 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:VariableDefinitionAccessorGet list of all global variables- Specified by:
getGlobalVariablesin interfaceVariableDefinitionAccessor- Returns:
- sorted list of all global variables
-
findAllProjectsIdsUsingProjectVariables
@NotNull public @NotNull List<Long> findAllProjectsIdsUsingProjectVariables()
Description copied from interface:VariableDefinitionAccessorGet list of all project variables- Specified by:
findAllProjectsIdsUsingProjectVariablesin interfaceVariableDefinitionAccessor- Returns:
- sorted list of all project variables
-
countAllProjectsVariables
@NotNull public @NotNull Long countAllProjectsVariables()
Description copied from interface:VariableDefinitionAccessorCount all project variables.- Specified by:
countAllProjectsVariablesin interfaceVariableDefinitionAccessor- Returns:
- Long count of project variables.
-
getGlobalVariableByKey
@Nullable public @Nullable VariableDefinition getGlobalVariableByKey(String key)
Description copied from interface:VariableDefinitionAccessorRetrieves a specific global variable by key.- Specified by:
getGlobalVariableByKeyin 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:VariableDefinitionAccessorRetrieves a specific variable for the plan with the given key- Specified by:
getPlanVariableByKeyin 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:VariableDefinitionAccessorGet list of plan variables associated with a given plan- Specified by:
getPlanVariablesin 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:VariableDefinitionAccessorCount list of environment variables associated with a given deployment environment- Specified by:
countDeploymentEnvironmentVariablesin interfaceVariableDefinitionAccessor- Parameters:
environmentId- id of Deployment environment- Returns:
-
getDeploymentEnvironmentVariables
@NotNull public @NotNull List<VariableDefinition> getDeploymentEnvironmentVariables(long environmentId)
Description copied from interface:VariableDefinitionAccessorGet list of environment variables associated with a given deployment environment- Specified by:
getDeploymentEnvironmentVariablesin 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:VariableDefinitionAccessorGet list of environment variables associated with a given deployment version- Specified by:
getDeploymentVersionVariablesin 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:VariableDefinitionAccessorGet list of environment variables associated with a given project- Specified by:
getProjectVariablesin 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:VariableDefinitionAccessorGet list of all global variables that are not overridden by project variables for a given project- Specified by:
getGlobalNotOverriddenVariablesin 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:VariableDefinitionAccessorGet list of all global variables that are not overridden by plan or project variables for a given plan- Specified by:
getGlobalNotOverriddenVariablesin 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:VariableDefinitionAccessorGet list of all variables that are inherited by plan, that is all global, project and (in case of branches) default plan variables.- Specified by:
getInheritedVariablesin interfaceVariableDefinitionAccessor- Returns:
- sorted list of global and project variables
-
getInheritedNotOverriddenVariables
@NotNull public @NotNull List<VariableDefinition> getInheritedNotOverriddenVariables(@NotNull @NotNull PlanIdentifier plan)
Description copied from interface:VariableDefinitionAccessorGet 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:
getInheritedNotOverriddenVariablesin interfaceVariableDefinitionAccessor- Returns:
- sorted list of global and project variables
-
getGlobalNotOverriddenEnvironmentVariables
@NotNull public @NotNull List<VariableDefinition> getGlobalNotOverriddenEnvironmentVariables(long environmentId)
- Specified by:
getGlobalNotOverriddenEnvironmentVariablesin interfaceVariableDefinitionAccessor
-
getSimpleVariableMapByType
@NotNull public @NotNull Map<String,String> getSimpleVariableMapByType(@NotNull @NotNull VariableContext variableContext, @NotNull @NotNull VariableType variableType)
Description copied from interface:VariableDefinitionAccessorFilter variable context by variable type and return as simple key/value map- Specified by:
getSimpleVariableMapByTypein interfaceVariableDefinitionAccessor- Returns:
-
-