com.atlassian.bamboo.plan
Interface PlanExecutionManager

All Superinterfaces:
ExecutionStatusProvider
All Known Implementing Classes:
PlanExecutionManagerImpl

public interface PlanExecutionManager
extends ExecutionStatusProvider

Generic Execution Manager for Plan's

Since:
2.7

Method Summary
 java.util.List<CurrentlyBuilding> getCurrentlyBuildingForPlan(PlanKey planKey)
          Returns all for specified PlanKey In case plan is a Chain instance, all currently running jobs will be returned
 java.util.List<CurrentlyBuilding> getCurrentlyBuildingForPlanResult(PlanResultKey planKey)
          Returns all CurrentlyBuilding for specified PlanResultKey In case plan is a Chain instance, all currently running jobs will be returned, however, chain itself will be not included in the list (effectively CurrentlyBuilding for all chain's children jobs will be returned)
 boolean isBuildingAllowed(Plan plan)
          Checks if a particular build is allowed to be built.
 boolean isBusy()
           
 boolean isBusy(PlanKey planKey)
          Tests if the Plan represented by PlanKey is busy starting
 ExecutionRequestResult start(Plan plan, BuildDetectionAction buildDetectionAction, AcquisitionPolicy acquisitionPolicy)
          Execute the Plan with the provided BuildDetectionAction and AcquisitionPolicy

Calls to this method will acquire a lock according to the AcquisitionPolicy on a per Plan granularity

 ExecutionRequestResult start(Plan plan, PlanExecutionConfig planExecutionConfig, java.lang.String triggerReasonPluginKey, java.lang.String planTriggerPluginKey, java.util.Map<java.lang.String,java.lang.String> params, java.util.Map<java.lang.String,java.lang.String> variables, AcquisitionPolicy acquisitionPolicy)
          Execute the provided Plan with a custom TriggerReason, PlanTrigger, parameters and variables
 ExecutionRequestResult startManualExecution(Plan plan, PlanExecutionConfig planExecutionConfig, com.atlassian.user.User user, java.util.Map<java.lang.String,java.lang.String> params, java.util.Map<java.lang.String,java.lang.String> variables)
          Attempts to start a manual execution of a given Plan controlled by PlanExecutionConfig PlanExecutionConfig allows to control manual stages execution as well as enforcing execution of manual stages
 ExecutionRequestResult startManualExecution(Plan plan, com.atlassian.user.User user)
          Attempts to start a manual execution of the given Plan
 ExecutionRequestResult startManualExecution(Plan plan, com.atlassian.user.User user, java.util.Map<java.lang.String,java.lang.String> params, java.util.Map<java.lang.String,java.lang.String> variables)
          Attempts to start a manual execution of the given Plan
 void stopPlan(PlanKey planKey, boolean abandonResult, java.lang.String userName)
           
 void stopPlan(PlanResultKey planResultKey, boolean abandonResult, java.lang.String userName)
           
 
Methods inherited from interface com.atlassian.bamboo.plan.ExecutionStatusProvider
getExecutionStatus, getExecutionStatus, getJobExecution, numberOfExecutions
 

Method Detail

isBusy

boolean isBusy()
Returns:
if the server is busy building
Since:
3.3

isBusy

boolean isBusy(@NotNull
               PlanKey planKey)
Tests if the Plan represented by PlanKey is busy starting

Parameters:
planKey -
Returns:
busy

start

@NotNull
ExecutionRequestResult start(@NotNull
                                     Plan plan,
                                     @NotNull
                                     BuildDetectionAction buildDetectionAction,
                                     @NotNull
                                     AcquisitionPolicy acquisitionPolicy)
Execute the Plan with the provided BuildDetectionAction and AcquisitionPolicy

Calls to this method will acquire a lock according to the AcquisitionPolicy on a per Plan granularity

Parameters:
plan -
buildDetectionAction -
acquisitionPolicy -
Returns:
planExecutionResult
Throws:
IncorrectPlanTypeException - if the Plan could not be processed

start

@NotNull
ExecutionRequestResult start(@NotNull
                                     Plan plan,
                                     @Nullable
                                     PlanExecutionConfig planExecutionConfig,
                                     @NotNull
                                     java.lang.String triggerReasonPluginKey,
                                     @NotNull
                                     java.lang.String planTriggerPluginKey,
                                     @NotNull
                                     java.util.Map<java.lang.String,java.lang.String> params,
                                     @NotNull
                                     java.util.Map<java.lang.String,java.lang.String> variables,
                                     @NotNull
                                     AcquisitionPolicy acquisitionPolicy)
Execute the provided Plan with a custom TriggerReason, PlanTrigger, parameters and variables

Parameters:
plan - to execute
planExecutionConfig - extended configuration for execution
triggerReasonPluginKey - full plugin key for a TriggerReason
planTriggerPluginKey - full plugin key for a PlanTrigger
params - custom params
variables - overriden variables
acquisitionPolicy - to aquire the lock
Returns:
planExecutionResult
Throws:
IncorrectPlanTypeException - if the Plan could not be processed

startManualExecution

@NotNull
ExecutionRequestResult startManualExecution(@NotNull
                                                    Plan plan,
                                                    @NotNull
                                                    com.atlassian.user.User user)
Attempts to start a manual execution of the given Plan

Parameters:
plan -
user -
Returns:
executionRequestResult

startManualExecution

@NotNull
ExecutionRequestResult startManualExecution(@NotNull
                                                    Plan plan,
                                                    @NotNull
                                                    com.atlassian.user.User user,
                                                    @NotNull
                                                    java.util.Map<java.lang.String,java.lang.String> params,
                                                    @NotNull
                                                    java.util.Map<java.lang.String,java.lang.String> variables)
Attempts to start a manual execution of the given Plan

Parameters:
plan -
user -
params - - additional execution parameters set in code to parametrized build - not exposed to user
variables - - user defined variables that could be parametrized in manual execution - contain only values changed by user in UI
Returns:
executionRequestResult

startManualExecution

@NotNull
ExecutionRequestResult startManualExecution(@NotNull
                                                    Plan plan,
                                                    PlanExecutionConfig planExecutionConfig,
                                                    @NotNull
                                                    com.atlassian.user.User user,
                                                    @NotNull
                                                    java.util.Map<java.lang.String,java.lang.String> params,
                                                    @NotNull
                                                    java.util.Map<java.lang.String,java.lang.String> variables)
Attempts to start a manual execution of a given Plan controlled by PlanExecutionConfig PlanExecutionConfig allows to control manual stages execution as well as enforcing execution of manual stages

Parameters:
plan -
planExecutionConfig -
user -
params -
variables -
Returns:

isBuildingAllowed

boolean isBuildingAllowed(@NotNull
                          Plan plan)
Checks if a particular build is allowed to be built. It checks if it exists, not suspened, and that there is no global flag that has stopped building

Parameters:
plan -
Returns:
true if plan is allowed to be built

getCurrentlyBuildingForPlan

@NotNull
java.util.List<CurrentlyBuilding> getCurrentlyBuildingForPlan(PlanKey planKey)
Returns all for specified PlanKey In case plan is a Chain instance, all currently running jobs will be returned

Parameters:
planKey -
Returns:

getCurrentlyBuildingForPlanResult

@NotNull
java.util.List<CurrentlyBuilding> getCurrentlyBuildingForPlanResult(PlanResultKey planKey)
Returns all CurrentlyBuilding for specified PlanResultKey In case plan is a Chain instance, all currently running jobs will be returned, however, chain itself will be not included in the list (effectively CurrentlyBuilding for all chain's children jobs will be returned)

Parameters:
planKey -
Returns:

stopPlan

void stopPlan(@NotNull
              PlanResultKey planResultKey,
              boolean abandonResult,
              java.lang.String userName)

stopPlan

void stopPlan(@NotNull
              PlanKey planKey,
              boolean abandonResult,
              java.lang.String userName)
              throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException


Copyright © 2011 Atlassian. All Rights Reserved.