org.apache.ivy.core.resolve

Class VisitNode

public class VisitNode extends Object

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 depency 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:
Constructor Summary
VisitNode(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
ConfigurationgetConfiguration(String conf)
String[]getConfsToFetch()
CollectiongetDependencies(String conf)
DependencyDescriptorgetDependencyDescriptor()
ModuleDescriptorgetDescriptor()
IvyNodeEviction.EvictionDatagetEvictedData()
CollectiongetEvictedRevisions(ModuleId moduleId)
IvyNodeEviction.EvictionDatagetEvictionDataInRoot(String rootModuleConf, VisitNode ancestor)
ModuleRevisionIdgetId()
ModuleIdgetModuleId()
IvyNodegetNode()
VisitNodegetParent()
StringgetParentConf()
CollectiongetPath()
String[]getRealConfs(String conf)
IvyNodegetRealNode()
Returns the 'real' node currently visited.
StringgetRequestedConf()
String[]getRequiredConfigurations(VisitNode in, String inConf)
String[]getRequiredConfigurations()
ModuleRevisionIdgetResolvedId()
CollectiongetResolvedRevisions(ModuleId mid)
VisitNodegetRoot()
static VisitNodegetRoot(VisitNode parent)
StringgetRootModuleConf()
booleanhasProblem()
booleanisCircular()
Returns true if this node can already be found in the path
booleanisConfRequiredByMergedUsageOnly(String conf)
booleanisEvicted()
protected booleanisParentConfTransitive()
Checks if the current node's parent configuration is transitive.
booleanisTransitive()
Returns true if the current dependency descriptor is transitive and the parent configuration is transitive.
booleanloadData(String conf, boolean shouldBePublic)
voidmarkEvicted(IvyNodeEviction.EvictionData evictionData)
voidmarkEvicted(VisitNode parent, ConflictManager conflictMgr, Collection selected)
Marks the current node as evicted by the the given selected IvyNodes, in the given parent and root module configuration, with the given ConflictManager
voidsetParentConf(String parentConf)
voidsetRequestedConf(String requestedConf)
StringtoString()
voidupdateConfsToFetch(Collection confs)
voiduseRealNode()
Ask to the current visited node to use a real node only, if one exist.

Constructor Detail

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 Detail

getConfiguration

public Configuration getConfiguration(String conf)

getConfsToFetch

public String[] getConfsToFetch()

getDependencies

public Collection getDependencies(String conf)

getDependencyDescriptor

public DependencyDescriptor getDependencyDescriptor()

getDescriptor

public ModuleDescriptor getDescriptor()

getEvictedData

public IvyNodeEviction.EvictionData getEvictedData()

getEvictedRevisions

public Collection getEvictedRevisions(ModuleId moduleId)

getEvictionDataInRoot

public IvyNodeEviction.EvictionData getEvictionDataInRoot(String rootModuleConf, VisitNode ancestor)

getId

public ModuleRevisionId getId()

getModuleId

public ModuleId getModuleId()

getNode

public IvyNode getNode()

getParent

public VisitNode getParent()

getParentConf

public String getParentConf()

getPath

public Collection getPath()

getRealConfs

public String[] getRealConfs(String conf)

getRealNode

public IvyNode 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.

getRequestedConf

public String getRequestedConf()

Returns: Returns the configuration requested by the parent

getRequiredConfigurations

public String[] getRequiredConfigurations(VisitNode in, String inConf)

getRequiredConfigurations

public String[] getRequiredConfigurations()

getResolvedId

public ModuleRevisionId getResolvedId()

getResolvedRevisions

public Collection getResolvedRevisions(ModuleId mid)

getRoot

public VisitNode getRoot()

getRoot

public static VisitNode getRoot(VisitNode parent)

getRootModuleConf

public String getRootModuleConf()

hasProblem

public boolean hasProblem()

isCircular

public boolean isCircular()
Returns true if this node can already be found in the path

Returns:

isConfRequiredByMergedUsageOnly

public boolean isConfRequiredByMergedUsageOnly(String conf)

isEvicted

public boolean isEvicted()

isParentConfTransitive

protected boolean isParentConfTransitive()
Checks if the current node's parent configuration is transitive.

Parameters: node current node

Returns: true if the node's parent configuration is transitive

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.

loadData

public boolean loadData(String conf, boolean shouldBePublic)

markEvicted

public void markEvicted(IvyNodeEviction.EvictionData evictionData)

markEvicted

public void markEvicted(VisitNode parent, ConflictManager conflictMgr, Collection selected)
Marks the current node as evicted by the the given selected IvyNodes, in the given parent and root module configuration, with the given ConflictManager

Parameters: parent the VisitNode in which eviction has been made conflictMgr the conflict manager responsible for the eviction selected a Collection of IvyNode which have been selected

setParentConf

public void setParentConf(String parentConf)

setRequestedConf

public void setRequestedConf(String requestedConf)

toString

public String toString()

updateConfsToFetch

public void updateConfsToFetch(Collection confs)

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.