public class PlanExecutionManagerImpl extends Object implements PlanExecutionManager
BuildDetectionAction, it all depends which interface is implemented:
UnconditionalBuildDetectionAction - meaning: if this action is created we know we want to start a build. (example: scheduled build, dependant build...)DelayedChangeDetectionAction - special case of 1) with added feature of calling thread not being blocked by change detection (manual builds, restarted builds...)ConditionalBuildDetectionAction - we don't know a priori if we wan't to start a build (trigger by vcs change)
inChangeDetectionLock
{
inBuildCountLock
{
checkIfCountNotExceeded
createResultWithoutChanges
}
doChangeDetection
}
inBuildCountLock
{
checkIfCountNotExceeded
createResultWithoutChanges;
inNewThread
{
inChangeDetectionLock
{
doChangeDetection
}
}
}
inChangeDetectionLock
{
inBuildCountLock
{
checkIfCountNotExceeded
}
doChangeDetection
inBuildCountLock
{
checkIfCountNotExceeded
createResultWithChanges
}
}
| Constructor and Description |
|---|
PlanExecutionManagerImpl(BuildExecutionManager buildExecutionManager,
PlanExecutionPermitter planExecutionPermitter,
ExecutionStatusProvider executionStatusProvider,
CachedPlanManager cachedPlanManager,
StopBuildManager stopBuildManager,
TriggerManager triggerManager,
PlanExecutionLockService planExecutionLockService,
com.atlassian.event.api.EventPublisher eventPublisher,
ErrorHandler errorHandler,
DeploymentPermitter deploymentPermitter,
com.atlassian.bamboo.plan.PlanExecutionManagerCallWatcher planExecutionManagerCallWatcher) |
| Modifier and Type | Method and Description |
|---|---|
List<CurrentlyBuilding> |
getCurrentlyBuildingForPlan(PlanKey planKey)
|
List<CurrentlyBuilding> |
getCurrentlyBuildingForPlanResult(PlanResultKey planResultKey)
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) |
Collection<? extends ExecutionStatus> |
getExecutionStatus(PlanKey planKey)
Returns a collection of current
ExecutionStatuss for PlanKey |
ExecutionStatus |
getExecutionStatus(PlanResultKey planResultKey)
Returns a
ExecutionStatus for the given PlanResultKey |
BuildExecution |
getJobExecution(PlanResultKey planResultKey)
Get the state of a single Job being executed
|
boolean |
isBuildingAllowed(ImmutableChain chain)
Checks if a particular build is allowed to be built.
|
boolean |
isBusy() |
boolean |
isBusy(PlanKey planKey)
|
int |
numberOfExecutions(PlanKey planKey)
Returns the number of current
ExecutionStatuss available for PlanKey |
Future<Boolean> |
shutdown() |
ExecutionRequestResult |
start(ImmutableChain chain,
BuildDetectionAction buildDetectionAction,
AcquisitionPolicy acquisitionPolicy)
|
ExecutionRequestResult |
start(ImmutableChain chain,
PlanExecutionConfig planExecutionConfig,
String triggerReasonPluginKey,
String planTriggerPluginKey,
Map<String,String> params,
Map<String,String> variables,
AcquisitionPolicy acquisitionPolicy)
|
ExecutionRequestResult |
start(Triggerable triggerable,
BuildDetectionAction buildDetectionAction,
AcquisitionPolicy acquisitionPolicy)
|
ExecutionRequestResult |
startManualExecution(ImmutableChain chain,
PlanExecutionConfig planExecutionConfig,
com.atlassian.user.User user,
Map<String,String> params,
Map<String,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,
String triggerReasonPluginKey,
String planTriggerPluginKey,
Map<String,String> params,
Map<String,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,
Map<String,String> params,
Map<String,String> variables)
Attempts to start a manual execution of the given
Plan |
void |
stopPlan(PlanKey planKey,
boolean abandonResult,
String userName) |
void |
stopPlan(PlanResultKey planResultKey,
boolean abandonResult,
String userName) |
void |
stopRequest(PlanKey planKey)
Stops a build requests for the given
PlanKey |
public PlanExecutionManagerImpl(BuildExecutionManager buildExecutionManager, PlanExecutionPermitter planExecutionPermitter, ExecutionStatusProvider executionStatusProvider, CachedPlanManager cachedPlanManager, StopBuildManager stopBuildManager, TriggerManager triggerManager, PlanExecutionLockService planExecutionLockService, com.atlassian.event.api.EventPublisher eventPublisher, ErrorHandler errorHandler, DeploymentPermitter deploymentPermitter, com.atlassian.bamboo.plan.PlanExecutionManagerCallWatcher planExecutionManagerCallWatcher)
public int numberOfExecutions(@NotNull
PlanKey planKey)
ExecutionStatusProviderExecutionStatuss available for PlanKeynumberOfExecutions in interface ExecutionStatusProvider@NotNull public Collection<? extends ExecutionStatus> getExecutionStatus(@NotNull PlanKey planKey)
ExecutionStatusProviderExecutionStatuss for PlanKeygetExecutionStatus in interface ExecutionStatusProvider@Nullable public ExecutionStatus getExecutionStatus(@NotNull PlanResultKey planResultKey)
ExecutionStatusProviderExecutionStatus for the given PlanResultKeygetExecutionStatus in interface ExecutionStatusProviderpublic BuildExecution getJobExecution(@NotNull PlanResultKey planResultKey)
ExecutionStatusProvidergetJobExecution in interface ExecutionStatusProvider@NotNull public ExecutionRequestResult startManualExecution(@NotNull ImmutableChain chain, @NotNull com.atlassian.user.User user, @NotNull Map<String,String> params, @NotNull Map<String,String> variables)
PlanExecutionManagerPlanstartManualExecution in interface PlanExecutionManagerparams - - 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@NotNull public ExecutionRequestResult startManualExecution(@NotNull ImmutableChain chain, @Nullable PlanExecutionConfig planExecutionConfig, @NotNull com.atlassian.user.User user, @NotNull Map<String,String> params, @NotNull Map<String,String> variables)
PlanExecutionManagerPlan controlled by PlanExecutionConfig
PlanExecutionConfig allows to control manual stages execution as well as enforcing execution of manual stagesstartManualExecution in interface PlanExecutionManager@NotNull public ExecutionRequestResult startManualExecution(@NotNull ImmutableChain chain, @Nullable PlanExecutionConfig planExecutionConfig, @NotNull com.atlassian.user.User user, @NotNull String triggerReasonPluginKey, @Nullable String planTriggerPluginKey, @NotNull Map<String,String> params, @NotNull Map<String,String> variables)
PlanExecutionManagerPlan controlled by PlanExecutionConfig
PlanExecutionConfig allows to control manual stages execution as well as enforcing execution of manual stagesstartManualExecution in interface PlanExecutionManagerpublic boolean isBusy(@NotNull
PlanKey planKey)
PlanExecutionManagerisBusy in interface PlanExecutionManagerpublic boolean isBusy()
isBusy in interface PlanExecutionManager@NotNull public 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)
PlanExecutionManagerstart in interface PlanExecutionManagerplanExecutionConfig - extended configuration for executiontriggerReasonPluginKey - full plugin key for a TriggerReasonplanTriggerPluginKey - full plugin key for a PlanTriggerparams - custom paramsvariables - overriden variablesacquisitionPolicy - to aquire the lockpublic ExecutionRequestResult start(@NotNull ImmutableChain chain, @NotNull BuildDetectionAction buildDetectionAction, @NotNull AcquisitionPolicy acquisitionPolicy)
PlanExecutionManagerImmutableChain with the provided BuildDetectionAction and AcquisitionPolicy
Calls to this method will acquire a lock according to the AcquisitionPolicy on a per Plan
granularity
start in interface PlanExecutionManager@NotNull public ExecutionRequestResult start(@NotNull Triggerable triggerable, @NotNull BuildDetectionAction buildDetectionAction, @NotNull AcquisitionPolicy acquisitionPolicy)
PlanExecutionManagerTriggerable with the provided BuildDetectionAction and AcquisitionPolicy
Calls to this method will acquire a lock according to the AcquisitionPolicy on a per Plan
granularity
start in interface PlanExecutionManagerpublic boolean isBuildingAllowed(@NotNull
ImmutableChain chain)
PlanExecutionManagerisBuildingAllowed in interface PlanExecutionManager@NotNull public List<CurrentlyBuilding> getCurrentlyBuildingForPlan(PlanKey planKey)
PlanExecutionManagerPlanKey In case plan is a Chain instance, all
currently running jobs will be returnedgetCurrentlyBuildingForPlan in interface PlanExecutionManager@NotNull public List<CurrentlyBuilding> getCurrentlyBuildingForPlanResult(PlanResultKey planResultKey)
PlanExecutionManagerCurrentlyBuilding 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)getCurrentlyBuildingForPlanResult in interface PlanExecutionManagerpublic void stopPlan(@NotNull
PlanResultKey planResultKey,
boolean abandonResult,
String userName)
stopPlan in interface PlanExecutionManagerpublic void stopPlan(@NotNull
PlanKey planKey,
boolean abandonResult,
String userName)
throws InterruptedException
stopPlan in interface PlanExecutionManagerInterruptedExceptionpublic void stopRequest(@NotNull
PlanKey planKey)
PlanExecutionManagerPlanKeystopRequest in interface PlanExecutionManagerpublic Future<Boolean> shutdown()
shutdown in interface PlanExecutionManagerCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.