diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-23 13:29:21 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-23 13:29:21 +0000 |
commit | ef66c2d19fdb5e17eb23a1bc2a669211c67f270e (patch) | |
tree | c5ce3e49aed7c265d0e6c26a89fd094b4a1d86c5 /archiva-modules/metadata/metadata-repository-api/src | |
parent | 38788585d73b698a6f1e932db711c37b5c45a48b (diff) | |
download | archiva-ef66c2d19fdb5e17eb23a1bc2a669211c67f270e.tar.gz archiva-ef66c2d19fdb5e17eb23a1bc2a669211c67f270e.zip |
use a new bean rather than a lot of params to ease futur enhancements
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1401289 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata/metadata-repository-api/src')
2 files changed, 19 insertions, 10 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index 014f755e7..013cc4e7c 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -24,6 +24,7 @@ import org.apache.archiva.metadata.model.ProjectMetadata; import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.model.ProjectVersionReference; import org.apache.archiva.metadata.repository.filter.ExcludesFilter; +import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest; import org.apache.archiva.metadata.repository.storage.RepositoryStorage; import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataInvalidException; import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException; @@ -56,7 +57,7 @@ import java.util.List; * unknowingly by the caller. * <p/> */ -@Service( "metadataResolver#default" ) +@Service ("metadataResolver#default") public class DefaultMetadataResolver implements MetadataResolver { @@ -72,7 +73,7 @@ public class DefaultMetadataResolver * appropriate methods to pass in the already determined repository configuration, for example, instead of the ID */ @Inject - @Named( value = "repositoryStorage#maven2" ) + @Named (value = "repositoryStorage#maven2") private RepositoryStorage repositoryStorage; /** @@ -98,7 +99,10 @@ public class DefaultMetadataResolver { try { - metadata = repositoryStorage.readProjectVersionMetadata( repoId, namespace, projectId, projectVersion ); + ReadMetadataRequest readMetadataRequest = + new ReadMetadataRequest().repoId( repoId ).namespace( namespace ).projectId( + projectId ).projectVersion( projectVersion ); + metadata = repositoryStorage.readProjectVersionMetadata( readMetadataRequest ); log.debug( "Resolved project version metadata from storage: {}", metadata ); @@ -309,9 +313,11 @@ public class DefaultMetadataResolver { try { + ReadMetadataRequest readMetadataRequest = + new ReadMetadataRequest().repoId( repoId ).namespace( namespace ).projectId( + projectId ).projectVersion( projectVersion ); ProjectVersionMetadata versionMetadata = - repositoryStorage.readProjectVersionMetadata( repoId, namespace, projectId, - projectVersion ); + repositoryStorage.readProjectVersionMetadata( readMetadataRequest ); for ( RepositoryListener listener : listeners ) { listener.addArtifact( session, repoId, namespace, projectId, versionMetadata ); @@ -365,8 +371,13 @@ public class DefaultMetadataResolver Collection<ArtifactMetadata> artifacts = metadataRepository.getArtifacts( repoId, namespace, projectId, projectVersion ); ExcludesFilter<String> filter = new ExcludesFilter<String>( createArtifactIdList( artifacts ) ); + + ReadMetadataRequest readMetadataRequest = + new ReadMetadataRequest().repoId( repoId ).namespace( namespace ).projectId( projectId ).projectVersion( + projectVersion ).filter( filter ); + Collection<ArtifactMetadata> storageArtifacts = - repositoryStorage.readArtifactsMetadata( repoId, namespace, projectId, projectVersion, filter ); + repositoryStorage.readArtifactsMetadata( readMetadataRequest ); if ( storageArtifacts != null && !storageArtifacts.isEmpty() ) { diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java index e115812da..4921613a6 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java @@ -31,8 +31,7 @@ public interface RepositoryStorage { ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId ); - ProjectVersionMetadata readProjectVersionMetadata( String repoId, String namespace, String projectId, - String projectVersion ) + ProjectVersionMetadata readProjectVersionMetadata( ReadMetadataRequest readMetadataRequest ) throws RepositoryStorageMetadataInvalidException, RepositoryStorageMetadataNotFoundException, RepositoryStorageRuntimeException; @@ -48,8 +47,7 @@ public interface RepositoryStorage Collection<String> listProjectVersions( String repoId, String namespace, String projectId, Filter<String> filter ) throws RepositoryStorageRuntimeException; - Collection<ArtifactMetadata> readArtifactsMetadata( String repoId, String namespace, String projectId, - String projectVersion, Filter<String> filter ) + Collection<ArtifactMetadata> readArtifactsMetadata( ReadMetadataRequest readMetadataRequest ) throws RepositoryStorageRuntimeException; // FIXME: reconsider this API, do we want to expose storage format in the form of a path? |