Package com.atlassian.bamboo.build
Class CurrentlyBuildingContainer
java.lang.Object
com.atlassian.bamboo.build.CurrentlyBuildingContainer
A class that allows thread safe maps of
CurrentlyBuilding
objects keyed by plan key and buildAgentId.
This bean registers itself as event listener.
-
Constructor Summary
ConstructorDescriptionCurrentlyBuildingContainer
(AgentManager agentManager, com.atlassian.event.api.EventPublisher eventPublisher, XStreamFactory xStreamFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
detachBuildFromAgent
(long agentId) @Nullable CurrentlyBuilding
getCurrentlyBuilding
(long agentId) Immutable list of currently building by plan.@Nullable CurrentlyBuilding
getCurrentlyBuildingByResultKey
(@NotNull ResultKey resultKey) @NotNull Iterable<CurrentlyBuilding>
int
void
@Nullable CurrentlyBuilding
removeCurrentlyBuilding
(@NotNull ResultKey resultKey) restoreState
(Set<PlanResultKey> pendingBuildKeys, ExecutorService executorService) protected void
saveState
(CurrentlyBuilding currentlyBuilding, boolean saveEvenIfFileExists) @NotNull CurrentlyBuilding
setCurrentlyBuilding
(@NotNull BuildContext buildContext, @NotNull CurrentlyBuilding currentlyBuilding, Collection<BuildAgent> executableAgents, Collection<ElasticImageConfiguration> executableImages) @Nullable CurrentlyBuilding
startBuildingOnAgent
(@NotNull PlanResultKey planResultKey, long agentId, Date sentToAgentTimestamp)
-
Constructor Details
-
CurrentlyBuildingContainer
public CurrentlyBuildingContainer(AgentManager agentManager, com.atlassian.event.api.EventPublisher eventPublisher, XStreamFactory xStreamFactory)
-
-
Method Details
-
onSentToAgentTimingPoint
@EventListener public void onSentToAgentTimingPoint(@NotNull OutOfBandDeploymentTimingPoints.SentToAgent event) -
getCurrentlyBuildingByKey
Immutable list of currently building by plan. -
numberOfCurrentlyBuildingForKey
-
getCurrentlyExecuting
- Returns:
- currently building things.
-
getCurrentlyBuildingByResultKey
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuildingByResultKey(@NotNull @NotNull ResultKey resultKey) -
getCurrentlyBuilding
-
setCurrentlyBuilding
@NotNull public @NotNull CurrentlyBuilding setCurrentlyBuilding(@NotNull @NotNull BuildContext buildContext, @NotNull @NotNull CurrentlyBuilding currentlyBuilding, Collection<BuildAgent> executableAgents, Collection<ElasticImageConfiguration> executableImages) -
startBuildingOnAgent
@Nullable public @Nullable CurrentlyBuilding startBuildingOnAgent(@NotNull @NotNull PlanResultKey planResultKey, long agentId, Date sentToAgentTimestamp) -
detachBuildFromAgent
public void detachBuildFromAgent(long agentId) -
removeCurrentlyBuilding
@Nullable public @Nullable CurrentlyBuilding removeCurrentlyBuilding(@NotNull @NotNull ResultKey resultKey) -
restoreState
public Set<ResultKey> restoreState(Set<PlanResultKey> pendingBuildKeys, ExecutorService executorService) throws ExecutionException, InterruptedException - Parameters:
pendingBuildKeys
-- Returns:
- keys of restored results
- Throws:
ExecutionException
InterruptedException
-
saveState
-