Package org.apache.ivy.core.resolve
Class IvyNode
java.lang.Object
org.apache.ivy.core.resolve.IvyNode
- All Implemented Interfaces:
Comparable<IvyNode>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IvyNodeCallersprivate Collection<String>private ResolveDataprivate Map<IvyNode,DependencyDescriptor> private booleanprivate IvyNodeEvictionprivate static final Patternprivate Collection<String>private ModuleRevisionIdprivate Collection<String>private ModuleDescriptorprivate Map<ModuleRevisionId,IvyNodeUsage> private ResolvedModuleRevisionprivate Exceptionprivate IvyNodeprivate booleanprivate ResolveEngineSettingsprivate IvyNodeUsage -
Constructor Summary
ConstructorsConstructorDescriptionIvyNode(ResolveData data, ModuleDescriptor md) IvyNode(ResolveData data, IvyNode parent, DependencyDescriptor dd) -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> voidaddAllIfNotNull(Collection<T> into, Collection<T> col) private voidaddArtifactsFromMergedUsage(String rootModuleConf, Set<Artifact> artifacts) private voidaddArtifactsFromOwnUsage(Set<Artifact> artifacts, Set<DependencyArtifactDescriptor> dependencyArtifacts) voidaddCaller(String rootModuleConf, IvyNode callerNode, String callerConf, String requestedConf, String[] dependencyConfs, DependencyDescriptor dd) private voidaddDependencyDescriptor(IvyNode parent, DependencyDescriptor dd) private voidaddRootModuleConfigurations(IvyNodeUsage usage, String rootModuleConf, String[] dependencyConfs) voidblacklist(IvyNodeBlacklist bdata) Blacklists the current node, so that a new resolve process won't ever consider this node as available in the repository.(package private) booleancanExclude(String rootModuleConf) voidclean()Clean data related to one root module configuration onlyprivate voidclearEvictionDataInAllCallers(String rootModuleConf, Stack<IvyNode> callerStack) intbooleandirectlyExcludes(ModuleDescriptor md, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact) voiddiscardConf(String rootModuleConf, String conf) Deprecated.booleandoesCallersExclude(String rootModuleConf, Artifact artifact, Deque<IvyNode> callersStack) booleandoesCallersExclude(String rootModuleConf, Artifact artifact, Stack<ModuleRevisionId> callersStack) Deprecated.(package private) BooleandoesExclude(ModuleDescriptor md, String rootModuleConf, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact, Deque<IvyNode> callersStack) booleanprivate static Collection<Artifact>findArtifactsMatching(IncludeRule rule, Map<ArtifactId, Artifact> allArtifacts) findNode(ModuleRevisionId mrid) private Collection<IvyNode>Finds and returns a path in callers from the given module id to the current nodeprivate Collection<IvyNode>Artifact[]Returns all the artifacts of this dependency required in all the root module configurationsprivate Collection<IvyNodeUsage>Artifact[]getArtifacts(String rootModuleConf) Returns the artifacts of this dependency required in the configurations themselves required in the given root module configurationgetBlacklistData(String rootModuleConf) Returns the blacklist data of this node in the given root module conf, ornullif this node is not blacklisted in this root module conf.getCallers(String rootModuleConf) getConfiguration(String conf) String[]getConfigurations(String rootModuleConf) Returns the configurations of the dependency required in a given root module configuration.String[]getData()private StringgetDefaultConf(String conf) getDependencies(String rootModuleConf, String[] confs, String requestedConf) getDependencies(String rootModuleConf, String conf, String requestedConf) Load the dependencies of the current nodegetDependencyDescriptor(IvyNode parent) private IvyNodegetDirectCallerFor(ModuleId from) String[]getEvictedData(String rootModuleConf) getEvictedNodes(ModuleId mid, String rootModuleConf) getEvictedRevisions(ModuleId mid, String rootModuleConf) getEvictionDataInRoot(String rootModuleConf, IvyNode ancestor) getId()longReturns the last modified timestamp of the module represented by this Node, or 0 if the last modified timestamp is currently unknown (module not loaded)private StringgetMainConf(String conf) 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 yetlongString[]getRealConfs(String conf) String[]returns all the current required configurations of the nodeString[]getRequiredConfigurations(IvyNode in, String inConf) returns the required configurations from the given nodegetResolvedNodes(ModuleId moduleId, String rootModuleConf) A copy of the set of resolved nodes (real nodes)getResolvedRevisions(ModuleId moduleId, String rootModuleConf) getRoot()String[]Returns the root module configurations in which this dependency is requiredReturns the root module configurations in which this dependency is requiredArtifact[]getSelectedArtifacts(Filter<Artifact> artifactFilter) Returns all the artifacts of this dependency required in the root module configurations in which the node is not evicted nor blacklistedprivate booleanhandleConfiguration(boolean loaded, String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNodeUsage usage) booleanhasAnyMergedUsageWithTransitiveDependency(String rootModuleConf) Indicates if there is any of the merged usages of this node which has a depender with transitive dependency descriptor.booleaninthashCode()booleanprivate voidinit(ResolveData data) booleanisBlacklisted(String rootModuleConf) Indicates if this node has been blacklisted in the given root module conf.booleanIndicates if this node has been blacklisted in all root module configurations.booleanprotected booleanisConfRequiredByMergedUsageOnly(String rootModuleConf, String conf) private booleanisDependencyModuleExcluded(DependencyDescriptor dd, String rootModuleConf, ModuleRevisionId dependencyRevisionId, String conf) booleanbooleanbooleanbooleanisLoaded()(package private) booleanisRoot()private booleanisRootModuleConfLoaded(String rootModuleConf) booleanbooleanloadData(String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNodeUsage usage) After the call node may be discarded.voidmarkEvicted(String rootModuleConf, IvyNode node, ConflictManager conflictManager, Collection<IvyNode> resolved) voidmarkEvicted(IvyNodeEviction.EvictionData evictionData) private booleanmarkRootModuleConfLoaded(String rootModuleConf) private voidmoveToRealNode(String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNode resolved) private String[]resolveSpecialConfigurations(String[] dependencyConfigurations) resolve the '*' special configurations if necessary and possiblevoidsetEvictedNodes(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> evicted) voidsetPendingConflicts(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> conflicts) voidsetResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> resolved) private ModuleRevisionId[]toMrids(Collection<IvyNode> path, IvyNode depNode) toString()voidupdateConfsToFetch(Collection<String> confs) private voidupdateDataFrom(IvyNode node, String rootModuleConf, boolean real) Update data in this node from data of the given node, for the given root module configuration.
-
Field Details
-
FALLBACK_CONF_PATTERN
-
data
-
settings
-
callers
-
eviction
-
root
-
id
-
dds
-
md
-
module
-
problem
-
downloaded
private boolean downloaded -
searched
private boolean searched -
confsToFetch
-
fetchedConfigurations
-
loadedRootModuleConfs
-
usage
-
mergedUsages
-
-
Constructor Details
-
IvyNode
-
IvyNode
-
-
Method Details
-
init
-
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 callIvyNode node = ... node.loadData(); node = node.getRealNode(); ...- Parameters:
rootModuleConf- Stringparent- IvyNodeparentConf- Stringconf- StringshouldBePublic- booleanusage- IvyNodeUsage- Returns:
- boolean
-
moveToRealNode
-
getDependencies
public Collection<IvyNode> getDependencies(String rootModuleConf, String[] confs, String requestedConf) -
getDependencies
public Collection<IvyNode> getDependencies(String rootModuleConf, String conf, String requestedConf) Load the dependencies of the current nodeThe resulting collection of nodes may have some configuration to load
- Parameters:
rootModuleConf- the requested configuration of the root moduleconf- the configuration to load of this noderequestedConf- the actual node conf requested, possibly extending theconfone.- Returns:
CollectionofIvyNode
-
addDependencyDescriptor
-
getDependencyDescriptor
-
isDependencyModuleExcluded
private boolean isDependencyModuleExcluded(DependencyDescriptor dd, String rootModuleConf, ModuleRevisionId dependencyRevisionId, String conf) -
doesExclude
Boolean doesExclude(ModuleDescriptor md, String rootModuleConf, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact, Deque<IvyNode> callersStack) -
directlyExcludes
public boolean directlyExcludes(ModuleDescriptor md, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact) -
hasConfigurationsToLoad
public boolean hasConfigurationsToLoad() -
markRootModuleConfLoaded
-
isRootModuleConfLoaded
-
handleConfiguration
private boolean handleConfiguration(boolean loaded, String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNodeUsage usage) -
getDefaultConf
-
getMainConf
-
updateConfsToFetch
-
resolveSpecialConfigurations
resolve the '*' special configurations if necessary and possible -
getRequiredConfigurations
returns the required configurations from the given node- Parameters:
in- IvyNodeinConf- ditto- Returns:
- array of configuration names
-
addAllIfNotNull
-
getRequiredConfigurations
returns all the current required configurations of the node- Returns:
- array of configuration names
-
getConfiguration
-
getConfigurations
Returns the configurations of the dependency required in a given root module configuration.- Parameters:
rootModuleConf- String- Returns:
- array of configuration names
-
isConfRequiredByMergedUsageOnly
-
discardConf
Deprecated. -
addRootModuleConfigurations
private void addRootModuleConfigurations(IvyNodeUsage usage, String rootModuleConf, String[] dependencyConfs) -
getRootModuleConfigurations
Returns the root module configurations in which this dependency is required- Returns:
- array of configuration names
-
getRootModuleConfigurationsSet
Returns the root module configurations in which this dependency is required- Returns:
Setof configuration names
-
getConfsToFetch
-
getRealConfs
-
findPath
Finds and returns a path in callers from the given module id to the current node- Parameters:
from- the module id to start the path from- Returns:
- a collection representing the path, starting with the from node, followed by the list of nodes being one path to the current node, excluded
-
findPath
-
updateDataFrom
Update data in this node from data of the given node, for the given root module configuration.- Parameters:
node- the source node from which data should be copiedrootModuleConf- the root module configuration for which data should be updatedreal- true if the node to update from actually corresponds to the same real node (usually updated because of dynamic revision resolution), false if it's not the same real node (usually updated because of node eviction)
-
getAllUsages
-
getAllArtifacts
Returns all the artifacts of this dependency required in all the root module configurations- Returns:
- array of
Artifacts
-
getSelectedArtifacts
Returns all the artifacts of this dependency required in the root module configurations in which the node is not evicted nor blacklisted- Parameters:
artifactFilter- Filter- Returns:
- array of
Artifacts
-
getArtifacts
Returns the artifacts of this dependency required in the configurations themselves required in the given root module configuration- Parameters:
rootModuleConf- String- Returns:
- array of
Artifacts
-
addArtifactsFromOwnUsage
private void addArtifactsFromOwnUsage(Set<Artifact> artifacts, Set<DependencyArtifactDescriptor> dependencyArtifacts) -
addArtifactsFromMergedUsage
-
findArtifactsMatching
private static Collection<Artifact> findArtifactsMatching(IncludeRule rule, Map<ArtifactId, Artifact> allArtifacts) -
hasProblem
public boolean hasProblem() -
getProblem
-
getProblemMessage
-
isDownloaded
public boolean isDownloaded() -
isSearched
public boolean isSearched() -
isLoaded
public boolean isLoaded() -
isFetched
-
findNode
-
isRoot
boolean isRoot() -
getRoot
-
getConflictManager
-
getRealNode
-
getId
-
getModuleId
-
getDescriptor
-
getData
-
getModuleRevision
-
getPublication
public long getPublication() -
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 unknown (module not loaded)- Returns:
- the last modified timestamp of the module represented by this Node
-
getResolvedId
-
clean
public void clean()Clean data related to one root module configuration only -
canExclude
-
getDirectCallerFor
-
getCallers
-
getAllCallersModuleIds
-
getAllCallers
-
getAllRealCallers
-
addCaller
-
doesCallersExclude
-
doesCallersExclude
@Deprecated public boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack<ModuleRevisionId> callersStack) Deprecated. -
toMrids
-
getResolvedNodes
A copy of the set of resolved nodes (real nodes)- Parameters:
moduleId- dittorootModuleConf- String- Returns:
- Set<IvyNode>
-
getResolvedRevisions
-
markEvicted
-
getAllEvictingConflictManagers
-
getAllEvictingNodes
-
getAllEvictingNodesDetails
-
getEvictedConfs
-
getEvictedData
-
getEvictedNodes
-
getEvictedRevisions
-
getEvictionDataInRoot
-
isCompletelyEvicted
public boolean isCompletelyEvicted() -
isEvicted
-
markEvicted
public void markEvicted(String rootModuleConf, IvyNode node, ConflictManager conflictManager, Collection<IvyNode> resolved) -
setEvictedNodes
-
setResolvedNodes
public void setResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> resolved) -
toString
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<IvyNode>
-
hashCode
public int hashCode() -
getPendingConflicts
Returns a collection of Nodes in conflict for which conflict has been detected but conflict resolution hasn't been done yet- Parameters:
rootModuleConf- dittomid- the module id for which pending conflicts should be found- Returns:
- a Collection of IvyNode in pending conflict
-
setPendingConflicts
public void setPendingConflicts(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> conflicts) -
blacklist
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
RestartResolveProcessfor conflict manager implementation which use a best effort strategy to find compatible dependency set, likeLatestCompatibleConflictManager- Parameters:
bdata- the root module configuration in which the node should be blacklisted
-
clearEvictionDataInAllCallers
-
isBlacklisted
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:
-
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:
-
getBlacklistData
Returns the blacklist data of this node in the given root module conf, ornullif this node is not blacklisted in this root module conf.- Parameters:
rootModuleConf- the root module configuration to consider- Returns:
- the blacklist data if any
-
getMainUsage
-
hasAnyMergedUsageWithTransitiveDependency
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.
-