Package com.atlassian.bamboo.task
Class CommonTaskContextImpl
java.lang.Object
com.atlassian.bamboo.task.CommonTaskContextImpl
- All Implemented Interfaces:
PluginKeyProvider,CommonTaskContext,InternalTaskContext,TaskIdentifier
- Direct Known Subclasses:
DeploymentTaskContextImpl,TaskContextImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TaskRootDirectorySelectorprotected final TaskExecutionContext -
Constructor Summary
ConstructorsConstructorDescriptionCommonTaskContextImpl(Map<String, String> substitutedConfiguration, TaskExecutionContext taskExecutionContext, RuntimeTaskDefinition taskDefinition) -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull CommonContext@NotNull BuildLoggerReturns the appropriate logger for the task@NotNull CommonContextContains all the build related information about the running of the tasks@NotNull ConfigurationMapAMapofStringvalues fromTaskDefinition.getConfiguration()where the values have gone through variable substitution throughCustomVariableContext.substituteString(String).longgetId()@NotNull String@NotNull FileGet build root directory (where sources were checked out)@Nullable Map<String, WhitelistedSerializable> @NotNull FileGet build working directory (where task should be executed).booleanboolean
-
Field Details
-
rootDirectorySelector
-
taskExecutionContext
-
-
Constructor Details
-
CommonTaskContextImpl
public CommonTaskContextImpl(Map<String, String> substitutedConfiguration, TaskExecutionContext taskExecutionContext, RuntimeTaskDefinition taskDefinition)
-
-
Method Details
-
getId
public long getId()- Specified by:
getIdin interfaceTaskIdentifier- Returns:
- the id of this configuration. Unique within the given context (e.g.
Job
-
getPluginKey
- Specified by:
getPluginKeyin interfacePluginKeyProvider- Specified by:
getPluginKeyin interfaceTaskIdentifier- Returns:
- Complete key of the task type plugin module
-
getUserDescription
- Specified by:
getUserDescriptionin interfaceTaskIdentifier- Returns:
- the description of the task as defined by the user
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceTaskIdentifier- Returns:
- whether the task is enabled or disabled
-
isFinalising
public boolean isFinalising()- Specified by:
isFinalisingin interfaceTaskIdentifier- Returns:
- true if the task should be run in finalisation phase
-
getBuildContext
-
getCommonContext
Description copied from interface:CommonTaskContextContains all the build related information about the running of the tasks- Specified by:
getCommonContextin interfaceCommonTaskContext- Returns:
-
getBuildLogger
Description copied from interface:CommonTaskContextReturns the appropriate logger for the task- Specified by:
getBuildLoggerin interfaceCommonTaskContext- Returns:
-
getRootDirectory
Description copied from interface:CommonTaskContextGet build root directory (where sources were checked out)- Specified by:
getRootDirectoryin interfaceCommonTaskContext- Returns:
- Build root directory
-
getWorkingDirectory
Description copied from interface:CommonTaskContextGet build working directory (where task should be executed).Default implementation checks for the
TaskConfigConstants.CFG_WORKING_SUBDIRECTORYkey in the TaskConfiguration if such key exists and has not empty value then working directory would be getRootDirectory() + value ofTaskConfigConstants.CFG_WORKING_SUBDIRECTORYkey.- Specified by:
getWorkingDirectoryin interfaceCommonTaskContext- Returns:
- Build working directory
-
getConfigurationMap
Description copied from interface:CommonTaskContextAMapofStringvalues fromTaskDefinition.getConfiguration()where the values have gone through variable substitution throughCustomVariableContext.substituteString(String). All ${bamboo.*} and ${system.*} params are substituted.- Specified by:
getConfigurationMapin interfaceCommonTaskContext- Returns:
-
getRuntimeTaskContext
- Specified by:
getRuntimeTaskContextin interfaceCommonTaskContext- Returns:
- custom runtime data that complement static task configuration
-
getRuntimeTaskData
- Specified by:
getRuntimeTaskDatain interfaceCommonTaskContext- Returns:
- custom runtime data that complement static task configuration
-
doesTaskProduceTestResults
public boolean doesTaskProduceTestResults()- Specified by:
doesTaskProduceTestResultsin interfaceCommonTaskContext
-