Interface VariableDefinitionAccessor

All Known Subinterfaces:
EncryptedVariableDefinitionAccessor, VariableDefinitionManager
All Known Implementing Classes:
VariableDefinitionAccessorImpl, VariableDefinitionManagerImpl

@PublicApi public interface VariableDefinitionAccessor
Fetches variable definitions for different contexts.
  • Method Details

    • findVariableDefinition

      @Nullable @Nullable VariableDefinition findVariableDefinition(long id)
      Find variable definition of specified id
      Parameters:
      id - id of variable definition
      Returns:
      variable definition of specified id or null if not found
    • getGlobalVariables

      @NotNull @NotNull List<VariableDefinition> getGlobalVariables()
      Get list of all global variables
      Returns:
      sorted list of all global variables
    • findAllProjectsIdsUsingProjectVariables

      @NotNull @NotNull List<Long> findAllProjectsIdsUsingProjectVariables()
      Get list of all project variables
      Returns:
      sorted list of all project variables
    • countAllProjectsVariables

      @NotNull @NotNull Long countAllProjectsVariables()
      Count all project variables.
      Returns:
      Long count of project variables.
    • getGlobalVariableByKey

      @Nullable @Nullable VariableDefinition getGlobalVariableByKey(String key)
      Retrieves a specific global variable by key.
      Parameters:
      key - of the variable
      Returns:
      global variable with specified key or null if none found.
    • getPlanVariableByKey

      @Nullable @Nullable VariableDefinition getPlanVariableByKey(@NotNull @NotNull PlanIdentifier plan, @NotNull @NotNull String key)
      Retrieves a specific variable for the plan with the given key
      Parameters:
      plan - variable belongs to
      key - of variable
      Returns:
      plan variable with specified key or null if none found.
    • getPlanVariables

      @NotNull @NotNull List<VariableDefinition> getPlanVariables(@NotNull @NotNull PlanIdentifier plan)
      Get list of plan variables associated with a given plan
      Parameters:
      plan - Plan whose associated variables should be returned
      Returns:
      sorted list of plan variables
    • countDeploymentEnvironmentVariables

      int countDeploymentEnvironmentVariables(long environmentId)
      Count list of environment variables associated with a given deployment environment
      Parameters:
      environmentId - id of Deployment environment
      Returns:
      Since:
      5.15
    • getDeploymentEnvironmentVariables

      @NotNull @NotNull List<VariableDefinition> getDeploymentEnvironmentVariables(long environmentId)
      Get list of environment variables associated with a given deployment environment
      Parameters:
      environmentId - id of Deployment environment
      Returns:
      sorted list of variables
      Since:
      5.0
    • getDeploymentVersionVariables

      @NotNull @NotNull List<VariableDefinition> getDeploymentVersionVariables(long deploymentVersionId)
      Get list of environment variables associated with a given deployment version
      Parameters:
      deploymentVersionId - id of Deployment environment
      Returns:
      sorted list of variables
      Since:
      5.0
    • getGlobalNotOverriddenVariables

      @Deprecated @NotNull @NotNull List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull @NotNull PlanIdentifier plan)
      Deprecated.
      Get list of all global variables that are not overridden by plan or project variables for a given plan
      Parameters:
      plan - Plan whose associated variables should be used
      Returns:
      sorted list of global only variables
    • getInheritedVariables

      @NotNull @NotNull List<VariableDefinition> getInheritedVariables(@NotNull @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.
      Returns:
      sorted list of global and project variables
    • getInheritedNotOverriddenVariables

      @NotNull @NotNull List<VariableDefinition> getInheritedNotOverriddenVariables(@NotNull @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.
      Returns:
      sorted list of global and project variables
    • getGlobalNotOverriddenVariables

      @NotNull @NotNull List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull @org.jetbrains.annotations.NotNull long projectId)
      Get list of all global variables that are not overridden by project variables for a given project
      Parameters:
      projectId - id of a project
      Returns:
      sorted list of global only variables
    • getGlobalNotOverriddenEnvironmentVariables

      @NotNull @NotNull List<VariableDefinition> getGlobalNotOverriddenEnvironmentVariables(long environmentId)
    • getSimpleVariableMapByType

      @NotNull @NotNull Map<String,String> getSimpleVariableMapByType(@NotNull @NotNull VariableContext variableContext, @NotNull @NotNull VariableType variableType)
      Filter variable context by variable type and return as simple key/value map
      Parameters:
      variableContext -
      variableType -
      Returns:
    • getProjectVariables

      @NotNull @NotNull List<VariableDefinition> getProjectVariables(long projectId)
      Get list of environment variables associated with a given project
      Parameters:
      projectId - id of a Project
      Returns:
      sorted list of variables
      Since:
      7.1