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 boolean
contains(BuildPromotion promo)
Returns true if node is part of this graph.int
getCompletedPercent(boolean includeTopBuild)
Returns string representing progress in percents.long
getDurationOvertime(boolean includeTopBuild)
Returns current overtime for builds graph, or -1 if there is no overtime or estimate is not available.long
getDurationOvertime(boolean includeTopBuild, long currentTime)
long
getEstimationForTimeLeft(boolean includeTopBuild)
Returns server estimate for all builds in graph to finishCollection<BuildPromotion>
getNodes()
Map<String,BuildPromotion>
getNodesMap()
int
getNumberOfNodes()
Returns number of nodes in this graph.Date
getStartedDate()
Get date of first build in chain started.Status
getStatus()
long
getTimePassed()
Get number of millis passed since start of the chainBuildPromotionEx
getTop()
Returns top node of the graph.boolean
inaccessibleNodesExist()
Returns true if there are inaccessible (by current user permissions) nodes that were not included into this graph.protected void
rebuildSequence()
void
traverseBottomUp(ItemProcessor<BuildPromotion> promotionProcessor)
Traverse dependency graph from bottom to topvoid
traverseTopDown(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:DependencyGraph
Traverse dependency graph from bottom to top- Specified by:
traverseBottomUp
in interfaceDependencyGraph<BuildPromotion>
- Parameters:
promotionProcessor
- item processor
-
traverseTopDown
public void traverseTopDown(@NotNull ItemProcessor<BuildPromotion> promotionProcessor)
Description copied from interface:DependencyGraph
Traverse dependency graph from top to bottom- Specified by:
traverseTopDown
in interfaceDependencyGraph<BuildPromotion>
- Parameters:
promotionProcessor
- item processor
-
getNumberOfNodes
public int getNumberOfNodes()
Description copied from interface:DependencyGraph
Returns number of nodes in this graph.- Specified by:
getNumberOfNodes
in interfaceDependencyGraph<BuildPromotion>
- Returns:
- number of nodes in this graph.
-
getTop
@NotNull public BuildPromotionEx getTop()
Description copied from interface:BuildDependencyGraph
Returns top node of the graph.- Specified by:
getTop
in interfaceBuildDependencyGraph
- Specified by:
getTop
in interfaceDependencyGraph<BuildPromotion>
- Returns:
- the graph top node.
-
getStatus
@NotNull public Status getStatus()
- Specified by:
getStatus
in 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.RUN
then dependent build won't be considered as failing.
-
inaccessibleNodesExist
public boolean inaccessibleNodesExist()
Description copied from interface:BuildDependencyGraph
Returns true if there are inaccessible (by current user permissions) nodes that were not included into this graph.- Specified by:
inaccessibleNodesExist
in interfaceBuildDependencyGraph
- Returns:
- see above
-
contains
public boolean contains(@NotNull BuildPromotion promo)
Description copied from interface:DependencyGraph
Returns true if node is part of this graph.- Specified by:
contains
in interfaceDependencyGraph<BuildPromotion>
- Parameters:
promo
- graph node- Returns:
- see above
-
getNodes
@NotNull public Collection<BuildPromotion> getNodes()
- Specified by:
getNodes
in interfaceDependencyGraph<BuildPromotion>
- Returns:
- all of the graph nodes, including the top node itself
-
getNodesMap
@NotNull public Map<String,BuildPromotion> getNodesMap()
- Specified by:
getNodesMap
in 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:DependencyGraphEstimate
Returns server estimate for all builds in graph to finish- Specified by:
getEstimationForTimeLeft
in 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:DependencyGraphEstimate
Returns current overtime for builds graph, or -1 if there is no overtime or estimate is not available.- Specified by:
getDurationOvertime
in 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:DependencyGraphEstimate
Returns string representing progress in percents.- Specified by:
getCompletedPercent
in 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:DependencyGraphEstimate
Get number of millis passed since start of the chain- Specified by:
getTimePassed
in interfaceDependencyGraphEstimate
- Returns:
- number of milliseconds since chain start
-
getStartedDate
@Nullable public Date getStartedDate()
Description copied from interface:DependencyGraphEstimate
Get date of first build in chain started. Does not include builds, substituded by chain optimizer- Specified by:
getStartedDate
in interfaceDependencyGraphEstimate
- Returns:
- null if chain has not been started yet, otherwise see above
-
-