1package org.apache.archiva.metadata.repository.storage;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import org.apache.archiva.admin.model.beans.ManagedRepository;
23import org.apache.archiva.metadata.model.ArtifactMetadata;
24import org.apache.archiva.metadata.model.ProjectMetadata;
25import org.apache.archiva.metadata.model.ProjectVersionMetadata;
26import org.apache.archiva.metadata.repository.filter.Filter;
27import org.apache.archiva.model.ArtifactReference;
28import org.apache.archiva.policies.ProxyDownloadException;
29import org.apache.archiva.repository.ManagedRepositoryContent;
30import org.apache.archiva.xml.XMLException;
3132import java.util.Collection;
3334// FIXME: we should drop the repositoryId parameters and attach this to an instance of a repository storage35publicinterfaceRepositoryStorage36 {
37ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId );
3839ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
40throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
41 RepositoryStorageRuntimeException;
4243 Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
44throws RepositoryStorageRuntimeException;
4546 Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
47throws RepositoryStorageRuntimeException;
4849 Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
50throws RepositoryStorageRuntimeException;
5152 Collection<String> listProjectVersions( String repoId, String namespace, String projectId, Filter<String> filter )
53throws RepositoryStorageRuntimeException;
5455 Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
56throws RepositoryStorageRuntimeException;
5758// FIXME: reconsider this API, do we want to expose storage format in the form of a path?59ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
60throws RepositoryStorageRuntimeException;
6162/**63 * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do64 * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the65 * metadatas.66 * <p>67 * For such clients, archiva does server-side relocation by reading itself the <relocation> element in68 * metadatas and serving the expected artifact.69 * @param managedRepository the used managed repository70 * @param artifact the artifact reference71 * @throws org.apache.archiva.policies.ProxyDownloadException72 */73void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
74throws ProxyDownloadException;
7576/**77 * add an other method to evaluate real path as when receiving -SNAPSHOT (for maven storage)78 * request redirect to the last build79 * @param requestPath the web uri request80 * @param managedRepository the used managed repository can be <code>null</code> so last version won't be resolved81 * @return the file path82 * @since 2.0.083 */84 String getFilePath( String requestPath, ManagedRepository managedRepository );
8586 String getFilePathWithVersion( final String requestPath, ManagedRepositoryContent managedRepositoryContent )
87throws RelocationException, XMLException;
888990 }