You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RepositoryStorage.java 4.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package org.apache.archiva.metadata.repository.storage;
  2. /*
  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
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  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
  18. * under the License.
  19. */
  20. import org.apache.archiva.metadata.model.ArtifactMetadata;
  21. import org.apache.archiva.metadata.model.ProjectMetadata;
  22. import org.apache.archiva.metadata.model.ProjectVersionMetadata;
  23. import org.apache.archiva.filter.Filter;
  24. import org.apache.archiva.model.ArtifactReference;
  25. import org.apache.archiva.policies.ProxyDownloadException;
  26. import org.apache.archiva.repository.ManagedRepositoryContent;
  27. import org.apache.archiva.xml.XMLException;
  28. import java.util.Collection;
  29. // FIXME: we should drop the repositoryId parameters and attach this to an instance of a repository storage
  30. public interface RepositoryStorage
  31. {
  32. ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId );
  33. ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest )
  34. throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException,
  35. RepositoryStorageRuntimeException;
  36. Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
  37. throws RepositoryStorageRuntimeException;
  38. Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
  39. throws RepositoryStorageRuntimeException;
  40. Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
  41. throws RepositoryStorageRuntimeException;
  42. Collection<String> listProjectVersions( String repoId, String namespace, String projectId, Filter<String> filter )
  43. throws RepositoryStorageRuntimeException;
  44. Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest )
  45. throws RepositoryStorageRuntimeException;
  46. // FIXME: reconsider this API, do we want to expose storage format in the form of a path?
  47. ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
  48. throws RepositoryStorageRuntimeException;
  49. /**
  50. * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do
  51. * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the
  52. * metadatas.
  53. * <p>
  54. * For such clients, archiva does server-side relocation by reading itself the &lt;relocation&gt; element in
  55. * metadatas and serving the expected artifact.
  56. * @param managedRepository the used managed repository
  57. * @param artifact the artifact reference
  58. * @throws org.apache.archiva.policies.ProxyDownloadException
  59. */
  60. void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact )
  61. throws ProxyDownloadException;
  62. /**
  63. * add an other method to evaluate real path as when receiving -SNAPSHOT (for maven storage)
  64. * request redirect to the last build
  65. * @param requestPath the web uri request
  66. * @param managedRepository the used managed repository can be <code>null</code> so last version won't be resolved
  67. * @return the file path
  68. * @since 2.0.0
  69. */
  70. String getFilePath( String requestPath, org.apache.archiva.repository.ManagedRepository managedRepository );
  71. String getFilePathWithVersion( final String requestPath, ManagedRepositoryContent managedRepositoryContent )
  72. throws RelocationException, XMLException;
  73. }