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.metadata.model.ArtifactMetadata;
23import org.apache.archiva.metadata.model.ProjectMetadata;
24import org.apache.archiva.metadata.model.ProjectVersionMetadata;
25import org.apache.archiva.filter.Filter;
26import org.apache.archiva.model.ArtifactReference;
27import org.apache.archiva.policies.ProxyDownloadException;
28import org.apache.archiva.repository.ManagedRepository;
29import org.apache.archiva.repository.ManagedRepositoryContent;
30import org.apache.archiva.xml.XMLException;
3132import java.io.IOException;
33import java.util.Collection;
3435// FIXME: we should drop the repositoryId parameters and attach this to an instance of a repository storage36publicinterfaceRepositoryStorage37 {
38ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId );
3940ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
41throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
42 RepositoryStorageRuntimeException;
4344 Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
45throws RepositoryStorageRuntimeException;
4647 Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
48throws RepositoryStorageRuntimeException;
4950 Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
51throws RepositoryStorageRuntimeException;
5253 Collection<String> listProjectVersions( String repoId, String namespace, String projectId, Filter<String> filter )
54throws RepositoryStorageRuntimeException;
5556 Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
57throws RepositoryStorageRuntimeException;
5859// FIXME: reconsider this API, do we want to expose storage format in the form of a path?60ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
61throws RepositoryStorageRuntimeException;
6263/**64 * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do65 * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the66 * metadatas.67 * <p>68 * For such clients, archiva does server-side relocation by reading itself the <relocation> element in69 * metadatas and serving the expected artifact.70 * @param managedRepository the used managed repository71 * @param artifact the artifact reference72 * @throws org.apache.archiva.policies.ProxyDownloadException73 */74void applyServerSideRelocation( ManagedRepository managedRepository, ArtifactReference artifact )
75throws ProxyDownloadException;
7677/**78 * add an other method to evaluate real path as when receiving -SNAPSHOT (for maven storage)79 * request redirect to the last build80 * @param requestPath the web uri request81 * @param managedRepository the used managed repository can be <code>null</code> so last version won't be resolved82 * @return the file path83 * @since 2.0.084 */85 String getFilePath( String requestPath, org.apache.archiva.repository.ManagedRepository managedRepository );
8687 String getFilePathWithVersion( final String requestPath, ManagedRepositoryContent managedRepositoryContent )
88throws RelocationException, XMLException, IOException;
899091 }