Package com.atlassian.bamboo.build
Class CurrentlyBuildingContainer
- java.lang.Object
-
- com.atlassian.bamboo.build.CurrentlyBuildingContainer
-
@ThreadSafe public class CurrentlyBuildingContainer extends Object
A class that allows thread safe maps ofCurrentlyBuilding
objects keyed by plan key and buildAgentId.This bean registers itself as event listener.
-
-
Constructor Summary
Constructors Constructor Description CurrentlyBuildingContainer(AgentManager agentManager, com.atlassian.event.api.EventPublisher eventPublisher, XStreamFactory xStreamFactory)
-
Method Summary
-
-
-
Constructor Detail
-
CurrentlyBuildingContainer
public CurrentlyBuildingContainer(AgentManager agentManager, com.atlassian.event.api.EventPublisher eventPublisher, XStreamFactory xStreamFactory)
-
-
Method Detail
-
onSentToAgentTimingPoint
@EventListener public void onSentToAgentTimingPoint(@NotNull OutOfBandDeploymentTimingPoints.SentToAgent event)
-
getCurrentlyBuildingByKey
public List<CurrentlyBuilding> getCurrentlyBuildingByKey(Key key)
Immutable list of currently building by plan.
-
numberOfCurrentlyBuildingForKey
public int numberOfCurrentlyBuildingForKey(Key key)
-
getCurrentlyExecuting
@NotNull public @NotNull Iterable<CurrentlyBuilding> getCurrentlyExecuting()
- Returns:
- currently building things.
-
getCurrentlyBuildingByResultKey
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuildingByResultKey(@NotNull @NotNull ResultKey resultKey)
-
getCurrentlyBuilding
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuilding(long agentId)
-
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
protected void saveState(CurrentlyBuilding currentlyBuilding, boolean saveEvenIfFileExists)
-
-