org.apache.ivy.core.resolve

Class IvyNode

public class IvyNode extends Object implements Comparable

Constructor Summary
IvyNode(ResolveData data, IvyNode parent, DependencyDescriptor dd)
IvyNode(ResolveData data, ModuleDescriptor md)
Method Summary
voidaddCaller(String rootModuleConf, IvyNode callerNode, String callerConf, String requestedConf, String[] dependencyConfs, DependencyDescriptor dd)
voidblacklist(IvyNodeBlacklist bdata)
Blacklists the current node, so that a new resolve process won't ever consider this node as available in the repository.
voidclean()
Clean data related to one root module configuration only
intcompareTo(Object obj)
voiddiscardConf(String rootModuleConf, String conf)
booleandoesCallersExclude(String rootModuleConf, Artifact artifact, Stack callersStack)
booleanequals(Object obj)
IvyNodefindNode(ModuleRevisionId mrid)
Artifact[]getAllArtifacts()
Returns all the artifacts of this dependency required in all the root module configurations
IvyNodeCallers.Caller[]getAllCallers()
CollectiongetAllCallersModuleIds()
CollectiongetAllEvictingConflictManagers()
CollectiongetAllEvictingNodes()
CollectiongetAllEvictingNodesDetails()
IvyNodeCallers.Caller[]getAllRealCallers()
Artifact[]getArtifacts(String rootModuleConf)
Returns the artifacts of this dependency required in the configurations themselves required in the given root module configuration
IvyNodeBlacklistgetBlacklistData(String rootModuleConf)
Returns the blacklist data of this node in the given root module conf, or null if this node is not blacklisted in this root module conf.
IvyNodeCallers.Caller[]getCallers(String rootModuleConf)
ConfigurationgetConfiguration(String conf)
String[]getConfigurations(String rootModuleConf)
Returns the configurations of the dependency required in a given root module configuration.
ConflictManagergetConflictManager(ModuleId mid)
String[]getConfsToFetch()
ResolveDatagetData()
CollectiongetDependencies(String rootModuleConf, String[] confs)
CollectiongetDependencies(String rootModuleConf, String conf, String requestedConf)
DependencyDescriptorgetDependencyDescriptor(IvyNode parent)
ModuleDescriptorgetDescriptor()
String[]getEvictedConfs()
IvyNodeEviction.EvictionDatagetEvictedData(String rootModuleConf)
CollectiongetEvictedNodes(ModuleId mid, String rootModuleConf)
CollectiongetEvictedRevisions(ModuleId mid, String rootModuleConf)
IvyNodeEviction.EvictionDatagetEvictionDataInRoot(String rootModuleConf, IvyNode ancestor)
ModuleRevisionIdgetId()
longgetLastModified()
Returns the last modified timestamp of the module represented by this Node, or 0 if the last modified timestamp is currently unkwown (module not loaded)
IvyNodeUsagegetMainUsage()
ModuleIdgetModuleId()
ResolvedModuleRevisiongetModuleRevision()
CollectiongetPendingConflicts(String rootModuleConf, ModuleId mid)
Returns a collection of Nodes in conflict for which conflict has been detected but conflict resolution hasn't been done yet
ExceptiongetProblem()
StringgetProblemMessage()
longgetPublication()
String[]getRealConfs(String conf)
IvyNodegetRealNode()
String[]getRequiredConfigurations(IvyNode in, String inConf)
returns the required configurations from the given node
String[]getRequiredConfigurations()
returns all the current required configurations of the node
ModuleRevisionIdgetResolvedId()
SetgetResolvedNodes(ModuleId moduleId, String rootModuleConf)
A copy of the set of resolved nodes (real nodes)
CollectiongetResolvedRevisions(ModuleId moduleId, String rootModuleConf)
IvyNodegetRoot()
String[]getRootModuleConfigurations()
Returns the root module configurations in which this dependency is required
SetgetRootModuleConfigurationsSet()
Returns the root module configurations in which this dependency is required
Artifact[]getSelectedArtifacts(Filter artifactFilter)
Returns all the artifacts of this dependency required in the root module configurations in which the node is not evicted nor blacklisted
booleanhasAnyMergedUsageWithTransitiveDependency(String rootModuleConf)
Indicates if there is any of the merged usages of this node which has a depender with transitive dependency descriptor.
booleanhasConfigurationsToLoad()
inthashCode()
booleanhasProblem()
booleanisBlacklisted(String rootModuleConf)
Indicates if this node has been blacklisted in the given root module conf.
booleanisCompletelyBlacklisted()
Indicates if this node has been blacklisted in all root module configurations.
booleanisCompletelyEvicted()
protected booleanisConfRequiredByMergedUsageOnly(String rootModuleConf, String conf)
booleanisDownloaded()
booleanisEvicted(String rootModuleConf)
booleanisFetched(String conf)
booleanisLoaded()
booleanisSearched()
booleanloadData(String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNodeUsage usage)
After the call node may be discarded.
voidmarkEvicted(IvyNodeEviction.EvictionData evictionData)
voidmarkEvicted(String rootModuleConf, IvyNode node, ConflictManager conflictManager, Collection resolved)
voidsetEvictedNodes(ModuleId moduleId, String rootModuleConf, Collection evicted)
voidsetPendingConflicts(ModuleId moduleId, String rootModuleConf, Collection conflicts)
voidsetResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection resolved)
StringtoString()
voidupdateConfsToFetch(Collection confs)

