Class BuildDependencyGraphImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.dependency.BuildDependencyGraphImpl
-
- All Implemented Interfaces:
BuildDependencyGraph,DependencyGraph<BuildPromotion>,DependencyGraphEstimate
public class BuildDependencyGraphImpl extends Object implements BuildDependencyGraph
-
-
Constructor Summary
Constructors Constructor Description BuildDependencyGraphImpl(BuildPromotionEx topPromotion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(BuildPromotion promo)Returns true if node is part of this graph.intgetCompletedPercent(boolean includeTopBuild)Returns string representing progress in percents.longgetDurationOvertime(boolean includeTopBuild)Returns current overtime for builds graph, or -1 if there is no overtime or estimate is not available.longgetDurationOvertime(boolean includeTopBuild, long currentTime)longgetEstimationForTimeLeft(boolean includeTopBuild)Returns server estimate for all builds in graph to finishCollection<BuildPromotion>getNodes()Map<String,BuildPromotion>getNodesMap()intgetNumberOfNodes()Returns number of nodes in this graph.DategetStartedDate()Get date of first build in chain started.StatusgetStatus()longgetTimePassed()Get number of millis passed since start of the chainBuildPromotionExgetTop()Returns top node of the graph.booleaninaccessibleNodesExist()Returns true if there are inaccessible (by current user permissions) nodes that were not included into this graph.protected voidrebuildSequence()voidtraverseBottomUp(ItemProcessor<BuildPromotion> promotionProcessor)Traverse dependency graph from bottom to topvoidtraverseTopDown(ItemProcessor<BuildPromotion> promotionProcessor)Traverse dependency graph from top to bottom
-
-
-
Constructor Detail
-
BuildDependencyGraphImpl
public BuildDependencyGraphImpl(@NotNull BuildPromotionEx topPromotion)UseBuildDependencyGraphFactory.createGraph(jetbrains.buildServer.serverSide.BuildPromotionEx)to create graph.- Parameters:
topPromotion- top build promotion
-
-
Method Detail
-
traverseBottomUp
public void traverseBottomUp(@NotNull ItemProcessor<BuildPromotion> promotionProcessor)Description copied from interface:DependencyGraphTraverse dependency graph from bottom to top- Specified by:
traverseBottomUpin interfaceDependencyGraph<BuildPromotion>- Parameters:
promotionProcessor- item processor
-
traverseTopDown
public void traverseTopDown(@NotNull ItemProcessor<BuildPromotion> promotionProcessor)Description copied from interface:DependencyGraphTraverse dependency graph from top to bottom- Specified by:
traverseTopDownin interfaceDependencyGraph<BuildPromotion>- Parameters:
promotionProcessor- item processor
-
getNumberOfNodes
public int getNumberOfNodes()
Description copied from interface:DependencyGraphReturns number of nodes in this graph.- Specified by:
getNumberOfNodesin interfaceDependencyGraph<BuildPromotion>- Returns:
- number of nodes in this graph.
-
getTop
@NotNull public BuildPromotionEx getTop()
Description copied from interface:BuildDependencyGraphReturns top node of the graph.- Specified by:
getTopin interfaceBuildDependencyGraph- Specified by:
getTopin interfaceDependencyGraph<BuildPromotion>- Returns:
- the graph top node.
-
getStatus
@NotNull public Status getStatus()
- Specified by:
getStatusin interfaceBuildDependencyGraph- Returns:
- current status of the top build promotion computed by taking into account all build promotions participating in dependency graph.
If there are no builds associated with graph build promotions, the status is unknown.
If there are failing dependencies, then status of the top promotion is determined by dependency options.
For instance if dependency fails, but dependent build has continuation option:
DependencyOptions.BuildContinuationMode.RUNthen dependent build won't be considered as failing.
-
inaccessibleNodesExist
public boolean inaccessibleNodesExist()
Description copied from interface:BuildDependencyGraphReturns true if there are inaccessible (by current user permissions) nodes that were not included into this graph.- Specified by:
inaccessibleNodesExistin interfaceBuildDependencyGraph- Returns:
- see above
-
contains
public boolean contains(@NotNull BuildPromotion promo)Description copied from interface:DependencyGraphReturns true if node is part of this graph.- Specified by:
containsin interfaceDependencyGraph<BuildPromotion>- Parameters:
promo- graph node- Returns:
- see above
-
getNodes
@NotNull public Collection<BuildPromotion> getNodes()
- Specified by:
getNodesin interfaceDependencyGraph<BuildPromotion>- Returns:
- all of the graph nodes, including the top node itself
-
getNodesMap
@NotNull public Map<String,BuildPromotion> getNodesMap()
- Specified by:
getNodesMapin interfaceDependencyGraph<BuildPromotion>- Returns:
- map of all of the graph nodes, where key is id of build configuration
-
rebuildSequence
protected void rebuildSequence()
-
getEstimationForTimeLeft
public long getEstimationForTimeLeft(boolean includeTopBuild)
Description copied from interface:DependencyGraphEstimateReturns server estimate for all builds in graph to finish- Specified by:
getEstimationForTimeLeftin interfaceDependencyGraphEstimate- Parameters:
includeTopBuild- - if false, do not include build time of the top build- Returns:
- estimation for time left to finish all builds in graph in milliseconds or -1 if estimate is not available.
-
getDurationOvertime
public long getDurationOvertime(boolean includeTopBuild)
Description copied from interface:DependencyGraphEstimateReturns current overtime for builds graph, or -1 if there is no overtime or estimate is not available.- Specified by:
getDurationOvertimein interfaceDependencyGraphEstimate- Parameters:
includeTopBuild- - if false, do not include overtime of the top build- Returns:
- see above
-
getDurationOvertime
public long getDurationOvertime(boolean includeTopBuild, long currentTime)
-
getCompletedPercent
public int getCompletedPercent(boolean includeTopBuild)
Description copied from interface:DependencyGraphEstimateReturns string representing progress in percents.- Specified by:
getCompletedPercentin interfaceDependencyGraphEstimate- Parameters:
includeTopBuild- - if false, do not include build time of top build- Returns:
- Returns progress in percents
-
getTimePassed
public long getTimePassed()
Description copied from interface:DependencyGraphEstimateGet number of millis passed since start of the chain- Specified by:
getTimePassedin interfaceDependencyGraphEstimate- Returns:
- number of milliseconds since chain start
-
getStartedDate
@Nullable public Date getStartedDate()
Description copied from interface:DependencyGraphEstimateGet date of first build in chain started. Does not include builds, substituded by chain optimizer- Specified by:
getStartedDatein interfaceDependencyGraphEstimate- Returns:
- null if chain has not been started yet, otherwise see above
-
-