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.admin.model.beans.ManagedRepository;
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.metadata.repository.filter.Filter;
28 import org.apache.archiva.metadata.repository.storage.*;
29 import org.apache.archiva.model.ArtifactReference;
30 import org.apache.archiva.policies.ProxyDownloadException;
31 import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
32 import org.apache.archiva.repository.ManagedRepositoryContent;
33 import org.apache.archiva.repository.events.RepositoryListener;
34 import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
35 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
37 import java.util.Collection;
40 * @author Olivier Lamy
42 public class MockBeanServices
43 implements RepositoryStorage, RepositoryListener, RepositoryArchivaTaskScheduler
46 public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
52 public ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
53 throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
54 RepositoryStorageRuntimeException
60 public Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
61 throws RepositoryStorageRuntimeException
67 public Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
68 throws RepositoryStorageRuntimeException
74 public Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
75 throws RepositoryStorageRuntimeException
81 public Collection<String> listProjectVersions( String repoId, String namespace, String projectId,
82 Filter<String> filter )
83 throws RepositoryStorageRuntimeException
89 public Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
90 throws RepositoryStorageRuntimeException
96 public ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
97 throws RepositoryStorageRuntimeException
103 public void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
104 throws ProxyDownloadException
111 public void deleteArtifact( MetadataRepository metadataRepository, String repositoryId, String namespace,
112 String project, String version, String id )
118 public void addArtifact( RepositorySession session, String repoId, String namespace, String projectId,
119 ProjectVersionMetadata metadata )
125 public void addArtifactProblem( RepositorySession session, String repoId, String namespace, String projectId,
126 String projectVersion, RepositoryStorageMetadataException exception )
133 public boolean isProcessingRepositoryTask( String repositoryId )
139 public boolean isProcessingRepositoryTask( RepositoryTask task )
145 public void queueTask( RepositoryTask task )
146 throws TaskQueueException
152 public boolean unQueueTask( RepositoryTask task )
153 throws TaskQueueException
159 public String getFilePath( String requestPath, ManagedRepository managedRepository )
165 public String getFilePathWithVersion( String requestPath, ManagedRepositoryContent managedRepositoryContent )