Package com.atlassian.bamboo.plan
Interface PlanExecutionManager
- All Superinterfaces:
ExecutionStatusProvider
- All Known Implementing Classes:
DelegatingPlanExecutionManager
,PlanExecutionManagerImpl
Generic Execution Manager for
Plan
's- Since:
- 2.7
-
Method Summary
Modifier and TypeMethodDescription@NotNull List<CurrentlyBuilding>
getCurrentlyBuildingForPlan
(PlanKey planKey) @NotNull List<CurrentlyBuilding>
Returns allCurrentlyBuilding
for specifiedPlanResultKey
In case plan is aChain
instance, all currently running jobs will be returned, however, chain itself will be not included in the list (effectivelyCurrentlyBuilding
for all chain's children jobs will be returned)boolean
isBuildingAllowed
(@NotNull ImmutableChain chain) Checks if a particular build is allowed to be built.boolean
isBusy()
boolean
shutdown()
@NotNull ExecutionRequestResult
start
(@NotNull ImmutableChain chain, @NotNull BuildDetectionAction buildDetectionAction, @NotNull AcquisitionPolicy acquisitionPolicy) default @NotNull ExecutionRequestResult
start
(@NotNull ImmutableChain chain, @NotNull BuildDetectionAction buildDetectionAction, @NotNull AcquisitionPolicy acquisitionPolicy, PlanExecutionLaunchControl.ReleaseLocksActions releaseLocksActions) @NotNull ExecutionRequestResult
start
(@NotNull ImmutableChain chain, @Nullable PlanExecutionConfig planExecutionConfig, @NotNull String triggerReasonPluginKey, @NotNull String planTriggerPluginKey, @NotNull Map<String, String> params, @NotNull Map<String, String> variables, @NotNull AcquisitionPolicy acquisitionPolicy) @NotNull ExecutionRequestResult
start
(@NotNull Triggerable triggerable, @NotNull BuildDetectionAction buildDetectionAction, @NotNull AcquisitionPolicy acquisitionPolicy) default @NotNull ExecutionRequestResult
start
(@NotNull Triggerable triggerable, @NotNull BuildDetectionAction buildDetectionAction, @NotNull AcquisitionPolicy acquisitionPolicy, PlanExecutionLaunchControl.ReleaseLocksActions releaseLocksActions) @NotNull ExecutionRequestResult
startManualExecution
(@NotNull ImmutableChain chain, @NotNull com.atlassian.user.User user, @NotNull Map<String, String> params, @NotNull Map<String, String> variables) Attempts to start a manual execution of the givenPlan
@NotNull ExecutionRequestResult
startManualExecution
(@NotNull ImmutableChain chain, PlanExecutionConfig planExecutionConfig, @NotNull com.atlassian.user.User user, @NotNull String triggerReasonPluginKey, @NotNull String planTriggerPluginKey, @NotNull Map<String, String> params, @NotNull Map<String, String> variables) Attempts to start a manual execution of a givenPlan
controlled byPlanExecutionConfig
PlanExecutionConfig
allows to control manual stages execution as well as enforcing execution of manual stages@NotNull ExecutionRequestResult
startManualExecution
(@NotNull ImmutableChain chain, PlanExecutionConfig planExecutionConfig, @NotNull com.atlassian.user.User user, @NotNull Map<String, String> params, @NotNull Map<String, String> variables) Attempts to start a manual execution of a givenPlan
controlled byPlanExecutionConfig
PlanExecutionConfig
allows to control manual stages execution as well as enforcing execution of manual stagesvoid
void
stopPlan
(@NotNull PlanResultKey planResultKey, boolean abandonResult, String userName) void
stopRequest
(@NotNull PlanKey planKey) Stops a build requests for the givenPlanKey
Methods inherited from interface com.atlassian.bamboo.plan.ExecutionStatusProvider
getExecutionStatus, getExecutionStatus, getJobExecution, numberOfExecutions
-
Method Details
-
isBusy
boolean isBusy()- Returns:
- if the server is busy building
- Since:
- 3.3
-
isBusy
- Parameters:
planKey
-- Returns:
- busy
-
start
@NotNull @NotNull ExecutionRequestResult start(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull BuildDetectionAction buildDetectionAction, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy) Execute theImmutableChain
with the providedBuildDetectionAction
andAcquisitionPolicy
Calls to this method will acquire a lock according to the
AcquisitionPolicy
on a perPlan
granularity- Parameters:
chain
-buildDetectionAction
-acquisitionPolicy
-- Returns:
- planExecutionResult
- Throws:
IncorrectPlanTypeException
- if thePlan
could not be processed
-
start
@NotNull default @NotNull ExecutionRequestResult start(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull BuildDetectionAction buildDetectionAction, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull PlanExecutionLaunchControl.ReleaseLocksActions releaseLocksActions) Execute theImmutableChain
with the providedBuildDetectionAction
andAcquisitionPolicy
Calls to this method will acquire a lock according to the
AcquisitionPolicy
on a perPlan
granularity- Parameters:
chain
-buildDetectionAction
-acquisitionPolicy
-releaseLocksActions
- actions used for releasing repositories caches locks- Returns:
- planExecutionResult
- Throws:
IncorrectPlanTypeException
- if thePlan
could not be processed- Since:
- 9.3
-
start
@NotNull @NotNull ExecutionRequestResult start(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull BuildDetectionAction buildDetectionAction, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy) Execute theTriggerable
with the providedBuildDetectionAction
andAcquisitionPolicy
Calls to this method will acquire a lock according to the
AcquisitionPolicy
on a perPlan
granularity- Parameters:
triggerable
-buildDetectionAction
-acquisitionPolicy
-- Returns:
- planExecutionResult
- Throws:
IncorrectPlanTypeException
- if thePlan
could not be processed- Since:
- 5.0
-
start
@NotNull default @NotNull ExecutionRequestResult start(@NotNull @NotNull Triggerable triggerable, @NotNull @NotNull BuildDetectionAction buildDetectionAction, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull PlanExecutionLaunchControl.ReleaseLocksActions releaseLocksActions) Execute theTriggerable
with the providedBuildDetectionAction
andAcquisitionPolicy
Calls to this method will acquire a lock according to the
AcquisitionPolicy
on a perPlan
granularity- Parameters:
triggerable
-buildDetectionAction
-acquisitionPolicy
-releaseLocksActions
- actions used for releasing repositories caches locks- Returns:
- planExecutionResult
- Throws:
IncorrectPlanTypeException
- if thePlan
could not be processed- Since:
- 9.3
-
start
@NotNull @NotNull ExecutionRequestResult start(@NotNull @NotNull ImmutableChain chain, @Nullable @Nullable PlanExecutionConfig planExecutionConfig, @NotNull @NotNull String triggerReasonPluginKey, @NotNull @NotNull String planTriggerPluginKey, @NotNull @NotNull Map<String, String> params, @NotNull @NotNull Map<String, String> variables, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy) - Parameters:
chain
-planExecutionConfig
- extended configuration for executiontriggerReasonPluginKey
- full plugin key for aTriggerReason
planTriggerPluginKey
- full plugin key for aPlanTrigger
params
- custom paramsvariables
- overriden variablesacquisitionPolicy
- to aquire the lock- Returns:
- planExecutionResult
- Throws:
IncorrectPlanTypeException
- if thePlan
could not be processed
-
startManualExecution
@NotNull @NotNull ExecutionRequestResult startManualExecution(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull com.atlassian.user.User user, @NotNull @NotNull Map<String, String> params, @NotNull @NotNull Map<String, String> variables) Attempts to start a manual execution of the givenPlan
- Parameters:
chain
-user
-params
- - additional execution parameters set in code to parametrized build - not exposed to uservariables
- - user defined variables that could be parametrized in manual execution - contain only values changed by user in UI- Returns:
- executionRequestResult
-
startManualExecution
@NotNull @NotNull ExecutionRequestResult startManualExecution(@NotNull @NotNull ImmutableChain chain, PlanExecutionConfig planExecutionConfig, @NotNull @NotNull com.atlassian.user.User user, @NotNull @NotNull Map<String, String> params, @NotNull @NotNull Map<String, String> variables) Attempts to start a manual execution of a givenPlan
controlled byPlanExecutionConfig
PlanExecutionConfig
allows to control manual stages execution as well as enforcing execution of manual stages- Parameters:
chain
-planExecutionConfig
-user
-params
-variables
-- Returns:
-
startManualExecution
@NotNull @NotNull ExecutionRequestResult startManualExecution(@NotNull @NotNull ImmutableChain chain, PlanExecutionConfig planExecutionConfig, @NotNull @NotNull com.atlassian.user.User user, @NotNull @NotNull String triggerReasonPluginKey, @NotNull @NotNull String planTriggerPluginKey, @NotNull @NotNull Map<String, String> params, @NotNull @NotNull Map<String, String> variables) Attempts to start a manual execution of a givenPlan
controlled byPlanExecutionConfig
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
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
Returns all for specifiedPlanKey
In case plan is aChain
instance, all currently running jobs will be returned- Parameters:
planKey
-- Returns:
-
getCurrentlyBuildingForPlanResult
Returns allCurrentlyBuilding
for specifiedPlanResultKey
In case plan is aChain
instance, all currently running jobs will be returned, however, chain itself will be not included in the list (effectivelyCurrentlyBuilding
for all chain's children jobs will be returned)- Parameters:
planKey
-- Returns:
-
stopPlan
void stopPlan(@NotNull @NotNull PlanResultKey planResultKey, boolean abandonResult, String userName) -
stopPlan
void stopPlan(@NotNull @NotNull PlanKey planKey, boolean abandonResult, String userName) throws InterruptedException - Throws:
InterruptedException
-
stopRequest
Stops a build requests for the givenPlanKey
- Parameters:
planKey
-- Since:
- 3.3.3
-
shutdown
- Since:
- 5.8
-