Package org.apache.ivy.core.resolve
Class IvyNode
java.lang.Object
org.apache.ivy.core.resolve.IvyNode
- All Implemented Interfaces:
Comparable<IvyNode>
-
Constructor Summary
ConstructorsConstructorDescriptionIvyNode
(ResolveData data, ModuleDescriptor md) IvyNode
(ResolveData data, IvyNode parent, DependencyDescriptor dd) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCaller
(String rootModuleConf, IvyNode callerNode, String callerConf, String requestedConf, String[] dependencyConfs, DependencyDescriptor dd) 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.void
clean()
Clean data related to one root module configuration onlyint
boolean
directlyExcludes
(ModuleDescriptor md, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact) void
discardConf
(String rootModuleConf, String conf) Deprecated.boolean
doesCallersExclude
(String rootModuleConf, Artifact artifact, Deque<IvyNode> callersStack) boolean
doesCallersExclude
(String rootModuleConf, Artifact artifact, Stack<ModuleRevisionId> callersStack) Deprecated.boolean
findNode
(ModuleRevisionId mrid) Artifact[]
Returns all the artifacts of this dependency required in all the root module configurationsArtifact[]
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, ornull
if 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()
getDependencies
(String rootModuleConf, String[] confs, String requestedConf) getDependencies
(String rootModuleConf, String conf, String requestedConf) Load the dependencies of the current nodegetDependencyDescriptor
(IvyNode parent) String[]
getEvictedData
(String rootModuleConf) getEvictedNodes
(ModuleId mid, String rootModuleConf) getEvictedRevisions
(ModuleId mid, String rootModuleConf) getEvictionDataInRoot
(String rootModuleConf, IvyNode ancestor) getId()
long
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)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 yetlong
String[]
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 blacklistedboolean
hasAnyMergedUsageWithTransitiveDependency
(String rootModuleConf) Indicates if there is any of the merged usages of this node which has a depender with transitive dependency descriptor.boolean
int
hashCode()
boolean
boolean
isBlacklisted
(String rootModuleConf) Indicates if this node has been blacklisted in the given root module conf.boolean
Indicates if this node has been blacklisted in all root module configurations.boolean
protected boolean
isConfRequiredByMergedUsageOnly
(String rootModuleConf, String conf) boolean
boolean
boolean
boolean
isLoaded()
boolean
boolean
loadData
(String rootModuleConf, IvyNode parent, String parentConf, String conf, boolean shouldBePublic, IvyNodeUsage usage) After the call node may be discarded.void
markEvicted
(String rootModuleConf, IvyNode node, ConflictManager conflictManager, Collection<IvyNode> resolved) void
markEvicted
(IvyNodeEviction.EvictionData evictionData) void
setEvictedNodes
(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> evicted) void
setPendingConflicts
(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> conflicts) void
setResolvedNodes
(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> resolved) toString()
void
updateConfsToFetch
(Collection<String> confs)
-
Constructor Details
-
IvyNode
-
IvyNode
-
-
Method Details
-
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
-
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 theconf
one.- Returns:
Collection
ofIvyNode
-
getDependencyDescriptor
-
directlyExcludes
public boolean directlyExcludes(ModuleDescriptor md, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact) -
hasConfigurationsToLoad
public boolean hasConfigurationsToLoad() -
updateConfsToFetch
-
getRequiredConfigurations
returns the required configurations from the given node- Parameters:
in
- IvyNodeinConf
- ditto- Returns:
- array of configuration names
-
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. -
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:
Set
of configuration names
-
getConfsToFetch
-
getRealConfs
-
getAllArtifacts
Returns all the artifacts of this dependency required in all the root module configurations- Returns:
- array of
Artifact
s
-
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
Artifact
s
-
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
Artifact
s
-
hasProblem
public boolean hasProblem() -
getProblem
-
getProblemMessage
-
isDownloaded
public boolean isDownloaded() -
isSearched
public boolean isSearched() -
isLoaded
public boolean isLoaded() -
isFetched
-
findNode
-
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 -
getCallers
-
getAllCallersModuleIds
-
getAllCallers
-
getAllRealCallers
-
addCaller
-
doesCallersExclude
-
doesCallersExclude
@Deprecated public boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack<ModuleRevisionId> callersStack) Deprecated. -
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:
compareTo
in 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
RestartResolveProcess
for 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
-
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, ornull
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
-
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.
-