Class TopBuildDependencyGraphImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl
-
- All Implemented Interfaces:
BuildDependencyGraph,DependencyGraph<BuildPromotion>,DependencyGraphEstimate,TopBuildDependencyGraph
public class TopBuildDependencyGraphImpl extends Object implements TopBuildDependencyGraph
Represents the topmost graph. All operations on this graph are performed under the system access rights and on the whole set of nodes.
-
-
Constructor Summary
Constructors Constructor Description TopBuildDependencyGraphImpl(BuildPromotionEx topPromotion, BuildPromotionChangesCollector changesCollector, SecurityContextEx securityContext, BuildPromotionReplacementLog buildPromotionReplacementLog)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancollectChangesForGraph(CancelableTaskHolder cancelableTaskHolder)Collects changes for the whole graph.booleancontains(BuildPromotion promo)Returns true if node is part of this graph.Collection<SBuildType>getBuildTypes()Get all buildTypes in the graphintgetCompletedPercent(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.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.booleanisChangeCollectingNeeded()Returns true if changes collecting is not performed for this graphbooleanisEquivalentPartOf(BuildDependencyGraph otherGraph)Returns true if this graph is equivalent to a part of the specified graphvoidreplaceNode(BuildPromotionEx original, BuildPromotionEx newNode)Replaces a node in the graph with specified new node.voidtraverseBottomUp(ItemProcessor<BuildPromotion> promotionProcessor)Traverse dependency graph from bottom to topvoidtraverseTopDown(ItemProcessor<BuildPromotion> promotionProcessor)Traverse dependency graph from top to bottom
-
-
-
Constructor Detail
-
TopBuildDependencyGraphImpl
public TopBuildDependencyGraphImpl(@NotNull BuildPromotionEx topPromotion, @NotNull BuildPromotionChangesCollector changesCollector, @NotNull SecurityContextEx securityContext, @NotNull BuildPromotionReplacementLog buildPromotionReplacementLog)UseBuildDependencyGraphFactory.createGraph(jetbrains.buildServer.serverSide.BuildPromotionEx)to create graph.- Parameters:
topPromotion- top build promotionchangesCollector- default changes collectorsecurityContext- security context
-
-
Method Detail
-
isChangeCollectingNeeded
public boolean isChangeCollectingNeeded()
Description copied from interface:TopBuildDependencyGraphReturns true if changes collecting is not performed for this graph- Specified by:
isChangeCollectingNeededin interfaceTopBuildDependencyGraph- Returns:
- see above
-
collectChangesForGraph
public boolean collectChangesForGraph(@NotNull CancelableTaskHolder cancelableTaskHolder)Description copied from interface:TopBuildDependencyGraphCollects changes for the whole graph.- Specified by:
collectChangesForGraphin interfaceTopBuildDependencyGraph- Parameters:
cancelableTaskHolder- task holder (allows to interrupt changes collecting)- Returns:
- true if changes were successfully collected
-
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
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
-
isEquivalentPartOf
public boolean isEquivalentPartOf(@NotNull BuildDependencyGraph otherGraph)Description copied from interface:TopBuildDependencyGraphReturns true if this graph is equivalent to a part of the specified graph- Specified by:
isEquivalentPartOfin interfaceTopBuildDependencyGraph- Parameters:
otherGraph- other graph- Returns:
- see above
-
replaceNode
public void replaceNode(@NotNull BuildPromotionEx original, @NotNull BuildPromotionEx newNode)Description copied from interface:TopBuildDependencyGraphReplaces a node in the graph with specified new node.- Specified by:
replaceNodein interfaceTopBuildDependencyGraph- Parameters:
original- old nodenewNode- new node
-
getBuildTypes
@NotNull public Collection<SBuildType> getBuildTypes()
Description copied from interface:TopBuildDependencyGraphGet all buildTypes in the graph- Specified by:
getBuildTypesin interfaceTopBuildDependencyGraph- Returns:
- see above
-
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
-
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
-
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
-
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
-
-