1 package org.apache.maven.repository;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.List;
23 import java.util.Map;
24 import java.util.Set;
25
26 import org.apache.maven.artifact.Artifact;
27 import org.apache.maven.artifact.repository.ArtifactRepository;
28
29
30
31
32
33
34
35
36 public class MetadataResolutionRequest
37 {
38 private MavenArtifactMetadata mad;
39
40 private String scope;
41
42
43 private Set<Artifact> artifactDependencies;
44
45 private ArtifactRepository localRepository;
46
47 private List<ArtifactRepository> remoteRepositories;
48
49
50 private Map managedVersionMap;
51
52
53 private boolean asList = true;
54
55
56 private boolean asDirtyTree = false;
57
58
59 private boolean asResolvedTree = false;
60
61
62 private boolean asGraph = false;
63
64 public MetadataResolutionRequest()
65 {
66 }
67
68 public MetadataResolutionRequest( MavenArtifactMetadata md, ArtifactRepository localRepository,
69 List<ArtifactRepository> remoteRepositories )
70 {
71 this.mad = md;
72 this.localRepository = localRepository;
73 this.remoteRepositories = remoteRepositories;
74 }
75
76 public MavenArtifactMetadata getArtifactMetadata()
77 {
78 return mad;
79 }
80
81 public MetadataResolutionRequest setArtifactMetadata( MavenArtifactMetadata md )
82 {
83 this.mad = md;
84
85 return this;
86 }
87
88 public MetadataResolutionRequest setArtifactDependencies( Set<Artifact> artifactDependencies )
89 {
90 this.artifactDependencies = artifactDependencies;
91
92 return this;
93 }
94
95 public Set<Artifact> getArtifactDependencies()
96 {
97 return artifactDependencies;
98 }
99
100 public ArtifactRepository getLocalRepository()
101 {
102 return localRepository;
103 }
104
105 public MetadataResolutionRequest setLocalRepository( ArtifactRepository localRepository )
106 {
107 this.localRepository = localRepository;
108
109 return this;
110 }
111
112 public List<ArtifactRepository> getRemoteRepostories()
113 {
114 return remoteRepositories;
115 }
116
117 public MetadataResolutionRequest setRemoteRepostories( List<ArtifactRepository> remoteRepostories )
118 {
119 this.remoteRepositories = remoteRepostories;
120
121 return this;
122 }
123
124 public Map getManagedVersionMap()
125 {
126 return managedVersionMap;
127 }
128
129 public MetadataResolutionRequest setManagedVersionMap( Map managedVersionMap )
130 {
131 this.managedVersionMap = managedVersionMap;
132
133 return this;
134 }
135
136 public String toString()
137 {
138 StringBuilder sb = new StringBuilder()
139 .append( "REQUEST: " ).append( "\n" )
140 .append( "artifact: " ).append( mad ).append( "\n" )
141 .append( artifactDependencies ).append( "\n" )
142 .append( "localRepository: " ).append( localRepository ).append( "\n" )
143 .append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" )
144 ;
145
146 return sb.toString();
147 }
148
149 public boolean isAsList()
150 {
151 return asList;
152 }
153
154 public MetadataResolutionRequest setAsList( boolean asList )
155 {
156 this.asList = asList;
157 return this;
158 }
159
160 public boolean isAsDirtyTree()
161 {
162 return asDirtyTree;
163 }
164
165 public MetadataResolutionRequest setAsDirtyTree( boolean asDirtyTree )
166 {
167 this.asDirtyTree = asDirtyTree;
168 return this;
169 }
170
171 public boolean isAsResolvedTree()
172 {
173 return asResolvedTree;
174 }
175
176 public MetadataResolutionRequest setAsResolvedTree( boolean asResolvedTree )
177 {
178 this.asResolvedTree = asResolvedTree;
179 return this;
180 }
181
182 public boolean isAsGraph()
183 {
184 return asGraph;
185 }
186
187 public MetadataResolutionRequest setAsGraph( boolean asGraph )
188 {
189 this.asGraph = asGraph;
190 return this;
191 }
192
193 public MetadataResolutionRequest setScope( String scope )
194 {
195 this.scope = scope;
196 return this;
197 }
198
199 public String getScope()
200 {
201 return scope;
202 }
203 }