Package org.apache.ivy.core.resolve
Class VisitNode
java.lang.Object
org.apache.ivy.core.resolve.VisitNode
A visit node is an object used to represent one visit from one parent on an
IvyNode
of
the dependency graph. During dependency resolution, the ResolveEngine
visits nodes of the
dependency graph following the dependencies, thus the same node can be visited several times, if
it is requested from several module. In this case you will have one VisitNode per parent and per
root module configuration. Thus VisitNode stores data specific to the visit:
- parent
- the node from which the visit is occurring
- parentConf
- the configuration of the parent in which this node is visited
- rootModuleConf
- the configuration of the root module which is currently resolved
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ResolveData
Shared ResolveData instance, which can be used to get info on the current resolve processprivate Boolean
Boolean.TRUE if a node with a same module id as the one visited has already been visited in the current path.private IvyNode
The node which is currently visitedprivate VisitNode
Represents the current parent of the node during ivy visit of dependency graph.private String
The configuration of the parent module in the current visitprivate Collection<VisitNode>
Direct path from root to this node.private String
The configuration requested by the parent Note that this is the actual conf requested by the parent, not a configuration extended by the requested conf which actually trigger the node visitprivate VisitNode
The root node of the current visit It is null until it is required, see getRootprivate String
The root configuration which is currently visitedprivate IvyNodeUsage
IvyNode usage information to update when visiting the underlying IvyNode. -
Constructor Summary
ConstructorsConstructorDescriptionVisitNode
(ResolveData data, IvyNode node, VisitNode parent, String rootModuleConf, String parentConf) VisitNode
(ResolveData data, IvyNode node, VisitNode parent, String rootModuleConf, String parentConf, IvyNodeUsage usage) -
Method Summary
Modifier and TypeMethodDescriptionprivate Collection<VisitNode>
private VisitNode
getConfiguration
(String conf) String[]
getDependencies
(String conf) getEvictedRevisions
(ModuleId moduleId) getEvictionDataInRoot
(String rootModuleConf, VisitNode ancestor) getId()
getNode()
private IvyNode
getPath()
Get an ordered collection with the nodes from the root to this nodeString[]
getRealConfs
(String conf) Returns the 'real' node currently visited.String[]
String[]
getRequiredConfigurations
(VisitNode in, String inConf) getRoot()
static VisitNode
private IvyNodeUsage
getUsage()
(package private) VisitNode
Returns a VisitNode for the given node.boolean
boolean
Returns true if this node can already be found in the pathboolean
boolean
protected boolean
Checks if the current node's parent configuration is transitive.boolean
Returns true if the current dependency descriptor is transitive and the parent configuration is transitive.boolean
void
markEvicted
(IvyNodeEviction.EvictionData evictionData) void
markEvicted
(VisitNode parent, ConflictManager conflictMgr, Collection<IvyNode> selected) Marks the current node as evicted by the the given selected IvyNodes, in the given parent and root module configuration, with the givenConflictManager
void
setParentConf
(String parentConf) void
setRequestedConf
(String requestedConf) private ModuleRevisionId[]
toMrids
(Collection<VisitNode> path, ModuleRevisionId last) toString()
private VisitNode
traverse
(VisitNode parent, String parentConf, IvyNode node, IvyNodeUsage usage) private VisitNode
traverseChild
(String parentConf, IvyNode child) void
updateConfsToFetch
(Collection<String> confs) void
Ask to the current visited node to use a real node only, if one exist.
-
Field Details
-
node
The node which is currently visited -
parent
Represents the current parent of the node during ivy visit of dependency graph. -
root
The root node of the current visit It is null until it is required, see getRoot -
path
Direct path from root to this node. Note that the collection is ordered but is not a list implementation This collection is null until it is required, see getPath -
parentConf
The configuration of the parent module in the current visit -
requestedConf
The configuration requested by the parent Note that this is the actual conf requested by the parent, not a configuration extended by the requested conf which actually trigger the node visit -
rootModuleConf
The root configuration which is currently visited -
data
Shared ResolveData instance, which can be used to get info on the current resolve process -
isCircular
Boolean.TRUE if a node with a same module id as the one visited has already been visited in the current path. null if not computed yet Boolean.FALSE otherwise -
usage
IvyNode usage information to update when visiting the underlying IvyNode. This is usually the main IvyNodeUsage of the underlying node, except when we are visiting it coming from an evicted node replaced by the other one.
-
-
Constructor Details
-
VisitNode
public VisitNode(ResolveData data, IvyNode node, VisitNode parent, String rootModuleConf, String parentConf) -
VisitNode
public VisitNode(ResolveData data, IvyNode node, VisitNode parent, String rootModuleConf, String parentConf, IvyNodeUsage usage)
-
-
Method Details
-
getNode
-
getRequestedConf
- Returns:
- Returns the configuration requested by the parent
-
setRequestedConf
-
getParent
-
getRoot
-
getPath
Get an ordered collection with the nodes from the root to this node- Returns:
- Collection<VisitNode>
-
computePath
-
computeRoot
-
getParentConf
-
setParentConf
-
getRootModuleConf
-
getRoot
-
isTransitive
public boolean isTransitive()Returns true if the current dependency descriptor is transitive and the parent configuration is transitive. Otherwise returns false.- Returns:
- true if current node is transitive and the parent configuration is transitive.
-
isParentConfTransitive
protected boolean isParentConfTransitive()Checks if the current node's parent configuration is transitive.- Returns:
- true if the node's parent configuration is transitive
-
getRealNode
Returns the 'real' node currently visited. 'Real' means that if we are visiting a node created originally with only a version constraint, and if this version constraint has been resolved to an existing node in the graph, we will return the existing node, and not the one originally used which is about to be discarded, since it's not possible to have in the graph two nodes for the same ModuleRevisionId- Returns:
- the 'real' node currently visited.
-
useRealNode
public void useRealNode()Ask to the current visited node to use a real node only, if one exist. See getRealNode for details about what a 'real' node is. -
loadData
-
getDependencies
-
gotoNode
Returns a VisitNode for the given node. The given node must be a representation of the same module (usually in another revision) as the one visited by this node.- Parameters:
node
- the node to visit- Returns:
- a VisitNode for the given node
-
getUsage
-
traverseChild
-
traverse
-
toMrids
-
getResolvedId
-
updateConfsToFetch
-
getId
-
isEvicted
public boolean isEvicted() -
getRealConfs
-
hasProblem
public boolean hasProblem() -
getConfiguration
-
getEvictedData
-
getDependencyDescriptor
-
getParentNode
-
isCircular
public boolean isCircular()Returns true if this node can already be found in the path- Returns:
- boolean
-
getConfsToFetch
-
getRequiredConfigurations
-
getModuleId
-
getResolvedRevisions
-
markEvicted
-
getRequiredConfigurations
-
markEvicted
public void markEvicted(VisitNode parent, ConflictManager conflictMgr, Collection<IvyNode> selected) Marks the current node as evicted by the the given selected IvyNodes, in the given parent and root module configuration, with the givenConflictManager
- Parameters:
parent
- the VisitNode in which eviction has been madeconflictMgr
- the conflict manager responsible for the evictionselected
- a Collection ofIvyNode
which have been selected
-
getDescriptor
-
getEvictionDataInRoot
public IvyNodeEviction.EvictionData getEvictionDataInRoot(String rootModuleConf, VisitNode ancestor) -
getEvictedRevisions
-
toString
-
isConfRequiredByMergedUsageOnly
-