1 package org.apache.archiva.metadata.repository.cassandra;
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.ProjectMetadata;
24 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
25 import org.apache.archiva.metadata.repository.MetadataRepository;
26 import org.apache.archiva.metadata.repository.RepositorySession;
27 import org.apache.archiva.filter.Filter;
28 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
29 import org.apache.archiva.metadata.repository.storage.RelocationException;
30 import org.apache.archiva.metadata.repository.storage.RepositoryStorage;
31 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataException;
32 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException;
33 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException;
34 import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
35 import org.apache.archiva.model.ArtifactReference;
36 import org.apache.archiva.policies.ProxyDownloadException;
37 import org.apache.archiva.repository.ManagedRepository;
38 import org.apache.archiva.repository.ManagedRepositoryContent;
39 import org.apache.archiva.repository.events.RepositoryListener;
40 import org.apache.archiva.xml.XMLException;
42 import java.io.IOException;
43 import java.util.Collection;
46 * @author Olivier Lamy
48 public class MockRepositoryStorage
49 implements RepositoryStorage, RepositoryListener
52 public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
58 public ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
59 throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
60 RepositoryStorageRuntimeException
66 public Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
67 throws RepositoryStorageRuntimeException
73 public Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
74 throws RepositoryStorageRuntimeException
80 public Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
81 throws RepositoryStorageRuntimeException
87 public Collection<String> listProjectVersions( String repoId, String namespace, String projectId,
88 Filter<String> filter )
89 throws RepositoryStorageRuntimeException
95 public Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
96 throws RepositoryStorageRuntimeException
102 public ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
103 throws RepositoryStorageRuntimeException
109 public void applyServerSideRelocation( ManagedRepository managedRepository, ArtifactReference artifact )
110 throws ProxyDownloadException
116 public String getFilePath( String requestPath, org.apache.archiva.repository.ManagedRepository managedRepository )
122 public String getFilePathWithVersion( String requestPath, ManagedRepositoryContent managedRepositoryContent )
123 throws RelocationException, XMLException, IOException
129 public void deleteArtifact( MetadataRepository metadataRepository, String repositoryId, String namespace,
130 String project, String version, String id )
136 public void addArtifact( RepositorySession session, String repoId, String namespace, String projectId,
137 ProjectVersionMetadata metadata )
143 public void addArtifactProblem( RepositorySession session, String repoId, String namespace, String projectId,
144 String projectVersion, RepositoryStorageMetadataException exception )