Constructor Detail

IvyNode

public IvyNode(ResolveData data, IvyNode parent, DependencyDescriptor dd)

IvyNode

public IvyNode(ResolveData data, ModuleDescriptor md)

Method Detail

addCaller

public void addCaller(String rootModuleConf, IvyNode callerNode, String callerConf, String requestedConf, String[] dependencyConfs, DependencyDescriptor dd)

blacklist

public void blacklist(IvyNodeBlacklist bdata)
Blacklists the current node, so that a new resolve process won't ever consider this node as available in the repository.

This is useful in combination with RestartResolveProcess for conflict manager implementation which use a best effort strategy to find compatible dependency set, like LatestCompatibleConflictManager

Parameters: rootModuleConf the root module configuration in which the node should be blacklisted

clean

public void clean()
Clean data related to one root module configuration only

compareTo

public int compareTo(Object obj)

discardConf

public void discardConf(String rootModuleConf, String conf)

doesCallersExclude

public boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack callersStack)

equals

public boolean equals(Object obj)

findNode

public IvyNode findNode(ModuleRevisionId mrid)

getAllArtifacts

public Artifact[] getAllArtifacts()
Returns all the artifacts of this dependency required in all the root module configurations

Returns:

getAllCallers

public IvyNodeCallers.Caller[] getAllCallers()

getAllCallersModuleIds

public Collection getAllCallersModuleIds()

getAllEvictingConflictManagers

public Collection getAllEvictingConflictManagers()

getAllEvictingNodes

public Collection getAllEvictingNodes()

getAllEvictingNodesDetails

public Collection getAllEvictingNodesDetails()

getAllRealCallers

public IvyNodeCallers.Caller[] getAllRealCallers()

getArtifacts

public Artifact[] getArtifacts(String rootModuleConf)
Returns the artifacts of this dependency required in the configurations themselves required in the given root module configuration

Parameters: rootModuleConf

Returns:

getBlacklistData

public IvyNodeBlacklist getBlacklistData(String rootModuleConf)
Returns the blacklist data of this node in the given root module conf, or null if this node is not blacklisted in this root module conf.

Parameters: rootModuleConf the root module configuration to consider

Returns: the blacklist data if any

getCallers

public IvyNodeCallers.Caller[] getCallers(String rootModuleConf)

getConfiguration

public Configuration getConfiguration(String conf)

getConfigurations

public String[] getConfigurations(String rootModuleConf)
Returns the configurations of the dependency required in a given root module configuration.

Parameters: rootModuleConf

Returns:

getConflictManager

public ConflictManager getConflictManager(ModuleId mid)

getConfsToFetch

public String[] getConfsToFetch()

getData

public ResolveData getData()

getDependencies

public Collection getDependencies(String rootModuleConf, String[] confs)

getDependencies

public Collection getDependencies(String rootModuleConf, String conf, String requestedConf)

getDependencyDescriptor

public DependencyDescriptor getDependencyDescriptor(IvyNode parent)

getDescriptor

public ModuleDescriptor getDescriptor()

getEvictedConfs

public String[] getEvictedConfs()

getEvictedData

public IvyNodeEviction.EvictionData getEvictedData(String rootModuleConf)

getEvictedNodes

public Collection getEvictedNodes(ModuleId mid, String rootModuleConf)

getEvictedRevisions

public Collection getEvictedRevisions(ModuleId mid, String rootModuleConf)

getEvictionDataInRoot

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

getId

public ModuleRevisionId getId()

getLastModified

public long getLastModified()
Returns the last modified timestamp of the module represented by this Node, or 0 if the last modified timestamp is currently unkwown (module not loaded)

