1 package org.apache.archiva.metadata.repository;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.archiva.metadata.model.ArtifactMetadata;
23 import org.apache.archiva.metadata.model.MetadataFacet;
24 import org.apache.archiva.metadata.model.ProjectMetadata;
25 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
26 import org.apache.archiva.metadata.model.ProjectVersionReference;
27
28 import java.util.Collection;
29 import java.util.Date;
30 import java.util.List;
31
32 public interface MetadataRepository
33 {
34
35
36
37
38
39
40 void updateProject( String repositoryId, ProjectMetadata project )
41 throws MetadataRepositoryException;
42
43 void updateArtifact( String repositoryId, String namespace, String projectId, String projectVersion,
44 ArtifactMetadata artifactMeta )
45 throws MetadataRepositoryException;
46
47 void updateProjectVersion( String repositoryId, String namespace, String projectId,
48 ProjectVersionMetadata versionMetadata )
49 throws MetadataRepositoryException;
50
51
52
53
54
55
56
57
58 void updateNamespace( String repositoryId, String namespace )
59 throws MetadataRepositoryException;
60
61 List<String> getMetadataFacets( String repositoryId, String facetId )
62 throws MetadataRepositoryException;
63
64
65
66
67
68
69
70
71 boolean hasMetadataFacet( String repositoryId, String facetId )
72 throws MetadataRepositoryException;
73
74 MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
75 throws MetadataRepositoryException;
76
77 void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
78 throws MetadataRepositoryException;
79
80 void removeMetadataFacets( String repositoryId, String facetId )
81 throws MetadataRepositoryException;
82
83 void removeMetadataFacet( String repositoryId, String facetId, String name )
84 throws MetadataRepositoryException;
85
86
87
88
89
90
91
92
93
94
95 List<ArtifactMetadata> getArtifactsByDateRange( String repositoryId, Date startTime, Date endTime )
96 throws MetadataRepositoryException;
97
98
99 Collection<String> getRepositories()
100 throws MetadataRepositoryException;
101
102 Collection<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum )
103 throws MetadataRepositoryException;
104
105
106
107
108
109
110
111
112
113
114 List<ArtifactMetadata> getArtifactsByProjectVersionMetadata( String key, String value, String repositoryId )
115 throws MetadataRepositoryException;
116
117
118
119
120
121
122
123
124
125
126 List<ArtifactMetadata> getArtifactsByMetadata( String key, String value, String repositoryId )
127 throws MetadataRepositoryException;
128
129
130
131
132
133
134
135
136
137
138
139 List<ArtifactMetadata> getArtifactsByProperty( String key, String value, String repositoryId )
140 throws MetadataRepositoryException;
141
142 void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
143 throws MetadataRepositoryException;
144
145
146
147
148
149
150
151
152
153 void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion )
154 throws MetadataRepositoryException;
155
156
157
158
159
160
161
162
163
164
165
166
167
168 void removeArtifact( String repositoryId, String namespace, String project, String version,
169 MetadataFacet metadataFacet )
170 throws MetadataRepositoryException;
171
172
173
174
175
176
177 void removeRepository( String repositoryId )
178 throws MetadataRepositoryException;
179
180
181
182
183
184
185
186 void removeNamespace( String repositoryId, String namespace )
187 throws MetadataRepositoryException;
188
189 List<ArtifactMetadata> getArtifacts( String repositoryId )
190 throws MetadataRepositoryException;
191
192
193
194
195
196
197
198
199
200
201 ProjectMetadata getProject( String repoId, String namespace, String projectId )
202 throws MetadataResolutionException;
203
204 ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
205 throws MetadataResolutionException;
206
207 Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion )
208 throws MetadataResolutionException;
209
210
211
212
213
214
215
216
217
218
219
220
221 Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
222 String projectVersion )
223 throws MetadataResolutionException;
224
225 Collection<String> getRootNamespaces( String repoId )
226 throws MetadataResolutionException;
227
228
229
230
231
232
233
234 Collection<String> getNamespaces( String repoId, String namespace )
235 throws MetadataResolutionException;
236
237
238
239
240
241
242
243 Collection<String> getProjects( String repoId, String namespace )
244 throws MetadataResolutionException;
245
246
247
248
249
250
251
252
253 Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
254 throws MetadataResolutionException;
255
256
257
258
259
260
261
262
263
264 void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
265 throws MetadataRepositoryException;
266
267
268
269
270
271
272
273
274
275 Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
276 String projectVersion )
277 throws MetadataResolutionException;
278
279
280
281
282
283
284
285
286
287
288 void removeProject( String repositoryId, String namespace, String projectId )
289 throws MetadataRepositoryException;
290
291
292
293
294
295 void save();
296
297
298 void close()
299 throws MetadataRepositoryException;
300
301
302
303
304 void revert();
305
306 boolean canObtainAccess( Class<?> aClass );
307
308 <T> T obtainAccess( Class<T> aClass )
309 throws MetadataRepositoryException;
310
311
312
313
314
315
316
317
318
319
320 List<ArtifactMetadata> searchArtifacts( String text, String repositoryId, boolean exact )
321 throws MetadataRepositoryException;
322
323
324
325
326
327
328
329
330
331
332
333 List<ArtifactMetadata> searchArtifacts( String key, String text, String repositoryId, boolean exact )
334 throws MetadataRepositoryException;
335
336 }