com.atlassian.bamboo.task
Class TaskContextImpl

java.lang.Object
  extended by com.atlassian.bamboo.task.TaskContextImpl
All Implemented Interfaces:
InternalTaskContext, TaskContext, TaskIdentifier

public class TaskContextImpl
extends java.lang.Object
implements TaskContext


Constructor Summary
TaskContextImpl(java.util.Map<java.lang.String,java.lang.String> substitutedConfiguration, TaskExecutionContext taskExecutionContext, TaskDefinition taskDefinition)
           
 
Method Summary
 BuildContext getBuildContext()
          Contains all the build related information about the running of the tasks
 BuildLogger getBuildLogger()
          Returns the appropriate logger for the task
 ConfigurationMap getConfigurationMap()
          A Map of String values from TaskDefinition.getConfiguration() where the values have gone through variable substitution through CustomVariableContext#substituteString().
 long getId()
           
 java.lang.String getPluginKey()
           
 java.io.File getRootDirectory()
          Get build root directory (where sources were checked out)
 java.lang.String getUserDescription()
           
 java.io.File getWorkingDirectory()
          Get build working directory (where task should be executed).
 boolean isFinalising()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskContextImpl

public TaskContextImpl(java.util.Map<java.lang.String,java.lang.String> substitutedConfiguration,
                       TaskExecutionContext taskExecutionContext,
                       TaskDefinition taskDefinition)
Method Detail

getId

public long getId()
Specified by:
getId in interface TaskIdentifier
Returns:
the id of this configuration. Unique within the given context (e.g. Job

getPluginKey

@NotNull
public java.lang.String getPluginKey()
Specified by:
getPluginKey in interface TaskIdentifier
Returns:
Complete key of the task type plugin module

getUserDescription

public java.lang.String getUserDescription()
Specified by:
getUserDescription in interface TaskIdentifier
Returns:
the description of the task as defined by the user

isFinalising

public boolean isFinalising()
Specified by:
isFinalising in interface TaskIdentifier
Returns:
true if the task should be run in finalisation phase

getBuildContext

@NotNull
public BuildContext getBuildContext()
Description copied from interface: TaskContext
Contains all the build related information about the running of the tasks

Specified by:
getBuildContext in interface TaskContext
Returns:

getBuildLogger

@NotNull
public BuildLogger getBuildLogger()
Description copied from interface: TaskContext
Returns the appropriate logger for the task

Specified by:
getBuildLogger in interface TaskContext
Returns:

getRootDirectory

@NotNull
public java.io.File getRootDirectory()
Description copied from interface: TaskContext
Get build root directory (where sources were checked out)

Specified by:
getRootDirectory in interface TaskContext
Returns:
Build root directory

getWorkingDirectory

@NotNull
public java.io.File getWorkingDirectory()
Description copied from interface: TaskContext
Get build working directory (where task should be executed). Default implementation checks for the TaskConfigConstants.CFG_WORKING_SUB_DIRECTORY key in the TaskConfiguration if such key exists and has not empty value then working directory would be getRootDirectory() + value of TaskConfigConstants.CFG_WORKING_SUB_DIRECTORY key.

Specified by:
getWorkingDirectory in interface TaskContext
Returns:
Build working directory

getConfigurationMap

@NotNull
public ConfigurationMap getConfigurationMap()
Description copied from interface: TaskContext
A Map of String values from TaskDefinition.getConfiguration() where the values have gone through variable substitution through CustomVariableContext#substituteString(). All ${bamboo.*} and ${system.*} params are substituted.

Specified by:
getConfigurationMap in interface TaskContext
Returns:


Copyright © 2011 Atlassian. All Rights Reserved.