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.filter.Filter;
27 import org.apache.archiva.metadata.repository.storage.*;
28 import org.apache.archiva.model.ArtifactReference;
29 import org.apache.archiva.policies.ProxyDownloadException;
30 import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
31 import org.apache.archiva.repository.ManagedRepository;
32 import org.apache.archiva.repository.ManagedRepositoryContent;
33 import org.apache.archiva.metadata.audit.RepositoryListener;
34 import org.apache.archiva.scheduler.repository.model.RepositoryArchivaTaskScheduler;
35 import org.apache.archiva.scheduler.repository.model.RepositoryTask;
36 import org.apache.archiva.xml.XMLException;
38 import java.io.IOException;
39 import java.util.Collection;
42 * @author Olivier Lamy
44 public class MockBeanServices
45 implements RepositoryStorage, RepositoryListener, RepositoryArchivaTaskScheduler
48 public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
54 public ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
55 throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
56 RepositoryStorageRuntimeException
62 public Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
63 throws RepositoryStorageRuntimeException
69 public Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
70 throws RepositoryStorageRuntimeException
76 public Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
77 throws RepositoryStorageRuntimeException
83 public Collection<String> listProjectVersions( String repoId, String namespace, String projectId,
84 Filter<String> filter )
85 throws RepositoryStorageRuntimeException
91 public Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
92 throws RepositoryStorageRuntimeException
98 public ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
99 throws RepositoryStorageRuntimeException
105 public void applyServerSideRelocation( ManagedRepository managedRepository, ArtifactReference artifact )
106 throws ProxyDownloadException
113 public void deleteArtifact( MetadataRepository metadataRepository, String repositoryId, String namespace,
114 String project, String version, String id )
120 public void addArtifact( RepositorySession session, String repoId, String namespace, String projectId,
121 ProjectVersionMetadata metadata )
127 public void addArtifactProblem( RepositorySession session, String repoId, String namespace, String projectId,
128 String projectVersion, RepositoryStorageMetadataException exception )
135 public boolean isProcessingRepositoryTask( String repositoryId )
141 public boolean isProcessingRepositoryTask( RepositoryTask task )
147 public void queueTask( RepositoryTask task )
148 throws TaskQueueException
154 public boolean unQueueTask( RepositoryTask task )
155 throws TaskQueueException
161 public String getFilePath( String requestPath, org.apache.archiva.repository.ManagedRepository managedRepository )
167 public String getFilePathWithVersion( String requestPath, ManagedRepositoryContent managedRepositoryContent ) throws RelocationException, XMLException, IOException