com.atlassian.bamboo.variable
Class VariableDefinitionManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.variable.VariableDefinitionManagerImpl
All Implemented Interfaces:
VariableDefinitionManager

public class VariableDefinitionManagerImpl
extends java.lang.Object
implements VariableDefinitionManager


Constructor Summary
VariableDefinitionManagerImpl(VariableDefinitionDao variableDefinitionDao, AuditLogService auditLogService)
           
 
Method Summary
 VariableContextBuilder createVariableContextBuilder()
           
 void deleteVariableDefinition(long id)
          Deprecated. 
 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. 
 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. 
 java.util.Map<java.lang.String,VariableDefinitionContext> getVariableDefinitionMap(Plan plan, java.util.Map<java.lang.String,java.lang.String> manualVariables)
          Deprecated. 
 void remove(VariableDefinition variableDefinition)
           
 void save(VariableDefinition variableDefinition)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableDefinitionManagerImpl

public VariableDefinitionManagerImpl(VariableDefinitionDao variableDefinitionDao,
                                     AuditLogService auditLogService)
Method Detail

findVariableDefinition

@Nullable
public VariableDefinition findVariableDefinition(long id)
Description copied from interface: VariableDefinitionManager
Find variable definition of specified id

Specified by:
findVariableDefinition in interface VariableDefinitionManager
Parameters:
id - id of variable definition
Returns:
variable definition of specified id or null if not found

saveVariableDefinition

public void saveVariableDefinition(@NotNull
                                   VariableDefinition variableDefinition)
Description copied from interface: VariableDefinitionManager
Save variable definition

Specified by:
saveVariableDefinition in interface VariableDefinitionManager
Parameters:
variableDefinition - variable definition to be saved

saveVariableDefinition

public void saveVariableDefinition(@NotNull
                                   VariableDefinition variableDefinition,
                                   @NotNull
                                   java.lang.String previousValue)
Description copied from interface: VariableDefinitionManager
Save variable definition

Specified by:
saveVariableDefinition in interface VariableDefinitionManager
Parameters:
variableDefinition - variable definition to be saved
previousValue - previous variable value

deleteVariableDefinition

public void deleteVariableDefinition(@NotNull
                                     VariableDefinition variableDefinition)
Description copied from interface: VariableDefinitionManager
Delete variable definition

Specified by:
deleteVariableDefinition in interface VariableDefinitionManager
Parameters:
variableDefinition - variable definition to be deleted

deleteVariableDefinition

@Deprecated
public void deleteVariableDefinition(long id)
Deprecated. 

Description copied from interface: VariableDefinitionManager
Delete variable definition

Specified by:
deleteVariableDefinition in interface VariableDefinitionManager
Parameters:
id - id of VariableDefinition object

deleteVariablesForPlan

public void deleteVariablesForPlan(@NotNull
                                   Plan plan)
Description copied from interface: VariableDefinitionManager
Removes variable definitions form specified plan

Specified by:
deleteVariablesForPlan in interface VariableDefinitionManager

getGlobalVariables

@NotNull
public java.util.List<VariableDefinition> getGlobalVariables()
Description copied from interface: VariableDefinitionManager
Get list of all global variables

Specified by:
getGlobalVariables in interface VariableDefinitionManager
Returns:
sorted list of all global variables

getPlanVariables

@NotNull
public java.util.List<VariableDefinition> getPlanVariables(@NotNull
                                                                   PlanIdentifier plan)
Description copied from interface: VariableDefinitionManager
Get list of plan variables associated with a given plan

Specified by:
getPlanVariables in interface VariableDefinitionManager
Parameters:
plan - Plan whose associated variables should be returned
Returns:
sorted list of plan variables

getGlobalNotOverriddenVariables

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

Specified by:
getGlobalNotOverriddenVariables in interface VariableDefinitionManager
Parameters:
plan - Plan whose associated variables should be used
Returns:
sorted list of global only variables

getGlobalVariableDefinitionMap

@Deprecated
@NotNull
public java.util.Map<java.lang.String,VariableDefinitionContext> getGlobalVariableDefinitionMap(@Nullable
                                                                                                                   java.util.Map<java.lang.String,java.lang.String> manualVariables)
Deprecated. 

Description copied from interface: VariableDefinitionManager
Prepare effective variables map - variables are set and optionally overridden (if set in later stage) in following order global manual

Specified by:
getGlobalVariableDefinitionMap in interface VariableDefinitionManager
Returns:

getVariableDefinitionMap

@Deprecated
@NotNull
public java.util.Map<java.lang.String,VariableDefinitionContext> getVariableDefinitionMap(@NotNull
                                                                                                             Plan plan,
                                                                                                             @Nullable
                                                                                                             java.util.Map<java.lang.String,java.lang.String> manualVariables)
Deprecated. 

Description copied from interface: VariableDefinitionManager
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

Specified by:
getVariableDefinitionMap in interface VariableDefinitionManager
Returns:

getSimpleVariableMapByType

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

Specified by:
getSimpleVariableMapByType in interface VariableDefinitionManager
Returns:

getVariableContext

@Deprecated
@NotNull
public VariableContext getVariableContext(@Nullable
                                                             java.util.Map<java.lang.String,java.lang.String> variables)
Deprecated. 

Description copied from interface: VariableDefinitionManager
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)

Specified by:
getVariableContext in interface VariableDefinitionManager
Returns:

createVariableContextBuilder

@NotNull
public VariableContextBuilder createVariableContextBuilder()
Specified by:
createVariableContextBuilder in interface VariableDefinitionManager

remove

public void remove(VariableDefinition variableDefinition)

save

public void save(VariableDefinition variableDefinition)

saveVariableDefinitions

public void saveVariableDefinitions(java.util.List<VariableDefinition> variableDefinitions)
Description copied from interface: VariableDefinitionManager
Save all variable definitions on the list

Specified by:
saveVariableDefinitions in interface VariableDefinitionManager


Copyright © 2012 Atlassian. All Rights Reserved.