com.atlassian.bamboo.variable
Interface VariableDefinitionManager

All Known Implementing Classes:
VariableDefinitionManagerImpl

public interface VariableDefinitionManager


Method Summary
 VariableContextBuilder createVariableContextBuilder()
           
 void deleteVariableDefinition(long id)
          Deprecated. since 4.0 use deleteVariableDefinition(VariableDefinition)
 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
 java.util.List<VariableDefinition> getGlobalNotOverriddenVariables(ImmutablePlan plan)
          Get list of all global variables that are not overridden by plan variables for a given plan
 java.util.Map<java.lang.String,VariableDefinitionContext> getGlobalVariableDefinitionMap(java.util.Map<java.lang.String,java.lang.String> manualVariables)
          Deprecated. since 4.0 use createVariableContextBuilder() instead
 java.util.List<VariableDefinition> getGlobalVariables()
          Get list of all global variables
 java.util.List<VariableDefinition> getPlanVariables(PlanIdentifier plan)
          Get list of plan variables associated with a given plan
 java.util.Map<java.lang.String,java.lang.String> getSimpleVariableMapByType(VariableContext variableContext, VariableType variableType)
          Filter variable context by variable type and return as simple key/value map
 VariableContext getVariableContext(java.util.Map<java.lang.String,java.lang.String> variables)
          Deprecated. since 4.0 use createVariableContextBuilder() instead
 java.util.Map<java.lang.String,VariableDefinitionContext> getVariableDefinitionMap(Plan plan, java.util.Map<java.lang.String,java.lang.String> manualVariables)
          Deprecated. since 4.0 use createVariableContextBuilder() instead
 void saveVariableDefinition(VariableDefinition variableDefinition)
          Save variable definition
 void saveVariableDefinition(VariableDefinition variableDefinition, java.lang.String previousValue)
          Save variable definition
 void saveVariableDefinitions(java.util.List<VariableDefinition> variableDefinitions)
          Save all variable definitions on the list
 

Method Detail

findVariableDefinition

@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

saveVariableDefinition

void saveVariableDefinition(@NotNull
                            VariableDefinition variableDefinition)
Save variable definition

Parameters:
variableDefinition - variable definition to be saved

saveVariableDefinition

void saveVariableDefinition(@NotNull
                            VariableDefinition variableDefinition,
                            @NotNull
                            java.lang.String previousValue)
Save variable definition

Parameters:
variableDefinition - variable definition to be saved
previousValue - previous variable value

deleteVariableDefinition

void deleteVariableDefinition(@NotNull
                              VariableDefinition variableDefinition)
Delete variable definition

Parameters:
variableDefinition - variable definition to be deleted

deleteVariableDefinition

@Deprecated
void deleteVariableDefinition(long id)
Deprecated. since 4.0 use deleteVariableDefinition(VariableDefinition)

Delete variable definition

Parameters:
id - id of VariableDefinition object

getGlobalVariables

@NotNull
java.util.List<VariableDefinition> getGlobalVariables()
Get list of all global variables

Returns:
sorted list of all global variables

getPlanVariables

@NotNull
java.util.List<VariableDefinition> getPlanVariables(@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

getSimpleVariableMapByType

@NotNull
java.util.Map<java.lang.String,java.lang.String> getSimpleVariableMapByType(@NotNull
                                                                                    VariableContext variableContext,
                                                                                    @NotNull
                                                                                    VariableType variableType)
Filter variable context by variable type and return as simple key/value map

Parameters:
variableContext -
variableType -
Returns:

getVariableContext

@Deprecated
@NotNull
VariableContext getVariableContext(@Nullable
                                                      java.util.Map<java.lang.String,java.lang.String> variables)
Deprecated. since 4.0 use createVariableContextBuilder() instead

Create variable context for manual variables based on simple key/value map This context contains *ONLY* manually overridden variables (used for passing manual changes set on chain level to job level contexts)

Parameters:
variables -
Returns:

getGlobalVariableDefinitionMap

@Deprecated
@NotNull
java.util.Map<java.lang.String,VariableDefinitionContext> getGlobalVariableDefinitionMap(@Nullable
                                                                                                            java.util.Map<java.lang.String,java.lang.String> manualVariables)
Deprecated. since 4.0 use createVariableContextBuilder() instead

Prepare effective variables map - variables are set and optionally overridden (if set in later stage) in following order global manual

Parameters:
manualVariables -
Returns:

getVariableDefinitionMap

@Deprecated
@NotNull
java.util.Map<java.lang.String,VariableDefinitionContext> getVariableDefinitionMap(@NotNull
                                                                                                      Plan plan,
                                                                                                      @Nullable
                                                                                                      java.util.Map<java.lang.String,java.lang.String> manualVariables)
Deprecated. since 4.0 use createVariableContextBuilder() instead

Prepare effective variables map - variables are set and optionally overridden (if set in later stage) in following order global plan job (if will be supported) manual

Parameters:
plan -
manualVariables -
Returns:

deleteVariablesForPlan

void deleteVariablesForPlan(@NotNull
                            Plan plan)
Removes variable definitions form specified plan

Parameters:
plan -

getGlobalNotOverriddenVariables

@NotNull
java.util.List<VariableDefinition> getGlobalNotOverriddenVariables(@NotNull
                                                                           ImmutablePlan plan)
Get list of all global variables that are not overridden by plan variables for a given plan

Parameters:
plan - Plan whose associated variables should be used
Returns:
sorted list of global only variables

saveVariableDefinitions

void saveVariableDefinitions(java.util.List<VariableDefinition> variableDefinitions)
Save all variable definitions on the list


createVariableContextBuilder

@NotNull
VariableContextBuilder createVariableContextBuilder()


Copyright © 2012 Atlassian. All Rights Reserved.