1 package org.apache.archiva.security.mock;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import org.apache.archiva.metadata.model.ArtifactMetadata;
22 import org.apache.archiva.metadata.model.ProjectMetadata;
23 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
24 import org.apache.archiva.metadata.repository.MetadataRepository;
25 import org.apache.archiva.metadata.repository.RepositorySession;
26 import org.apache.archiva.metadata.repository.filter.Filter;
27 import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
28 import org.apache.archiva.metadata.repository.storage.RepositoryStorage;
29 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataException;
30 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException;
31 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException;
32 import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
33 import org.apache.archiva.model.ArtifactReference;
34 import org.apache.archiva.policies.ProxyDownloadException;
35 import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
36 import org.apache.archiva.repository.ManagedRepositoryContent;
37 import org.apache.archiva.repository.events.RepositoryListener;
38 import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
39 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
41 import java.util.Collection;
44 * @author Olivier Lamy
46 public class MockBeanServices
47 implements RepositoryStorage, RepositoryListener, RepositoryArchivaTaskScheduler
50 public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
56 public ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
57 throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
58 RepositoryStorageRuntimeException
64 public Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
65 throws RepositoryStorageRuntimeException
71 public Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
72 throws RepositoryStorageRuntimeException
78 public Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
79 throws RepositoryStorageRuntimeException
85 public Collection<String> listProjectVersions( String repoId, String namespace, String projectId,
86 Filter<String> filter )
87 throws RepositoryStorageRuntimeException
93 public Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
94 throws RepositoryStorageRuntimeException
100 public ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
101 throws RepositoryStorageRuntimeException
107 public void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
108 throws ProxyDownloadException
115 public void deleteArtifact( MetadataRepository metadataRepository, String repositoryId, String namespace,
116 String project, String version, String id )
122 public void addArtifact( RepositorySession session, String repoId, String namespace, String projectId,
123 ProjectVersionMetadata metadata )
129 public void addArtifactProblem( RepositorySession session, String repoId, String namespace, String projectId,
130 String projectVersion, RepositoryStorageMetadataException exception )
137 public boolean isProcessingRepositoryTask( String repositoryId )
143 public boolean isProcessingRepositoryTask( RepositoryTask task )
149 public void queueTask( RepositoryTask task )
150 throws TaskQueueException
156 public boolean unQueueTask( RepositoryTask task )
157 throws TaskQueueException
163 public String getFilePath( String requestPath, org.apache.archiva.repository.ManagedRepository managedRepository )
169 public String getFilePathWithVersion( String requestPath, ManagedRepositoryContent managedRepositoryContent )