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(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> getDeploymentEnvironmentVariables(long environmentId)
          Get list of environment variables associated with a given deployment environment
 java.util.List<VariableDefinition> getDeploymentVersionVariables(long deploymentVersionId)
          Get list of environment variables associated with a given deployment version
 java.util.List<VariableDefinition> getGlobalNotOverriddenVariables(PlanIdentifier plan)
          Get list of all global variables that are not overridden by plan variables for a given plan
 VariableDefinition getGlobalVariableByKey(java.lang.String key)
          Retrieves a specific global variable by key.
 java.util.List<VariableDefinition> getGlobalVariables()
          Get list of all global variables
 VariableDefinition getPlanVariableByKey(PlanIdentifier plan, java.lang.String key)
          Retrieves a specific variable for the plan with the given key
 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
 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,
                                   @Nullable
                                   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

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

getGlobalVariableByKey

@Nullable
public VariableDefinition getGlobalVariableByKey(java.lang.String key)
Description copied from interface: VariableDefinitionManager
Retrieves a specific global variable by key.

Specified by:
getGlobalVariableByKey in interface VariableDefinitionManager
Parameters:
key - of the variable
Returns:
global variable with specified key or null if none found.

getPlanVariableByKey

@Nullable
public VariableDefinition getPlanVariableByKey(@NotNull
                                                        PlanIdentifier plan,
                                                        @NotNull
                                                        java.lang.String key)
Description copied from interface: VariableDefinitionManager
Retrieves a specific variable for the plan with the given key

Specified by:
getPlanVariableByKey in interface VariableDefinitionManager
Parameters:
plan - variable belongs to
key - of variable
Returns:
plan variable with specified key or null if none found.

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

getDeploymentEnvironmentVariables

@NotNull
public java.util.List<VariableDefinition> getDeploymentEnvironmentVariables(long environmentId)
Description copied from interface: VariableDefinitionManager
Get list of environment variables associated with a given deployment environment

Specified by:
getDeploymentEnvironmentVariables in interface VariableDefinitionManager
Parameters:
environmentId - id of Deployment environment
Returns:
sorted list of variables

getDeploymentVersionVariables

@NotNull
public java.util.List<VariableDefinition> getDeploymentVersionVariables(long deploymentVersionId)
Description copied from interface: VariableDefinitionManager
Get list of environment variables associated with a given deployment version

Specified by:
getDeploymentVersionVariables in interface VariableDefinitionManager
Parameters:
deploymentVersionId - id of Deployment environment
Returns:
sorted list of variables

getGlobalNotOverriddenVariables

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

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:

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 © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.