Returns: the last modified timestamp of the module represented by this Node

getMainUsage

public IvyNodeUsage getMainUsage()

getModuleId

public ModuleId getModuleId()

getModuleRevision

public ResolvedModuleRevision getModuleRevision()

getPendingConflicts

public Collection getPendingConflicts(String rootModuleConf, ModuleId mid)
Returns a collection of Nodes in conflict for which conflict has been detected but conflict resolution hasn't been done yet

Parameters: rootModuleConf mid the module id for which pending conflicts should be found

Returns: a Collection of IvyNode in pending conflict

getProblem

public Exception getProblem()

getProblemMessage

public String getProblemMessage()

getPublication

public long getPublication()

getRealConfs

public String[] getRealConfs(String conf)

getRealNode

public IvyNode getRealNode()

getRequiredConfigurations

public String[] getRequiredConfigurations(IvyNode in, String inConf)
returns the required configurations from the given node

Parameters: in

Returns:

getRequiredConfigurations

public String[] getRequiredConfigurations()
returns all the current required configurations of the node

Returns:

getResolvedId

public ModuleRevisionId getResolvedId()

getResolvedNodes

public Set getResolvedNodes(ModuleId moduleId, String rootModuleConf)
A copy of the set of resolved nodes (real nodes)

getResolvedRevisions

public Collection getResolvedRevisions(ModuleId moduleId, String rootModuleConf)

getRoot

public IvyNode getRoot()

getRootModuleConfigurations

public String[] getRootModuleConfigurations()
Returns the root module configurations in which this dependency is required

Returns:

getRootModuleConfigurationsSet

public Set getRootModuleConfigurationsSet()
Returns the root module configurations in which this dependency is required

Returns:

getSelectedArtifacts

public Artifact[] getSelectedArtifacts(Filter artifactFilter)
Returns all the artifacts of this dependency required in the root module configurations in which the node is not evicted nor blacklisted

Parameters: artifactFilter

Returns:

hasAnyMergedUsageWithTransitiveDependency

public boolean hasAnyMergedUsageWithTransitiveDependency(String rootModuleConf)
Indicates if there is any of the merged usages of this node which has a depender with transitive dependency descriptor.

If at there is at least one usage from the merged usages for which there is a depender in the given root module conf which has a dependency descriptor with transitive == true, then it returns true. Otherwise it returns false.

Parameters: rootModuleConf the root module configuration to consider

Returns: true if there is any merged usage with transitive dd, false otherwise.

hasConfigurationsToLoad

public boolean hasConfigurationsToLoad()

hashCode

public int hashCode()

hasProblem

public boolean hasProblem()

isBlacklisted

public boolean isBlacklisted(String rootModuleConf)
Indicates if this node has been blacklisted in the given root module conf.

A blacklisted node should be considered as if it doesn't even exist on the repository.

Parameters: rootModuleConf the root module conf for which we'd like to know if the node is blacklisted

Returns: true if this node is blacklisted int he given root module conf, false otherwise

See Also: IvyNode

isCompletelyBlacklisted

public boolean isCompletelyBlacklisted()
Indicates if this node has been blacklisted in all root module configurations.

Returns: true if this node is blacklisted in all root module configurations, false otherwise

See Also: IvyNode

isCompletelyEvicted

public boolean isCompletelyEvicted()

isConfRequiredByMergedUsageOnly

protected boolean isConfRequiredByMergedUsageOnly(String rootModuleConf, String conf)

isDownloaded

public boolean isDownloaded()

isEvicted

public boolean isEvicted(String rootModuleConf)

isFetched

public boolean isFetched(String conf)

isLoaded

public boolean isLoaded()

isSearched

public boolean isSearched()

loadData

public boolean loadData(String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNodeUsage usage)
After the call node may be discarded. To avoid using discarded node, make sure to get the real node after the call IvyNode node = ... node.loadData(); node = node.getRealNode(); ...

markEvicted

public void markEvicted(IvyNodeEviction.EvictionData evictionData)

markEvicted

public void markEvicted(String rootModuleConf, IvyNode node, ConflictManager conflictManager, Collection resolved)

setEvictedNodes

public void setEvictedNodes(ModuleId moduleId, String rootModuleConf, Collection evicted)

setPendingConflicts

public void setPendingConflicts(ModuleId moduleId, String rootModuleConf, Collection conflicts)

setResolvedNodes

public void setResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection resolved)

toString

public String toString()

updateConfsToFetch

public void updateConfsToFetch(Collection confs)