com.atlassian.bamboo.variable
Class CustomVariableContextImpl

java.lang.Object
  extended by com.atlassian.bamboo.variable.CustomVariableContextImpl
All Implemented Interfaces:
CustomVariableContext

public class CustomVariableContextImpl
extends java.lang.Object
implements CustomVariableContext


Constructor Summary
CustomVariableContextImpl()
           
 
Method Summary
 void addCustomData(java.lang.String key, java.lang.String value)
          Adds a VariableType.MANUAL variable to ThreadLocal state.
 void clearContext()
          Clear ThreadLocal state.
 java.util.Map<java.lang.String,VariableSubstitutionContext> getSubstitutedVariables()
          Get all the variables that have previously been substituted in this thread.
 java.util.Map<java.lang.String,java.lang.String> getVariables(BuildContext buildContext)
          Get all variables from buildContext.
 java.lang.String removeAllVariables(java.lang.String value)
          Given a string array, remove all variable patterns.
 void setAdministrationConfigurationManager(AdministrationConfigurationManager administrationConfigurationManager)
           
 void setAgentContext(AgentContext agentContext)
           
 void setBuildContext(BuildContext buildContext)
          Set buildContext reference in ThreadLocal state.
 void setBuildDirectoryManager(BuildDirectoryManager buildDirectoryManager)
           
 void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)
           
 void setCapabilityContext(CapabilityContext capabilityContext)
           
 void setPlan(PlanIdentifier planIdentifier, java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
          Sets Plan reference and variable definitions in ThreadLocal state.
 void setVariables(java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
          Set variable definitions in ThreadLocal state.
 java.lang.String substituteString(java.lang.String value)
          Substitutes variables in the input string with their values using data from existing ThreadLocal state.
 java.lang.String substituteString(java.lang.String value, BuildContext buildContext, BuildLogger buildLogger)
          Substitutes variables in the input string with their values using provided data, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomVariableContextImpl

public CustomVariableContextImpl()
Method Detail

setPlan

public void setPlan(@NotNull
                    PlanIdentifier planIdentifier,
                    @Nullable
                    java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
Description copied from interface: CustomVariableContext
Sets Plan reference and variable definitions in ThreadLocal state. Clears history of substituted variables (CustomVariableContext.getSubstitutedVariables()

Specified by:
setPlan in interface CustomVariableContext
Parameters:
planIdentifier - plan identifier
variablesContextMap - variable definitions (including plan variables)

setVariables

public void setVariables(java.util.Map<java.lang.String,VariableDefinitionContext> variablesContextMap)
Description copied from interface: CustomVariableContext
Set variable definitions in ThreadLocal state. Clears history of substituted variables (CustomVariableContext.getSubstitutedVariables()

Specified by:
setVariables in interface CustomVariableContext
Parameters:
variablesContextMap - variable definitions

setBuildContext

public void setBuildContext(BuildContext buildContext)
Description copied from interface: CustomVariableContext
Set buildContext reference in ThreadLocal state. Sets the variable definitions to those contained in the context. BuildContext has priority over Plan when resolving the variables.

Specified by:
setBuildContext in interface CustomVariableContext

clearContext

public void clearContext()
Description copied from interface: CustomVariableContext
Clear ThreadLocal state.

Specified by:
clearContext in interface CustomVariableContext

getSubstitutedVariables

@NotNull
public java.util.Map<java.lang.String,VariableSubstitutionContext> getSubstitutedVariables()
Description copied from interface: CustomVariableContext
Get all the variables that have previously been substituted in this thread.

Specified by:
getSubstitutedVariables in interface CustomVariableContext
Returns:

addCustomData

public void addCustomData(java.lang.String key,
                          java.lang.String value)
Description copied from interface: CustomVariableContext
Adds a VariableType.MANUAL variable to ThreadLocal state.

Specified by:
addCustomData in interface CustomVariableContext
Parameters:
key - name of the variable
value - value of the variable

substituteString

public java.lang.String substituteString(java.lang.String value)
Description copied from interface: CustomVariableContext
Substitutes variables in the input string with their values using data from existing ThreadLocal state.

Specified by:
substituteString in interface CustomVariableContext
Parameters:
value - input string
Returns:
substituted string

substituteString

public java.lang.String substituteString(java.lang.String value,
                                         @Nullable
                                         BuildContext buildContext,
                                         BuildLogger buildLogger)
Description copied from interface: CustomVariableContext
Substitutes variables in the input string with their values using provided data, i.e. overriding (for this call only) any existing ThreadLocal state.

Specified by:
substituteString in interface CustomVariableContext
Parameters:
value - input string
buildContext - build context
buildLogger - build logger
Returns:
substituted string

removeAllVariables

@NotNull
public java.lang.String removeAllVariables(@NotNull
                                                   java.lang.String value)
Given a string array, remove all variable patterns.

Specified by:
removeAllVariables in interface CustomVariableContext
Parameters:
value - string values to be analyzed
Returns:
value with variables removed

getVariables

@NotNull
public java.util.Map<java.lang.String,java.lang.String> getVariables(BuildContext buildContext)
Description copied from interface: CustomVariableContext
Get all variables from buildContext.

Specified by:
getVariables in interface CustomVariableContext
Returns:

setBuildLoggerManager

public void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)

setCapabilityContext

public void setCapabilityContext(CapabilityContext capabilityContext)

setAdministrationConfigurationManager

public void setAdministrationConfigurationManager(AdministrationConfigurationManager administrationConfigurationManager)

setAgentContext

public void setAgentContext(AgentContext agentContext)

setBuildDirectoryManager

public void setBuildDirectoryManager(BuildDirectoryManager buildDirectoryManager)


Copyright © 2012 Atlassian. All Rights Reserved.