1 package org.apache.archiva.metadata.repository;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
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;
28 import java.util.Collection;
29 import java.util.Collections;
30 import java.util.Date;
31 import java.util.List;
33 public class TestMetadataRepository
34 implements MetadataRepository
36 public ProjectMetadata getProject( String repoId, String namespace, String projectId )
41 public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
42 String projectVersion )
47 public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
48 String projectVersion )
53 public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
54 String projectVersion )
59 public Collection<String> getRootNamespaces( String repoId )
64 public Collection<String> getNamespaces( String repoId, String namespace )
69 public Collection<String> getProjects( String repoId, String namespace )
74 public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
79 public void updateProject( String repoId, ProjectMetadata project )
83 public void updateArtifact( String repoId, String namespace, String projectId, String projectVersion,
84 ArtifactMetadata artifactMeta )
89 public void updateProjectVersion( String repoId, String namespace, String projectId,
90 ProjectVersionMetadata versionMetadata )
95 public void updateNamespace( String repoId, String namespace )
100 public List<String> getMetadataFacets( String repodId, String facetId )
102 return Collections.emptyList();
105 public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
110 public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
115 public void removeMetadataFacets( String repositoryId, String facetId )
120 public void removeMetadataFacet( String repoId, String facetId, String name )
125 public List<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime )
130 public Collection<String> getRepositories()
135 public List<ArtifactMetadata> getArtifactsByChecksum( String repoId, String checksum )
140 public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
145 public void removeRepository( String repoId )
150 public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
151 String projectVersion )
171 public boolean canObtainAccess( Class<?> aClass )
176 public Object obtainAccess( Class<?> aClass )
181 public List<ArtifactMetadata> getArtifacts( String repositoryId )
186 public void removeArtifact( String repositoryId, String namespace, String project, String version,
187 MetadataFacet metadataFacet )
188 throws MetadataRepositoryException
190 throw new UnsupportedOperationException();
193 public void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion )
194 throws MetadataRepositoryException
196 throw new UnsupportedOperationException();
199 public void removeNamespace( String repositoryId, String namespace )
200 throws MetadataRepositoryException
205 public void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
206 throws MetadataRepositoryException
211 public void removeProject( String repositoryId, String namespace, String projectId )
212 throws MetadataRepositoryException
214 throw new UnsupportedOperationException();
217 public boolean hasMetadataFacet( String repositoryId, String facetId )
218 throws MetadataRepositoryException