Class IvyNode

java.lang.Object
org.apache.ivy.core.resolve.IvyNode
All Implemented Interfaces:
Comparable<IvyNode>

public class IvyNode extends Object implements Comparable<IvyNode>
  • Constructor Details

  • 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 call IvyNode node = ... node.loadData(); node = node.getRealNode(); ...
      Parameters:
      rootModuleConf - String
      parent - IvyNode
      parentConf - String
      conf - String
      shouldBePublic - boolean
      usage - 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 node

      The resulting collection of nodes may have some configuration to load

      Parameters:
      rootModuleConf - the requested configuration of the root module
      conf - the configuration to load of this node
      requestedConf - the actual node conf requested, possibly extending the conf one.
      Returns:
      Collection of IvyNode
    • getDependencyDescriptor

      public DependencyDescriptor getDependencyDescriptor(IvyNode parent)
    • directlyExcludes

      public boolean directlyExcludes(ModuleDescriptor md, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact)
    • hasConfigurationsToLoad

      public boolean hasConfigurationsToLoad()
    • updateConfsToFetch

      public void updateConfsToFetch(Collection<String> confs)
    • getRequiredConfigurations

      public String[] getRequiredConfigurations(IvyNode in, String inConf)
      returns the required configurations from the given node
      Parameters:
      in - IvyNode
      inConf - ditto
      Returns:
      array of configuration names
    • getRequiredConfigurations

      public String[] getRequiredConfigurations()
      returns all the current required configurations of the node
      Returns:
      array of configuration names
    • 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 - String
      Returns:
      array of configuration names
    • isConfRequiredByMergedUsageOnly

      protected boolean isConfRequiredByMergedUsageOnly(String rootModuleConf, String conf)
    • discardConf

      @Deprecated public void discardConf(String rootModuleConf, String conf)
      Deprecated.
    • getRootModuleConfigurations

      public String[] getRootModuleConfigurations()
      Returns the root module configurations in which this dependency is required
      Returns:
      array of configuration names
    • getRootModuleConfigurationsSet

      public Set<String> getRootModuleConfigurationsSet()
      Returns the root module configurations in which this dependency is required
      Returns:
      Set of configuration names
    • getConfsToFetch

      public String[] getConfsToFetch()
    • getRealConfs

      public String[] getRealConfs(String conf)
    • getAllArtifacts

      public Artifact[] getAllArtifacts()
      Returns all the artifacts of this dependency required in all the root module configurations
      Returns:
      array of Artifacts
    • getSelectedArtifacts

      public Artifact[] 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 blacklisted
      Parameters:
      artifactFilter - Filter
      Returns:
      array of Artifacts
    • 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 - String
      Returns:
      array of Artifacts
    • hasProblem

      public boolean hasProblem()
    • getProblem

      public Exception getProblem()
    • getProblemMessage

      public String getProblemMessage()
    • isDownloaded

      public boolean isDownloaded()
    • isSearched

      public boolean isSearched()
    • isLoaded

      public boolean isLoaded()
    • isFetched

      public boolean isFetched(String conf)
    • findNode

      public IvyNode findNode(ModuleRevisionId mrid)
    • getRoot

      public IvyNode getRoot()
    • getConflictManager

      public ConflictManager getConflictManager(ModuleId mid)
    • getRealNode

      public IvyNode getRealNode()
    • getId

      public ModuleRevisionId getId()
    • getModuleId

      public ModuleId getModuleId()
    • getDescriptor

      public ModuleDescriptor getDescriptor()
    • getData

      public ResolveData getData()
    • getModuleRevision

      public ResolvedModuleRevision 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

      public ModuleRevisionId getResolvedId()
    • clean

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

      public IvyNodeCallers.Caller[] getCallers(String rootModuleConf)
    • getAllCallersModuleIds

      public Collection<ModuleId> getAllCallersModuleIds()
    • getAllCallers

      public IvyNodeCallers.Caller[] getAllCallers()
    • getAllRealCallers

      public IvyNodeCallers.Caller[] getAllRealCallers()
    • addCaller

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

      public boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Deque<IvyNode> callersStack)
    • doesCallersExclude

      @Deprecated public boolean doesCallersExclude(String rootModuleConf, Artifact artifact, Stack<ModuleRevisionId> callersStack)
      Deprecated.
    • getResolvedNodes

      public Set<IvyNode> getResolvedNodes(ModuleId moduleId, String rootModuleConf)
      A copy of the set of resolved nodes (real nodes)
      Parameters:
      moduleId - ditto
      rootModuleConf - String
      Returns:
      Set<IvyNode>
    • getResolvedRevisions

      public Collection<ModuleRevisionId> getResolvedRevisions(ModuleId moduleId, String rootModuleConf)
    • markEvicted

      public void markEvicted(IvyNodeEviction.EvictionData evictionData)
    • getAllEvictingConflictManagers

      public Collection<ConflictManager> getAllEvictingConflictManagers()
    • getAllEvictingNodes

      public Collection<IvyNode> getAllEvictingNodes()
    • getAllEvictingNodesDetails

      public Collection<String> getAllEvictingNodesDetails()
    • getEvictedConfs

      public String[] getEvictedConfs()
    • getEvictedData

      public IvyNodeEviction.EvictionData getEvictedData(String rootModuleConf)
    • getEvictedNodes

      public Collection<IvyNode> getEvictedNodes(ModuleId mid, String rootModuleConf)
    • getEvictedRevisions

      public Collection<ModuleRevisionId> getEvictedRevisions(ModuleId mid, String rootModuleConf)
    • getEvictionDataInRoot

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

      public boolean isCompletelyEvicted()
    • isEvicted

      public boolean isEvicted(String rootModuleConf)
    • markEvicted

      public void markEvicted(String rootModuleConf, IvyNode node, ConflictManager conflictManager, Collection<IvyNode> resolved)
    • setEvictedNodes

      public void setEvictedNodes(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> evicted)
    • setResolvedNodes

      public void setResolvedNodes(ModuleId moduleId, String rootModuleConf, Collection<IvyNode> resolved)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(IvyNode that)
      Specified by:
      compareTo in interface Comparable<IvyNode>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPendingConflicts

      public Collection<IvyNode> 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 - ditto
      mid - 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

      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:
      bdata - the root module configuration in which the node should be blacklisted
    • 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:
    • 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

      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
    • getMainUsage

      public IvyNodeUsage getMainUsage()
    • 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.