This project has retired. For details please refer to its Attic page.
DependencyGraphUtils

org.apache.maven.archiva.dependency.graph
Class DependencyGraphUtils

Package class diagram package DependencyGraphUtils
java.lang.Object
  extended by org.apache.maven.archiva.dependency.graph.DependencyGraphUtils

public class DependencyGraphUtils
extends java.lang.Object

Utilities for manipulating the DependencyGraph.


Constructor Summary
DependencyGraphUtils()
           
 
Method Summary
static void addNodeFromModel(org.apache.maven.archiva.model.ArchivaProjectModel model, DependencyGraph graph, DependencyGraphNode fromNode)
          Standard way to add a model to the graph.
static void cleanupOrphanedNodes(DependencyGraph graph)
          Clean out any nodes that may have become orphaned in the graph.
static DependencyGraphEdge clone(DependencyGraphEdge edge)
          Create a clone of an edge.
static void collapseNodes(DependencyGraph graph, DependencyGraphNode nodeFROM, DependencyGraphNode nodeTO)
          Functionaly similar to #collapseVersions(DependencyGraph, ArtifactReference, String, String), but in a new, easier to use, format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyGraphUtils

public DependencyGraphUtils()
Method Detail

addNodeFromModel

public static void addNodeFromModel(org.apache.maven.archiva.model.ArchivaProjectModel model,
                                    DependencyGraph graph,
                                    DependencyGraphNode fromNode)
Standard way to add a model to the graph. NOTE: Used by archiva-repository-layer runtime and archiva-dependency-graph tests.

Parameters:
model - the model to add
graph - the graph to add it to
fromNode - the node to add it from.

cleanupOrphanedNodes

public static void cleanupOrphanedNodes(DependencyGraph graph)
Clean out any nodes that may have become orphaned in the graph.

Parameters:
graph - the graph to check.

collapseNodes

public static void collapseNodes(DependencyGraph graph,
                                 DependencyGraphNode nodeFROM,
                                 DependencyGraphNode nodeTO)
Functionaly similar to #collapseVersions(DependencyGraph, ArtifactReference, String, String), but in a new, easier to use, format. 1) Removes the FROM edges connected to the FROM node 2) Moves the TO edges connected to the FROM node to the TO node. 3) Removes the FROM node (which is now orphaned)

Parameters:
graph - the graph to perform operation on
nodeFrom - the node to collapse from
nodeTo - the node to collapse to

clone

public static DependencyGraphEdge clone(DependencyGraphEdge edge)
Create a clone of an edge.

Parameters:
edge - the edge to clone.
Returns:
the cloned edge.