From f36831147bff4ba837448178fe024b75f0b93de4 Mon Sep 17 00:00:00 2001 From: Oleg Gusakov Date: Tue, 31 Mar 2009 19:36:53 +0000 Subject: [PATCH] added tree-based resolution result to request/response git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@760573 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/MetadataResolutionRequest.java | 56 +++++++++++++++++++ .../repository/MetadataResolutionResult.java | 13 +++++ 2 files changed, 69 insertions(+) diff --git a/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java b/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java index 216c2e44f7..4b21a137ff 100644 --- a/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java +++ b/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionRequest.java @@ -64,6 +64,18 @@ public class MetadataResolutionRequest private ArtifactMetadataSource metadataSource; private boolean resolveRoot = true; + + /** result type - flat list */ + private boolean asList = true; + + /** result type - dirty tree */ + private boolean asDirtyTree = false; + + /** result type - resolved tree */ + private boolean asResolvedTree = false; + + /** result type - graph */ + private boolean asGraph = false; public MetadataResolutionRequest() { @@ -207,4 +219,48 @@ public class MetadataResolutionRequest return sb.toString(); } + + public boolean isAsList() + { + return asList; + } + + public MetadataResolutionRequest setAsList( boolean asList ) + { + this.asList = asList; + return this; + } + + public boolean isAsDirtyTree() + { + return asDirtyTree; + } + + public MetadataResolutionRequest setAsDirtyTree( boolean asDirtyTree ) + { + this.asDirtyTree = asDirtyTree; + return this; + } + + public boolean isAsResolvedTree() + { + return asResolvedTree; + } + + public MetadataResolutionRequest setAsResolvedTree( boolean asResolvedTree ) + { + this.asResolvedTree = asResolvedTree; + return this; + } + + public boolean isAsGraph() + { + return asGraph; + } + + public MetadataResolutionRequest setAsGraph( boolean asGraph ) + { + this.asGraph = asGraph; + return this; + } } diff --git a/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java b/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java index 90406b9a51..d26ca5fa22 100644 --- a/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java +++ b/maven-repository/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java @@ -65,6 +65,8 @@ public class MetadataResolutionResult private Set requestedArtifacts; private Set artifacts; + + private MetadataTreeNode resolvedTree; public Artifact getOriginatingArtifact() { @@ -340,4 +342,15 @@ public class MetadataResolutionResult return sb.toString(); } + + public MetadataTreeNode getResolvedTree() + { + return resolvedTree; + } + + public void setResolvedTree( MetadataTreeNode resolvedTree ) + { + this.resolvedTree = resolvedTree; + } + }