com.atlassian.bamboo.build
Class CurrentlyBuildingContainer
java.lang.Object
com.atlassian.bamboo.build.CurrentlyBuildingContainer
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean
@ThreadSafe
public class CurrentlyBuildingContainer
- extends Object
- implements org.springframework.beans.factory.InitializingBean
A class that allows thread safe maps of CurrentlyBuilding
objects keyed by plan key and buildAgentId.
This bean registers itself as event listener via afterPropertiesSet()
method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CurrentlyBuildingContainer
public CurrentlyBuildingContainer(AgentManager agentManager,
ElasticImageConfigurationAccessor elasticImageConfigurationAccessor,
com.atlassian.event.api.EventPublisher eventPublisher,
XStreamFactory xStreamFactory)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
- Throws:
Exception
onAgentAssignedTimingPoint
@EventListener
public void onAgentAssignedTimingPoint(@NotNull
BuildTimingPoints.AgentAssigned event)
getCurrentlyBuildingByKey
public List<CurrentlyBuilding> getCurrentlyBuildingByKey(Key key)
- Immutable list of currently building by plan.
numberOfCurrentlyBuildingForKey
public int numberOfCurrentlyBuildingForKey(Key key)
getCurrentlyExecuting
@NotNull
public Iterable<CurrentlyBuilding> getCurrentlyExecuting()
- Returns:
- currently building things.
getCurrentlyBuildingByResultKey
@Nullable
public CurrentlyBuilding getCurrentlyBuildingByResultKey(@NotNull
ResultKey resultKey)
getCurrentlyBuilding
@Nullable
public CurrentlyBuilding getCurrentlyBuilding(long agentId)
setCurrentlyBuilding
@NotNull
public CurrentlyBuilding setCurrentlyBuilding(@NotNull
BuildContext buildContext,
@NotNull
CurrentlyBuilding currentlyBuilding,
Collection<BuildAgent> executableAgents,
Collection<ElasticImageConfiguration> executableImages)
startBuildingOnAgent
@NotNull
public CurrentlyBuilding startBuildingOnAgent(@NotNull
PlanResultKey planResultKey,
long agentId)
removeCurrentlyBuilding
@Nullable
public CurrentlyBuilding removeCurrentlyBuilding(@NotNull
ResultKey resultKey)
restoreState
public Set<ResultKey> restoreState(Set<PlanResultKey> pendingBuildKeys)
- Parameters:
pendingBuildKeys
-
- Returns:
- keys of restored results
saveState
protected void saveState(CurrentlyBuilding currentlyBuilding)
Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.