diff --git a/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraph.java b/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraph.java index 693b174353..cf99eda72e 100644 --- a/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraph.java +++ b/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraph.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.Collection; /** - * + * This is the main graph data structure used by the RepositorySystem to present tree and graph objects. * * @author Oleg Gusakov * @version $Id$ @@ -31,7 +31,10 @@ import java.util.Collection; */ public class MetadataGraph { + /** all graph nodes */ Collection nodes; + + /** entry point for tree-like structures */ MetadataGraphNode entry; public MetadataGraph( MetadataGraphNode entry ) @@ -51,6 +54,12 @@ public class MetadataGraph nodes.add( node ); } + /** + * find a node by the GAV (metadata) + * + * @param md + * @return + */ public MetadataGraphNode findNode( MavenArtifactMetadata md ) { for( MetadataGraphNode mgn : nodes ) @@ -63,11 +72,21 @@ public class MetadataGraph return node; } + /** + * getter + * + * @return + */ public MetadataGraphNode getEntry() { return entry; } + /** + * getter + * + * @return + */ public Collection getNodes() { return nodes; diff --git a/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraphNode.java b/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraphNode.java index 3f7bde8797..efb7a8cad8 100644 --- a/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraphNode.java +++ b/maven-repository/src/main/java/org/apache/maven/repository/MetadataGraphNode.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; /** - * + * MetadataGraph node - as it's a directed graph - holds adjacency lists for incident and exident nodes * * @author Oleg Gusakov * @version $Id$ @@ -31,9 +31,13 @@ import java.util.List; */ public class MetadataGraphNode { + /** node payload */ MavenArtifactMetadata metadata; + /** nodes, incident to this (depend on me) */ List inNodes; + + /** nodes, exident to this (I depend on) */ List exNodes; public MetadataGraphNode() diff --git a/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java b/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java index f2f6702175..c212c9b768 100644 --- a/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java +++ b/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java @@ -66,6 +66,15 @@ public interface RepositorySystem ArtifactResolutionResult resolve( ArtifactResolutionRequest request ); + /** + * this is the new metadata-based entry point into repository system. By default - it will transitively resolve metadata + * for the supplied root GAV and return a flat set of dependency metadatas. Tweaking the request allows user to ask for + * various formats of the response - resolved tree, resolved graph or dirty tree. Only the resolved tree is implemented now + * in MercuryRepositorySystem, LegacyRepositorySystem ignores this call for now. + * + * @param request - supplies all necessary details for the resolution configuration + * @return + */ MetadataResolutionResult resolveMetadata( MetadataResolutionRequest request ); //REMOVE