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(ImmutableChain chain)
          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(ImmutableChain chain, BuildDetectionAction buildDetectionAction, AcquisitionPolicy acquisitionPolicy)
          Execute the ImmutableChain 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(ImmutableChain chain, 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 start(Triggerable triggerable, BuildDetectionAction buildDetectionAction, AcquisitionPolicy acquisitionPolicy)
          Execute the Triggerable with the provided BuildDetectionAction and AcquisitionPolicy

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

 ExecutionRequestResult startManualExecution(ImmutableChain chain, 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(ImmutableChain chain, PlanExecutionConfig planExecutionConfig, com.atlassian.user.User user, 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)
          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(ImmutableChain chain, com.atlassian.user.User user)
          Attempts to start a manual execution of the given Plan
 ExecutionRequestResult startManualExecution(ImmutableChain chain, 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)
           
 void stopRequest(PlanKey planKey)
          Stops a build requests for the given PlanKey
 
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
                                     ImmutableChain chain,
                                     @NotNull
                                     BuildDetectionAction buildDetectionAction,
                                     @NotNull
                                     AcquisitionPolicy acquisitionPolicy)
Execute the ImmutableChain with the provided BuildDetectionAction and AcquisitionPolicy

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

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

start

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

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

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

start

@NotNull
ExecutionRequestResult start(@NotNull
                                     ImmutableChain chain,
                                     @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:
chain -
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
                                                    ImmutableChain chain,
                                                    @NotNull
                                                    com.atlassian.user.User user)
Attempts to start a manual execution of the given Plan

Parameters:
chain -
user -
Returns:
executionRequestResult

startManualExecution

@NotNull
ExecutionRequestResult startManualExecution(@NotNull
                                                    ImmutableChain chain,
                                                    @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:
chain -
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
                                                    ImmutableChain chain,
                                                    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:
chain -
planExecutionConfig -
user -
params -
variables -
Returns:

startManualExecution

@NotNull
ExecutionRequestResult startManualExecution(@NotNull
                                                    ImmutableChain chain,
                                                    PlanExecutionConfig planExecutionConfig,
                                                    @NotNull
                                                    com.atlassian.user.User user,
                                                    @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)
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:
chain -
planExecutionConfig -
user -
triggerReasonPluginKey -
planTriggerPluginKey -
params -
variables -
Returns:

isBuildingAllowed

boolean isBuildingAllowed(@NotNull
                          ImmutableChain chain)
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:
chain -
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

stopRequest

void stopRequest(@NotNull
                 PlanKey planKey)
Stops a build requests for the given PlanKey

Parameters:
planKey -
Since:
3.3.3


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.