diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-08-04 22:40:04 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-08-04 22:40:04 +0200 |
commit | eca0097d857aa4739a6387c67d22a9a355a46fa1 (patch) | |
tree | 48752d7b63424b3e8b2bf47d11a692bfa69a6ff5 /archiva-modules/metadata | |
parent | ee2c1a7b2b623cf76c8a5deff5e8ddb836de2eaa (diff) | |
download | archiva-eca0097d857aa4739a6387c67d22a9a355a46fa1.tar.gz archiva-eca0097d857aa4739a6387c67d22a9a355a46fa1.zip |
Changing session handling for metadata API
Diffstat (limited to 'archiva-modules/metadata')
9 files changed, 460 insertions, 394 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/AbstractMetadataRepository.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/AbstractMetadataRepository.java index 6b9b845f8..86fbde676 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/AbstractMetadataRepository.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/AbstractMetadataRepository.java @@ -34,14 +34,14 @@ public abstract class AbstractMetadataRepository { @Override - public void updateProject( String repositoryId, ProjectMetadata project ) + public void updateProject( RepositorySession session, String repositoryId, ProjectMetadata project ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public void updateArtifact( String repositoryId, String namespace, String projectId, String projectVersion, + public void updateArtifact( RepositorySession session, String repositoryId, String namespace, String projectId, String projectVersion, ArtifactMetadata artifactMeta ) throws MetadataRepositoryException { @@ -49,7 +49,7 @@ public abstract class AbstractMetadataRepository } @Override - public void updateProjectVersion( String repositoryId, String namespace, String projectId, + public void updateProjectVersion( RepositorySession session, String repositoryId, String namespace, String projectId, ProjectVersionMetadata versionMetadata ) throws MetadataRepositoryException { @@ -57,110 +57,103 @@ public abstract class AbstractMetadataRepository } @Override - public void updateNamespace( String repositoryId, String namespace ) + public void updateNamespace( RepositorySession session, String repositoryId, String namespace ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<String> getMetadataFacets( String repositoryId, String facetId ) + public List<String> getMetadataFacets( RepositorySession session, String repositoryId, String facetId ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public boolean hasMetadataFacet( String repositoryId, String facetId ) + public boolean hasMetadataFacet( RepositorySession session, String repositoryId, String facetId ) throws MetadataRepositoryException { return false; } @Override - public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name ) + public MetadataFacet getMetadataFacet( RepositorySession session, String repositoryId, String facetId, String name ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet ) + public void addMetadataFacet( RepositorySession session, String repositoryId, MetadataFacet metadataFacet ) throws MetadataRepositoryException { } @Override - public void removeMetadataFacets( String repositoryId, String facetId ) + public void removeMetadataFacets( RepositorySession session, String repositoryId, String facetId ) throws MetadataRepositoryException { } @Override - public void removeMetadataFacet( String repositoryId, String facetId, String name ) + public void removeMetadataFacet( RepositorySession session, String repositoryId, String facetId, String name ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<ArtifactMetadata> getArtifactsByDateRange( String repositoryId, Date startTime, Date endTime ) + public List<ArtifactMetadata> getArtifactsByDateRange( RepositorySession session, String repositoryId, Date startTime, Date endTime ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public Collection<String> getRepositories() + public Collection<ArtifactMetadata> getArtifactsByChecksum( RepositorySession session, String repositoryId, String checksum ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public Collection<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum ) + public List<ArtifactMetadata> getArtifactsByProjectVersionMetadata( RepositorySession session, String key, String value, String repositoryId ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<ArtifactMetadata> getArtifactsByProjectVersionMetadata( String key , String value , String repositoryId ) + public List<ArtifactMetadata> getArtifactsByMetadata( RepositorySession session, String key, String value, String repositoryId ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<ArtifactMetadata> getArtifactsByMetadata( String key , String value , String repositoryId ) + public List<ArtifactMetadata> getArtifactsByProperty( RepositorySession session, String key, String value, String repositoryId ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<ArtifactMetadata> getArtifactsByProperty( String key, String value, String repositoryId ) + public void removeArtifact( RepositorySession session, String repositoryId, String namespace, String project, String version, String id ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public void removeArtifact( String repositoryId, String namespace, String project, String version, String id ) + public void removeArtifact( RepositorySession session, ArtifactMetadata artifactMetadata, String baseVersion ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion ) - throws MetadataRepositoryException - { - throw new UnsupportedOperationException(); - } - - @Override - public void removeArtifact( String repositoryId, String namespace, String project, String version, + public void removeArtifact( RepositorySession session, String repositoryId, String namespace, String project, String version, MetadataFacet metadataFacet ) throws MetadataRepositoryException { @@ -168,13 +161,13 @@ public abstract class AbstractMetadataRepository } @Override - public void removeRepository( String repositoryId ) + public void removeRepository( RepositorySession session, String repositoryId ) throws MetadataRepositoryException { } @Override - public void removeNamespace( String repositoryId, String namespace ) + public void removeNamespace( RepositorySession session, String repositoryId, String namespace ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); @@ -182,21 +175,21 @@ public abstract class AbstractMetadataRepository } @Override - public List<ArtifactMetadata> getArtifacts( String repositoryId ) + public List<ArtifactMetadata> getArtifacts( RepositorySession session, String repositoryId ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public ProjectMetadata getProject( String repoId, String namespace, String projectId ) + public ProjectMetadata getProject( RepositorySession session, String repoId, String namespace, String projectId ) throws MetadataResolutionException { throw new UnsupportedOperationException(); } @Override - public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, + public ProjectVersionMetadata getProjectVersion( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException { @@ -204,7 +197,7 @@ public abstract class AbstractMetadataRepository } @Override - public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, + public Collection<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException { @@ -212,7 +205,7 @@ public abstract class AbstractMetadataRepository } @Override - public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId, + public Collection<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException { @@ -220,42 +213,42 @@ public abstract class AbstractMetadataRepository } @Override - public Collection<String> getRootNamespaces( String repoId ) + public Collection<String> getRootNamespaces( RepositorySession session, String repoId ) throws MetadataResolutionException { throw new UnsupportedOperationException(); } @Override - public Collection<String> getNamespaces( String repoId, String namespace ) + public Collection<String> getNamespaces( RepositorySession session, String repoId, String namespace ) throws MetadataResolutionException { throw new UnsupportedOperationException(); } @Override - public Collection<String> getProjects( String repoId, String namespace ) + public Collection<String> getProjects( RepositorySession session, String repoId, String namespace ) throws MetadataResolutionException { throw new UnsupportedOperationException(); } @Override - public Collection<String> getProjectVersions( String repoId, String namespace, String projectId ) + public Collection<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId ) throws MetadataResolutionException { throw new UnsupportedOperationException(); } @Override - public void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) + public void removeProjectVersion( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId, + public Collection<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException { @@ -263,16 +256,12 @@ public abstract class AbstractMetadataRepository } @Override - public void removeProject( String repositoryId, String namespace, String projectId ) + public void removeProject( RepositorySession session, String repositoryId, String namespace, String projectId ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } - @Override - public void save() - { - } @Override public void close() @@ -281,32 +270,27 @@ public abstract class AbstractMetadataRepository } @Override - public void revert() - { - } - - @Override public boolean canObtainAccess( Class<?> aClass ) { throw new UnsupportedOperationException(); } @Override - public <T> T obtainAccess( Class<T> aClass ) + public <T> T obtainAccess( RepositorySession session, Class<T> aClass ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<ArtifactMetadata> searchArtifacts( String text, String repositoryId, boolean exact ) + public List<ArtifactMetadata> searchArtifacts( RepositorySession session, String repositoryId, String text, boolean exact ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); } @Override - public List<ArtifactMetadata> searchArtifacts( String key, String text, String repositoryId, boolean exact ) + public List<ArtifactMetadata> searchArtifacts( RepositorySession session, String repositoryId, String key, String text, boolean exact ) throws MetadataRepositoryException { throw new UnsupportedOperationException(); 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 b3f6f43b8..ba8e0fc41 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 @@ -103,7 +103,7 @@ public class DefaultMetadataResolver MetadataRepository metadataRepository = session.getRepository(); ProjectVersionMetadata metadata = - metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion ); + metadataRepository.getProjectVersion( session, repoId, namespace, projectId, projectVersion ); // TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated) // in such cases we might also remove/update stale metadata, including adjusting plugin-based facets // This would also be better than checking for completeness - we can then refresh only when fixed (though @@ -136,7 +136,7 @@ public class DefaultMetadataResolver { listener.addArtifact( session, repoId, namespace, projectId, metadata ); } - metadataRepository.updateProjectVersion( repoId, namespace, projectId, metadata ); + metadataRepository.updateProjectVersion( session, repoId, namespace, projectId, metadata ); } catch ( MetadataRepositoryException e ) { @@ -183,7 +183,7 @@ public class DefaultMetadataResolver // TODO: is this assumption correct? could a storage mech. actually know all references in a non-Maven scenario? // not passed to the storage mechanism as resolving references would require iterating all artifacts MetadataRepository metadataRepository = session.getRepository(); - return metadataRepository.getProjectReferences( repoId, namespace, projectId, projectVersion ); + return metadataRepository.getProjectReferences( session, repoId, namespace, projectId, projectVersion ); } @Override @@ -200,7 +200,7 @@ public class DefaultMetadataResolver } MetadataRepository metadataRepository = session.getRepository(); - namespaces = metadataRepository.getRootNamespaces( repoId ); + namespaces = metadataRepository.getRootNamespaces( session, repoId ); Collection<String> storageNamespaces = repositoryStorage.listRootNamespaces( repoId, new ExcludesFilter<String>( namespaces ) ); if ( storageNamespaces != null && !storageNamespaces.isEmpty() ) @@ -212,7 +212,7 @@ public class DefaultMetadataResolver { try { - metadataRepository.updateNamespace( repoId, n ); + metadataRepository.updateNamespace( session, repoId, n ); // just invalidate cache entry String cacheKey = repoId + "-" + n; namespacesCache.remove( cacheKey ); @@ -249,11 +249,11 @@ public class DefaultMetadataResolver Collection<String> namespaces = namespacesCache.get( cacheKey ); if ( namespaces == null ) { - namespaces = metadataRepository.getNamespaces( repoId, namespace ); + namespaces = metadataRepository.getNamespaces( session, repoId, namespace ); namespacesCache.put( cacheKey, namespaces ); } Collection<String> exclusions = new ArrayList<>( namespaces ); - exclusions.addAll( metadataRepository.getProjects( repoId, namespace ) ); + exclusions.addAll( metadataRepository.getProjects( session, repoId, namespace ) ); Collection<String> storageNamespaces = repositoryStorage.listNamespaces( repoId, namespace, new ExcludesFilter<String>( exclusions ) ); if ( storageNamespaces != null && !storageNamespaces.isEmpty() ) @@ -265,7 +265,7 @@ public class DefaultMetadataResolver { try { - metadataRepository.updateNamespace( repoId, namespace + "." + n ); + metadataRepository.updateNamespace( session, repoId, namespace + "." + n ); // just invalidate cache entry cacheKey = repoId + "-" + namespace + "." + n; namespacesCache.remove( cacheKey ); @@ -295,14 +295,14 @@ public class DefaultMetadataResolver try { MetadataRepository metadataRepository = session.getRepository(); - Collection<String> projects = metadataRepository.getProjects( repoId, namespace ); + Collection<String> projects = metadataRepository.getProjects( session, repoId, namespace ); Collection<String> exclusions = new ArrayList<>( projects ); String cacheKey = repoId + "-" + namespace; Collection<String> namespaces = namespacesCache.get( cacheKey ); if ( namespaces == null ) { - namespaces = metadataRepository.getNamespaces( repoId, namespace ); + namespaces = metadataRepository.getNamespaces( session, repoId, namespace ); namespacesCache.put( cacheKey, namespaces ); } @@ -322,7 +322,7 @@ public class DefaultMetadataResolver { try { - metadataRepository.updateProject( repoId, projectMetadata ); + metadataRepository.updateProject( session, repoId, projectMetadata ); } catch ( MetadataRepositoryException e ) { @@ -352,7 +352,7 @@ public class DefaultMetadataResolver { MetadataRepository metadataRepository = session.getRepository(); - Collection<String> projectVersions = metadataRepository.getProjectVersions( repoId, namespace, projectId ); + Collection<String> projectVersions = metadataRepository.getProjectVersions( session, repoId, namespace, projectId ); Collection<String> storageProjectVersions = repositoryStorage.listProjectVersions( repoId, namespace, projectId, new ExcludesFilter<String>( projectVersions ) ); @@ -374,7 +374,7 @@ public class DefaultMetadataResolver listener.addArtifact( session, repoId, namespace, projectId, versionMetadata ); } - metadataRepository.updateProjectVersion( repoId, namespace, projectId, versionMetadata ); + metadataRepository.updateProjectVersion( session, repoId, namespace, projectId, versionMetadata ); } catch ( MetadataRepositoryException e ) { @@ -421,7 +421,7 @@ public class DefaultMetadataResolver { MetadataRepository metadataRepository = session.getRepository(); Collection<ArtifactMetadata> artifacts = - metadataRepository.getArtifacts( repoId, namespace, projectId, projectVersion ); + metadataRepository.getArtifacts( session, repoId, namespace, projectId, projectVersion ); ExcludesFilter<String> filter = new ExcludesFilter<String>( createArtifactIdList( artifacts ) ); ReadMetadataRequest readMetadataRequest = @@ -439,7 +439,7 @@ public class DefaultMetadataResolver { try { - metadataRepository.updateArtifact( repoId, namespace, projectId, projectVersion, artifact ); + metadataRepository.updateArtifact( session, repoId, namespace, projectId, projectVersion, artifact ); } catch ( MetadataRepositoryException e ) { diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java index 421eccd91..5048353b5 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java @@ -34,129 +34,142 @@ public interface MetadataRepository /** * Update metadata for a particular project in the metadata repository, or create it if it does not already exist. * + * @param session * @param repositoryId the repository the project is in * @param project the project metadata to create or update */ - void updateProject( String repositoryId, ProjectMetadata project ) + void updateProject( RepositorySession session, String repositoryId, ProjectMetadata project ) throws MetadataRepositoryException; - void updateArtifact( String repositoryId, String namespace, String projectId, String projectVersion, + void updateArtifact( RepositorySession session, String repositoryId, String namespace, String projectId, String projectVersion, ArtifactMetadata artifactMeta ) throws MetadataRepositoryException; - void updateProjectVersion( String repositoryId, String namespace, String projectId, + void updateProjectVersion( RepositorySession session, String repositoryId, String namespace, String projectId, ProjectVersionMetadata versionMetadata ) throws MetadataRepositoryException; /** * create the namespace in the repository. (if not exist) * + * + * @param session * @param repositoryId * @param namespace * @throws MetadataRepositoryException */ - void updateNamespace( String repositoryId, String namespace ) + void updateNamespace( RepositorySession session, String repositoryId, String namespace ) throws MetadataRepositoryException; - List<String> getMetadataFacets( String repositoryId, String facetId ) + List<String> getMetadataFacets( RepositorySession session, String repositoryId, String facetId ) throws MetadataRepositoryException; /** + * + * @param session * @param repositoryId * @param facetId * @return true if the repository datas for this facetId * @throws MetadataRepositoryException * @since 1.4-M4 */ - boolean hasMetadataFacet( String repositoryId, String facetId ) + boolean hasMetadataFacet( RepositorySession session, String repositoryId, String facetId ) throws MetadataRepositoryException; - MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name ) + MetadataFacet getMetadataFacet( RepositorySession session, String repositoryId, String facetId, String name ) throws MetadataRepositoryException; - void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet ) + void addMetadataFacet( RepositorySession session, String repositoryId, MetadataFacet metadataFacet ) throws MetadataRepositoryException; - void removeMetadataFacets( String repositoryId, String facetId ) + void removeMetadataFacets( RepositorySession session, String repositoryId, String facetId ) throws MetadataRepositoryException; - void removeMetadataFacet( String repositoryId, String facetId, String name ) + void removeMetadataFacet( RepositorySession session, String repositoryId, String facetId, String name ) throws MetadataRepositoryException; /** * if startTime or endTime are <code>null</code> they are not used for search * + * + * @param session * @param repositoryId * @param startTime can be <code>null</code> * @param endTime can be <code>null</code> * @return * @throws MetadataRepositoryException */ - List<ArtifactMetadata> getArtifactsByDateRange( String repositoryId, Date startTime, Date endTime ) - throws MetadataRepositoryException; - - // TODO: remove from API, just use configuration - Collection<String> getRepositories() + List<ArtifactMetadata> getArtifactsByDateRange( RepositorySession session, String repositoryId, Date startTime, Date endTime ) throws MetadataRepositoryException; - Collection<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum ) + Collection<ArtifactMetadata> getArtifactsByChecksum( RepositorySession session, String repositoryId, String checksum ) throws MetadataRepositoryException; /** * Get artifacts with a project version metadata key that matches the passed value. * + * + * @param session * @param key * @param value * @param repositoryId can be null, meaning search in all repositories * @return a list of artifacts * @throws MetadataRepositoryException */ - List<ArtifactMetadata> getArtifactsByProjectVersionMetadata( String key, String value, String repositoryId ) + List<ArtifactMetadata> getArtifactsByProjectVersionMetadata( RepositorySession session, String key, String value, String repositoryId ) throws MetadataRepositoryException; /** * Get artifacts with an artifact metadata key that matches the passed value. * + * + * @param session * @param key * @param value * @param repositoryId can be null, meaning search in all repositories * @return a list of artifacts * @throws MetadataRepositoryException */ - List<ArtifactMetadata> getArtifactsByMetadata( String key, String value, String repositoryId ) + List<ArtifactMetadata> getArtifactsByMetadata( RepositorySession session, String key, String value, String repositoryId ) throws MetadataRepositoryException; /** * Get artifacts with a property key that matches the passed value. * Possible keys are 'scm.url', 'org.name', 'url', 'mailingList.0.name', 'license.0.name',... * + * + * @param session * @param key * @param value * @param repositoryId can be null, meaning search in all repositories * @return a list of artifacts * @throws MetadataRepositoryException */ - List<ArtifactMetadata> getArtifactsByProperty( String key, String value, String repositoryId ) + List<ArtifactMetadata> getArtifactsByProperty( RepositorySession session, String key, String value, String repositoryId ) throws MetadataRepositoryException; - void removeArtifact( String repositoryId, String namespace, String project, String version, String id ) + void removeArtifact( RepositorySession session, String repositoryId, String namespace, String project, String version, String id ) throws MetadataRepositoryException; /** * used for deleting timestamped version of SNAPSHOT artifacts * + * + * @param session * @param artifactMetadata the artifactMetadata with the timestamped version (2.0-20120618.214135-2) * @param baseVersion the base version of the snapshot (2.0-SNAPSHOT) * @throws MetadataRepositoryException * @since 1.4-M3 */ - void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion ) + void removeArtifact( RepositorySession session, ArtifactMetadata artifactMetadata, String baseVersion ) throws MetadataRepositoryException; /** * FIXME need a unit test!!! * Only remove {@link MetadataFacet} for the artifact * + * + * @param session * @param repositoryId * @param namespace * @param project @@ -165,46 +178,51 @@ public interface MetadataRepository * @throws MetadataRepositoryException * @since 1.4-M3 */ - void removeArtifact( String repositoryId, String namespace, String project, String version, + void removeArtifact( RepositorySession session, String repositoryId, String namespace, String project, String version, MetadataFacet metadataFacet ) throws MetadataRepositoryException; /** * Delete a repository's metadata. This includes all associated metadata facets. * + * @param session * @param repositoryId the repository to delete */ - void removeRepository( String repositoryId ) + void removeRepository( RepositorySession session, String repositoryId ) throws MetadataRepositoryException; /** + * + * @param session * @param repositoryId * @param namespace (groupId for maven ) * @throws MetadataRepositoryException * @since 1.4-M3 */ - void removeNamespace( String repositoryId, String namespace ) + void removeNamespace( RepositorySession session, String repositoryId, String namespace ) throws MetadataRepositoryException; - List<ArtifactMetadata> getArtifacts( String repositoryId ) + List<ArtifactMetadata> getArtifacts( RepositorySession session, String repositoryId ) throws MetadataRepositoryException; /** * basically just checking it exists not complete data returned * + * + * @param session * @param repoId * @param namespace * @param projectId * @return * @throws MetadataResolutionException */ - ProjectMetadata getProject( String repoId, String namespace, String projectId ) + ProjectMetadata getProject( RepositorySession session, String repoId, String namespace, String projectId ) throws MetadataResolutionException; - ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) + ProjectVersionMetadata getProjectVersion( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException; - Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion ) + Collection<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException; /** @@ -212,48 +230,58 @@ public interface MetadataRepository * a project version as a reference may be present (due to reverse-lookup of dependencies) before the actual * project is, and we want to avoid adding a stub model to the content repository. * + * + * @param session * @param repoId the repository ID to look within * @param namespace the namespace of the project to get references to * @param projectId the identifier of the project to get references to * @param projectVersion the version of the project to get references to * @return a list of project references */ - Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId, + Collection<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException; - Collection<String> getRootNamespaces( String repoId ) + Collection<String> getRootNamespaces( RepositorySession session, String repoId ) throws MetadataResolutionException; /** + * + * @param session * @param repoId * @param namespace * @return {@link Collection} of child namespaces of the namespace argument * @throws MetadataResolutionException */ - Collection<String> getNamespaces( String repoId, String namespace ) + Collection<String> getNamespaces( RepositorySession session, String repoId, String namespace ) throws MetadataResolutionException; /** + * + * @param session * @param repoId * @param namespace * @return * @throws MetadataResolutionException */ - Collection<String> getProjects( String repoId, String namespace ) + Collection<String> getProjects( RepositorySession session, String repoId, String namespace ) throws MetadataResolutionException; /** + * + * @param session * @param repoId * @param namespace * @param projectId * @return * @throws MetadataResolutionException */ - Collection<String> getProjectVersions( String repoId, String namespace, String projectId ) + Collection<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId ) throws MetadataResolutionException; /** + * + * @param session * @param repoId * @param namespace * @param projectId @@ -261,10 +289,12 @@ public interface MetadataRepository * @throws MetadataRepositoryException * @since 1.4-M4 */ - void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion ) + void removeProjectVersion( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataRepositoryException; /** + * + * @param session * @param repoId * @param namespace * @param projectId @@ -272,65 +302,61 @@ public interface MetadataRepository * @return * @throws MetadataResolutionException */ - Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId, + Collection<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion ) throws MetadataResolutionException; /** * remove a project * + * + * @param session * @param repositoryId * @param namespace * @param projectId * @throws MetadataRepositoryException * @since 1.4-M4 */ - void removeProject( String repositoryId, String namespace, String projectId ) + void removeProject( RepositorySession session, String repositoryId, String namespace, String projectId ) throws MetadataRepositoryException; - /** - * <b>implementations can throw RuntimeException</b> - */ - void save(); - - void close() throws MetadataRepositoryException; - /** - * <b>implementations can throw RuntimeException</b> - */ - void revert(); boolean canObtainAccess( Class<?> aClass ); - <T> T obtainAccess( Class<T> aClass ) + <T> T obtainAccess( RepositorySession session, Class<T> aClass ) throws MetadataRepositoryException; /** * Full text artifacts search. * - * @param text + * + * @param session * @param repositoryId can be null to search in all repositories - * @param exact running an exact search, the value must exactly match the text. + * @param text + * @param exact running an exact search, the value must exactly match the text. * @return a list of artifacts * @throws MetadataRepositoryException */ - List<ArtifactMetadata> searchArtifacts( String text, String repositoryId, boolean exact ) + List<ArtifactMetadata> searchArtifacts( RepositorySession session, String repositoryId, String text, boolean exact ) throws MetadataRepositoryException; /** * Full text artifacts search inside the specified key. * + * + * @param session + * @param repositoryId can be null to search in all repositories * @param key search only inside this key * @param text - * @param repositoryId can be null to search in all repositories - * @param exact running an exact search, the value must exactly match the text. + * @param exact running an exact search, the value must exactly match the text. * @return a list of artifacts * @throws MetadataRepositoryException */ - List<ArtifactMetadata> searchArtifacts( String key, String text, String repositoryId, boolean exact ) + List<ArtifactMetadata> searchArtifacts( RepositorySession session, String repositoryId, String key, String text, boolean exact ) throws MetadataRepositoryException; } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataSessionException.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataSessionException.java new file mode 100644 index 000000000..1371d8aa7 --- /dev/null +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataSessionException.java @@ -0,0 +1,52 @@ +package org.apache.archiva.metadata.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Exception thrown if the session method fails. + * + * @author Martin Stockhammer <martin_s@apache.org> + */ +public class MetadataSessionException extends Exception +{ + public MetadataSessionException( ) + { + } + + public MetadataSessionException( String message ) + { + super( message ); + } + + public MetadataSessionException( String message, Throwable cause ) + { + super( message, cause ); + } + + public MetadataSessionException( Throwable cause ) + { + super( cause ); + } + + public MetadataSessionException( String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace ) + { + super( message, cause, enableSuppression, writableStackTrace ); + } +} diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySession.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySession.java index 07424033a..9ebde6a53 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySession.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySession.java @@ -65,17 +65,22 @@ public class RepositorySession return resolver; } - public void save() - { - repository.save(); + protected boolean isDirty() { + return dirty; + } - dirty = false; + protected void setDirty(boolean value) { + this.dirty = value; + } + + public void save() throws MetadataSessionException + { + setDirty( false ); } - public void revert() + public void revert() throws MetadataSessionException { - repository.revert(); - dirty = false; + setDirty( false ); } /** @@ -90,21 +95,14 @@ public class RepositorySession { try { - if ( dirty ) + if ( isDirty() ) { save(); } } - finally + catch ( MetadataSessionException e ) { - try - { - repository.close(); - } - catch ( MetadataRepositoryException e ) - { - throw new RuntimeException( e.getMessage(), e ); - } + throw new RuntimeException( "Could not save the session " + e.getMessage( ), e ); } } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java index 929c3c1a5..17e7c13d8 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java @@ -21,11 +21,11 @@ package org.apache.archiva.metadata.repository; public interface RepositorySessionFactory { - public void open(); + void open( ); - public boolean isOpen(); + boolean isOpen( ); - RepositorySession createSession(); + RepositorySession createSession() throws MetadataRepositoryException; void close(); } diff --git a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java index 5d033f54f..59de1babb 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java +++ b/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java @@ -184,7 +184,7 @@ public abstract class AbstractMetadataRepositoryTest public void testRootNamespaceWithNoMetadataRepository() throws Exception { - Collection<String> namespaces = repository.getRootNamespaces( TEST_REPO_ID ); + Collection<String> namespaces = repository.getRootNamespaces( , TEST_REPO_ID ); assertThat( namespaces ).isNotNull().isEmpty(); } @@ -192,16 +192,16 @@ public abstract class AbstractMetadataRepositoryTest public void testGetNamespaceOnly() throws Exception { - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isEmpty(); + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isEmpty(); - repository.updateNamespace( TEST_REPO_ID, TEST_NAMESPACE ); + repository.updateNamespace( , TEST_REPO_ID, TEST_NAMESPACE ); - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isNotEmpty().contains( + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isNotEmpty().contains( TEST_NAMESPACE ).hasSize( 1 ); - repository.removeNamespace( TEST_REPO_ID, TEST_NAMESPACE ); + repository.removeNamespace( , TEST_REPO_ID, TEST_NAMESPACE ); - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isEmpty(); + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isEmpty(); } @@ -209,22 +209,22 @@ public abstract class AbstractMetadataRepositoryTest public void testGetProjectOnly() throws Exception { - assertNull( repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ) ); - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isEmpty(); + assertNull( repository.getProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ) ); + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isEmpty(); ProjectMetadata project = new ProjectMetadata(); project.setId( TEST_PROJECT ); project.setNamespace( TEST_NAMESPACE ); - repository.updateProject( TEST_REPO_ID, project ); + repository.updateProject( , TEST_REPO_ID, project ); - project = repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + project = repository.getProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); assertEquals( TEST_PROJECT, project.getId() ); assertEquals( TEST_NAMESPACE, project.getNamespace() ); // test that namespace is also constructed - Collection<String> namespaces = repository.getRootNamespaces( TEST_REPO_ID ); + Collection<String> namespaces = repository.getRootNamespaces( , TEST_REPO_ID ); assertThat( namespaces ).isNotNull().isNotEmpty().contains( TEST_NAMESPACE ).hasSize( 1 ); } @@ -233,24 +233,24 @@ public abstract class AbstractMetadataRepositoryTest public void testGetProjectVersionOnly() throws Exception { - assertNull( repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ); - assertNull( repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ) ); - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isEmpty(); + assertNull( repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ); + assertNull( repository.getProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ) ); + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isEmpty(); ProjectVersionMetadata metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( TEST_PROJECT_VERSION, metadata.getId() ); // test that namespace and project is also constructed - Collection<String> namespaces = repository.getRootNamespaces( TEST_REPO_ID ); + Collection<String> namespaces = repository.getRootNamespaces( , TEST_REPO_ID ); assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_NAMESPACE ); - ProjectMetadata projectMetadata = repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + ProjectMetadata projectMetadata = repository.getProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); assertNotNull( projectMetadata ); assertEquals( TEST_PROJECT, projectMetadata.getId() ); assertEquals( TEST_NAMESPACE, projectMetadata.getNamespace() ); @@ -261,33 +261,33 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { assertThat( new ArrayList<>( - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ) ) ).isNotNull().isEmpty(); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ) ) ).isNotNull().isEmpty(); assertThat( - repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ).isNull(); - assertThat( repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ) ).isNull(); + repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ).isNull(); + assertThat( repository.getProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ) ).isNull(); - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isEmpty(); + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isEmpty(); ArtifactMetadata metadata = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); Collection<ArtifactMetadata> artifacts = - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); //assertEquals( Collections.singletonList( metadata ), new ArrayList<ArtifactMetadata>( artifacts ) ); assertThat( artifacts ).containsExactly( metadata ); // test that namespace, project and project version is also constructed - assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isNotEmpty().contains( + assertThat( repository.getRootNamespaces( , TEST_REPO_ID ) ).isNotNull().isNotEmpty().contains( TEST_NAMESPACE ).hasSize( 1 ); - ProjectMetadata projectMetadata = repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + ProjectMetadata projectMetadata = repository.getProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); assertEquals( TEST_PROJECT, projectMetadata.getId() ); assertEquals( TEST_NAMESPACE, projectMetadata.getNamespace() ); ProjectVersionMetadata projectVersionMetadata = - repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( TEST_PROJECT_VERSION, projectVersionMetadata.getId() ); } @@ -301,9 +301,9 @@ public abstract class AbstractMetadataRepositoryTest mailingList.setName( "Foo List" ); mailingList.setOtherArchives( Collections.<String>emptyList() ); metadata.setMailingLists( Arrays.asList( mailingList ) ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( TEST_PROJECT_VERSION, metadata.getId() ); List<MailingList> mailingLists = metadata.getMailingLists(); @@ -371,9 +371,9 @@ public abstract class AbstractMetadataRepositoryTest d.setOptional( true ); metadata.addDependency( d ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( TEST_PROJECT_VERSION, metadata.getId() ); assertEquals( TEST_PROJECT_VERSION, metadata.getVersion() ); assertEquals( "project name", metadata.getName() ); @@ -429,8 +429,8 @@ public abstract class AbstractMetadataRepositoryTest { // currently set up this way so the behaviour of both the test and the mock config return the same repository // set as the File implementation just uses the config rather than the content - repository.updateNamespace( TEST_REPO_ID, "namespace" ); - repository.updateNamespace( OTHER_REPO_ID, "namespace" ); + repository.updateNamespace( , TEST_REPO_ID, "namespace" ); + repository.updateNamespace( , OTHER_REPO_ID, "namespace" ); Collection<String> repositories = repository.getRepositories(); @@ -446,9 +446,9 @@ public abstract class AbstractMetadataRepositoryTest ProjectVersionMetadata metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); metadata.setIncomplete( true ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( true, metadata.isIncomplete() ); assertNull( metadata.getCiManagement() ); assertNull( metadata.getScm() ); @@ -471,16 +471,16 @@ public abstract class AbstractMetadataRepositoryTest metadata.setId( TEST_PROJECT_VERSION ); MetadataFacet facet = new TestMetadataFacet( "baz" ); metadata.addFacet( facet ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); TestMetadataFacet testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID ); assertEquals( "baz", testFacet.getValue() ); @@ -492,17 +492,17 @@ public abstract class AbstractMetadataRepositoryTest { ProjectVersionMetadata metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( metadata.getFacetIds() ).isNotNull().isEmpty(); metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( metadata.getFacetIds() ).isNotNull().isEmpty(); } @@ -519,9 +519,9 @@ public abstract class AbstractMetadataRepositoryTest MetadataFacet facet = new TestMetadataFacet( TEST_FACET_ID, "baz", additionalProps ); metadata.addFacet( facet ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( metadata.getFacetIds() ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_FACET_ID ); @@ -535,9 +535,9 @@ public abstract class AbstractMetadataRepositoryTest TestMetadataFacet newTestFacet = new TestMetadataFacet( TEST_FACET_ID, testFacet.getValue(), facetProperties ); metadata.addFacet( newTestFacet ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( metadata.getFacetIds() ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_FACET_ID ); testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID ); @@ -553,26 +553,26 @@ public abstract class AbstractMetadataRepositoryTest MetadataFacet facet = new TestMetadataFacet( TEST_FACET_ID, "baz" ); versionMetadata.addFacet( facet ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, versionMetadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, versionMetadata ); ArtifactMetadata artifactMetadata = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifactMetadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifactMetadata ); repository.save(); Collection<ArtifactMetadata> artifacts = - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); - artifacts = repository.getArtifacts( TEST_REPO_ID ); + artifacts = repository.getArtifacts( , TEST_REPO_ID ); assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); - artifacts = repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ); + artifacts = repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_SHA1 ); assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); - artifacts = repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ); + artifacts = repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_MD5 ); assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); - artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ); + artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, null, null ); assertEquals( Collections.singletonList( artifactMetadata ), new ArrayList<>( artifacts ) ); } @@ -587,10 +587,10 @@ public abstract class AbstractMetadataRepositoryTest MetadataFacet facet = new TestMetadataFacet( TEST_FACET_ID, "baz", additionalProps ); metadata.addFacet( facet ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); Collection<ArtifactMetadata> artifacts = - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 1 ); metadata = artifacts.iterator().next(); @@ -608,9 +608,9 @@ public abstract class AbstractMetadataRepositoryTest TestMetadataFacet newTestFacet = new TestMetadataFacet( TEST_FACET_ID, testFacet.getValue(), facetProperties ); metadata.addFacet( newTestFacet ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); - artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + artifacts = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 1 ); metadata = artifacts.iterator().next(); @@ -631,17 +631,17 @@ public abstract class AbstractMetadataRepositoryTest ArtifactMetadata metadata = createArtifact(); MetadataFacet facet = new TestMetadataFacet( "baz" ); metadata.addFacet( facet ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); - metadata = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ).iterator().next(); + metadata = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ).iterator().next(); assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); metadata = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); - metadata = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ).iterator().next(); + metadata = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ).iterator().next(); assertEquals( Collections.singleton( TEST_FACET_ID ), metadata.getFacetIds() ); TestMetadataFacet testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID ); assertEquals( "baz", testFacet.getValue() ); @@ -652,17 +652,17 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata metadata = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); - metadata = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ).iterator().next(); + metadata = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ).iterator().next(); assertEquals( Collections.<String>emptyList(), new ArrayList<String>( metadata.getFacetIds() ) ); metadata = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, metadata ); - metadata = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ).iterator().next(); + metadata = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ).iterator().next(); assertEquals( Collections.<String>emptyList(), new ArrayList<String>( metadata.getFacetIds() ) ); } @@ -670,10 +670,10 @@ public abstract class AbstractMetadataRepositoryTest public void testGetMetadataFacet() throws Exception { - repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); TestMetadataFacet test = - (TestMetadataFacet) repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); + (TestMetadataFacet) repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); assertEquals( new TestMetadataFacet( TEST_VALUE ), test ); } @@ -682,25 +682,25 @@ public abstract class AbstractMetadataRepositoryTest public void testGetMetadataFacetWhenEmpty() throws Exception { - assertNull( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); + assertNull( repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); } @Test public void testGetMetadataFacetWhenUnknownName() throws Exception { - repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); - assertNull( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, UNKNOWN ) ); + assertNull( repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, UNKNOWN ) ); } @Test public void testGetMetadataFacetWhenDefaultValue() throws Exception { - repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( null ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new TestMetadataFacet( null ) ); - MetadataFacet metadataFacet = repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); + MetadataFacet metadataFacet = repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); assertEquals( new TestMetadataFacet( TEST_METADATA_VALUE ), metadataFacet ); } @@ -709,17 +709,17 @@ public abstract class AbstractMetadataRepositoryTest public void testGetMetadataFacetWhenUnknownFacetId() throws Exception { - assertNull( repository.getMetadataFacet( TEST_REPO_ID, UNKNOWN, TEST_NAME ) ); + assertNull( repository.getMetadataFacet( , TEST_REPO_ID, UNKNOWN, TEST_NAME ) ); } @Test public void testGetMetadataFacets() throws Exception { - repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); assertEquals( Collections.singletonList( TEST_NAME ), - repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ) ); + repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ) ); } @Test @@ -727,7 +727,7 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { - List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + List<String> facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertTrue( facets.isEmpty() ); } @@ -735,14 +735,14 @@ public abstract class AbstractMetadataRepositoryTest public void testRemoveFacets() throws Exception { - repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) ); - List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + List<String> facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertFalse( facets.isEmpty() ); - repository.removeMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + repository.removeMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); - facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertTrue( facets.isEmpty() ); } @@ -750,12 +750,12 @@ public abstract class AbstractMetadataRepositoryTest public void testRemoveFacetsWhenEmpty() throws Exception { - List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + List<String> facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertTrue( facets.isEmpty() ); - repository.removeMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + repository.removeMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); - facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertTrue( facets.isEmpty() ); } @@ -764,7 +764,7 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { // testing no exception - repository.removeMetadataFacets( TEST_REPO_ID, UNKNOWN ); + repository.removeMetadataFacets( , TEST_REPO_ID, UNKNOWN ); } @Test @@ -772,7 +772,7 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { // testing no exception - repository.removeMetadataFacet( TEST_REPO_ID, UNKNOWN, TEST_NAME ); + repository.removeMetadataFacet( , TEST_REPO_ID, UNKNOWN, TEST_NAME ); } @Test @@ -780,16 +780,16 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { TestMetadataFacet metadataFacet = new TestMetadataFacet( TEST_VALUE ); - repository.addMetadataFacet( TEST_REPO_ID, metadataFacet ); + repository.addMetadataFacet( , TEST_REPO_ID, metadataFacet ); - assertEquals( metadataFacet, repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); - List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + assertEquals( metadataFacet, repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); + List<String> facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertFalse( facets.isEmpty() ); - repository.removeMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); + repository.removeMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); - assertNull( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); - facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + assertNull( repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ); + facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertTrue( facets.isEmpty() ); } @@ -797,22 +797,22 @@ public abstract class AbstractMetadataRepositoryTest public void testRemoveFacetWhenEmpty() throws Exception { - List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + List<String> facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertThat( facets ).isNotNull().isEmpty(); - assertThat( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ).isNull(); + assertThat( repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ).isNull(); - repository.removeMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); + repository.removeMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ); - facets = repository.getMetadataFacets( TEST_REPO_ID, TEST_FACET_ID ); + facets = repository.getMetadataFacets( , TEST_REPO_ID, TEST_FACET_ID ); assertThat( facets ).isNotNull().isEmpty(); - assertThat( repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ).isNull(); + assertThat( repository.getMetadataFacet( , TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) ).isNull(); } @Test public void hasMetadataFacetStart() throws Exception { - assertFalse( repository.hasMetadataFacet( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); + assertFalse( repository.hasMetadataFacet( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); } @@ -821,33 +821,33 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { - assertFalse( repository.hasMetadataFacet( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); + assertFalse( repository.hasMetadataFacet( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); Calendar cal = Calendar.getInstance(); - repository.addMetadataFacet( TEST_REPO_ID, new KindOfRepositoryStatistics( "first", cal.getTime() ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new KindOfRepositoryStatistics( "first", cal.getTime() ) ); - assertTrue( repository.hasMetadataFacet( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); + assertTrue( repository.hasMetadataFacet( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); cal.add( Calendar.MINUTE, 2 ); - repository.addMetadataFacet( TEST_REPO_ID, new KindOfRepositoryStatistics( "second", cal.getTime() ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new KindOfRepositoryStatistics( "second", cal.getTime() ) ); cal.add( Calendar.MINUTE, 2 ); - repository.addMetadataFacet( TEST_REPO_ID, new KindOfRepositoryStatistics( "third", cal.getTime() ) ); + repository.addMetadataFacet( , TEST_REPO_ID, new KindOfRepositoryStatistics( "third", cal.getTime() ) ); - List<String> facets = repository.getMetadataFacets( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ); + List<String> facets = repository.getMetadataFacets( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ); assertThat( facets ).isNotNull().isNotEmpty().hasSize( 3 ); - assertTrue( repository.hasMetadataFacet( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); + assertTrue( repository.hasMetadataFacet( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); - repository.removeMetadataFacets( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ); + repository.removeMetadataFacets( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ); - assertFalse( repository.hasMetadataFacet( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); + assertFalse( repository.hasMetadataFacet( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ) ); - facets = repository.getMetadataFacets( TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ); + facets = repository.getMetadataFacets( , TEST_REPO_ID, KindOfRepositoryStatistics.class.getName() ); assertThat( facets ).isNotNull().isEmpty(); @@ -860,11 +860,11 @@ public abstract class AbstractMetadataRepositoryTest { ArtifactMetadata artifact1 = createArtifact(); ArtifactMetadata artifact2 = createArtifact( "pom" ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); Collection<ArtifactMetadata> artifacts = - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); ArrayList<ArtifactMetadata> actual = new ArrayList<>( artifacts ); Collections.sort( actual,( o1, o2 ) -> o1.getId().compareTo( o2.getId() ) ); assertEquals( Arrays.asList( artifact1, artifact2 ), actual ); @@ -882,11 +882,11 @@ public abstract class AbstractMetadataRepositoryTest String version2 = "1.0-20091212.123456-2"; artifact2.setId( artifact2.getProject() + "-" + version2 + ".jar" ); artifact2.setVersion( version2 ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); Collection<String> versions = - repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifactVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( versions ).isNotNull().isNotEmpty().contains( version1, version2 ); } @@ -899,11 +899,11 @@ public abstract class AbstractMetadataRepositoryTest artifact1.setId( TEST_PROJECT + "-" + TEST_PROJECT_VERSION + ".jar" ); ArtifactMetadata artifact2 = createArtifact(); artifact2.setId( TEST_PROJECT + "-" + TEST_PROJECT_VERSION + "-sources.jar" ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 ); Collection<String> versions = - repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifactVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( versions ).isNotNull().isNotEmpty().hasSize( 1 ).containsExactly( TEST_PROJECT_VERSION ); @@ -914,10 +914,10 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, null, null ); assertEquals( Collections.singletonList( artifact ), artifacts ); } @@ -929,10 +929,10 @@ public abstract class AbstractMetadataRepositoryTest String namespace = "org.apache.archiva"; ArtifactMetadata artifact = createArtifact(); artifact.setNamespace( namespace ); - repository.updateArtifact( TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, null, null ); tryAssert(()->assertEquals( Collections.singletonList( artifact ), artifacts )); } @@ -942,12 +942,12 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); Date date = new Date( artifact.getWhenGathered().getTime() - 10000 ); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, date, null ); assertEquals( Collections.singletonList( artifact ), artifacts ); } @@ -957,11 +957,11 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); Date date = new Date( artifact.getWhenGathered().getTime() + 10000 ); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, date, null ); assertThat( artifacts ).isNotNull().isEmpty(); } @@ -971,13 +971,13 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); Date lower = new Date( artifact.getWhenGathered().getTime() - 10000 ); Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 ); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, lower, upper ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, lower, upper ); assertEquals( Collections.singletonList( artifact ), artifacts ); } @@ -987,12 +987,12 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 ); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, null, upper ); assertEquals( Collections.singletonList( artifact ), artifacts ); } @@ -1002,12 +1002,12 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); Date upper = new Date( artifact.getWhenGathered().getTime() - 10000 ); - List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ); + List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( , TEST_REPO_ID, null, upper ); assertThat( artifacts ).isNotNull().isEmpty(); } @@ -1017,11 +1017,11 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); tryAssert(()-> { - List<ArtifactMetadata> artifacts = repository.getArtifacts(TEST_REPO_ID); + List<ArtifactMetadata> artifacts = repository.getArtifacts( , TEST_REPO_ID ); assertEquals(Collections.singletonList(artifact), artifacts); }); } @@ -1031,16 +1031,16 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); ArtifactMetadata secondArtifact = createArtifact(); secondArtifact.setRepositoryId( OTHER_REPO_ID ); - repository.updateArtifact( OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact ); + repository.updateArtifact( , OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact ); repository.save(); // test it restricts to the appropriate repository - tryAssert(() -> assertEquals( Collections.singletonList( artifact ), repository.getArtifacts( TEST_REPO_ID ) )); - tryAssert(() -> assertEquals( Collections.singletonList( secondArtifact ), repository.getArtifacts( OTHER_REPO_ID ) )); + tryAssert(() -> assertEquals( Collections.singletonList( artifact ), repository.getArtifacts( , TEST_REPO_ID ) )); + tryAssert(() -> assertEquals( Collections.singletonList( secondArtifact ), repository.getArtifacts( , OTHER_REPO_ID ) )); } @@ -1049,18 +1049,18 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); ArtifactMetadata secondArtifact = createArtifact(); secondArtifact.setRepositoryId( OTHER_REPO_ID ); - repository.updateArtifact( OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact ); + repository.updateArtifact( , OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact ); repository.save(); // test it restricts to the appropriate repository assertEquals( Collections.singletonList( artifact ), - repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) ); + repository.getArtifactsByDateRange( , TEST_REPO_ID, null, null ) ); assertEquals( Collections.singletonList( secondArtifact ), - repository.getArtifactsByDateRange( OTHER_REPO_ID, null, null ) ); + repository.getArtifactsByDateRange( , OTHER_REPO_ID, null, null ) ); } @Test @@ -1068,41 +1068,41 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); ArtifactMetadata secondArtifact = createArtifact(); secondArtifact.setRepositoryId( OTHER_REPO_ID ); - repository.updateArtifact( OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact ); + repository.updateArtifact( , OTHER_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, secondArtifact ); repository.save(); // test it restricts to the appropriate repository assertEquals( Collections.singletonList( artifact ), - new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_SHA1 ) ) ); assertEquals( Collections.singletonList( secondArtifact ), new ArrayList<>( - repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_SHA1 ) ) ); + repository.getArtifactsByChecksum( , OTHER_REPO_ID, TEST_SHA1 ) ) ); assertEquals( Collections.singletonList( artifact ), - new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_MD5 ) ) ); assertEquals( Collections.singletonList( secondArtifact ), - new ArrayList<>( repository.getArtifactsByChecksum( OTHER_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( , OTHER_REPO_ID, TEST_MD5 ) ) ); } @Test public void testGetNamespacesWithSparseDepth() throws Exception { - repository.updateNamespace( TEST_REPO_ID, "org.apache.maven.shared" ); + repository.updateNamespace( , TEST_REPO_ID, "org.apache.maven.shared" ); - Collection<String> namespaces = repository.getRootNamespaces( TEST_REPO_ID ); + Collection<String> namespaces = repository.getRootNamespaces( , TEST_REPO_ID ); assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "org" ); - namespaces = repository.getNamespaces( TEST_REPO_ID, "org" ); + namespaces = repository.getNamespaces( , TEST_REPO_ID, "org" ); assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "apache" ); - namespaces = repository.getNamespaces( TEST_REPO_ID, "org.apache" ); + namespaces = repository.getNamespaces( , TEST_REPO_ID, "org.apache" ); assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "maven" ); - namespaces = repository.getNamespaces( TEST_REPO_ID, "org.apache.maven" ); + namespaces = repository.getNamespaces( , TEST_REPO_ID, "org.apache.maven" ); assertThat( namespaces ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "shared" ); } @@ -1111,13 +1111,13 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { String namespace = "org.apache.maven.shared"; - repository.updateNamespace( TEST_REPO_ID, namespace ); + repository.updateNamespace( , TEST_REPO_ID, namespace ); ProjectVersionMetadata metadata = new ProjectVersionMetadata(); metadata.setId( TEST_PROJECT_VERSION ); - repository.updateProjectVersion( TEST_REPO_ID, namespace, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, namespace, TEST_PROJECT, metadata ); - Collection<String> namespaces = repository.getNamespaces( TEST_REPO_ID, namespace ); + Collection<String> namespaces = repository.getNamespaces( , TEST_REPO_ID, namespace ); assertThat( namespaces ).isNotNull().isEmpty(); @@ -1130,11 +1130,11 @@ public abstract class AbstractMetadataRepositoryTest ProjectMetadata projectMetadata = new ProjectMetadata(); projectMetadata.setId( TEST_PROJECT ); projectMetadata.setNamespace( "org.apache.maven" ); - repository.updateProject( TEST_REPO_ID, projectMetadata ); + repository.updateProject( , TEST_REPO_ID, projectMetadata ); - repository.updateNamespace( TEST_REPO_ID, "org.apache.maven.shared" ); + repository.updateNamespace( , TEST_REPO_ID, "org.apache.maven.shared" ); - Collection<String> projects = repository.getProjects( TEST_REPO_ID, "org.apache.maven" ); + Collection<String> projects = repository.getProjects( , TEST_REPO_ID, "org.apache.maven" ); assertThat( projects ).isNotNull().isNotEmpty().hasSize( 1 ).contains( TEST_PROJECT ); } @@ -1147,16 +1147,16 @@ public abstract class AbstractMetadataRepositoryTest ProjectVersionMetadata versionMetadata = new ProjectVersionMetadata(); versionMetadata.setId( TEST_PROJECT_VERSION ); - repository.updateProjectVersion( TEST_REPO_ID, "org.apache.maven", TEST_PROJECT, versionMetadata ); + repository.updateProjectVersion( , TEST_REPO_ID, "org.apache.maven", TEST_PROJECT, versionMetadata ); - repository.updateProjectVersion( TEST_REPO_ID, "org.apache.maven." + TEST_PROJECT, "other-project", - versionMetadata ); + repository.updateProjectVersion( , TEST_REPO_ID, "org.apache.maven." + TEST_PROJECT, + "other-project", versionMetadata ); Collection<String> versions = - repository.getProjectVersions( TEST_REPO_ID, "org.apache.maven." + TEST_PROJECT, "other-project" ); + repository.getProjectVersions( , TEST_REPO_ID, "org.apache.maven." + TEST_PROJECT, "other-project" ); assertThat( versions ).isNotNull().isNotEmpty().contains( TEST_PROJECT_VERSION ); - versions = repository.getProjectVersions( TEST_REPO_ID, "org.apache.maven", TEST_PROJECT ); + versions = repository.getProjectVersions( , TEST_REPO_ID, "org.apache.maven", TEST_PROJECT ); assertThat( versions ).isNotNull().isNotEmpty().contains( TEST_PROJECT_VERSION ); } @@ -1166,11 +1166,11 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); assertEquals( Collections.singletonList( artifact ), - new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_MD5 ) ) ); } @Test @@ -1178,11 +1178,11 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); assertEquals( Collections.singletonList( artifact ), - new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_SHA1 ) ) ); } @Test @@ -1192,13 +1192,13 @@ public abstract class AbstractMetadataRepositoryTest ArtifactMetadata artifact = createArtifact(); String namespace = "multi.level.ns"; artifact.setNamespace( namespace ); - repository.updateArtifact( TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); repository.save(); tryAssert(()->assertEquals( Collections.singletonList( artifact ), - new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_SHA1 ) ) )); + new ArrayList<>( repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_SHA1 ) ) )); tryAssert(()->assertEquals( Collections.singletonList( artifact ), - new ArrayList<>( repository.getArtifactsByChecksum( TEST_REPO_ID, TEST_MD5 ) ) ) ); + new ArrayList<>( repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_MD5 ) ) ) ); } @Test @@ -1206,23 +1206,23 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact1 = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 ); String newProjectId = "another-project"; ArtifactMetadata artifact2 = createArtifact(); artifact2.setProject( newProjectId ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, newProjectId, TEST_PROJECT_VERSION, artifact2 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, newProjectId, TEST_PROJECT_VERSION, artifact2 ); repository.save(); tryAssert(()-> { List<ArtifactMetadata> artifacts = - new ArrayList<>(repository.getArtifactsByChecksum(TEST_REPO_ID, TEST_SHA1)); + new ArrayList<>(repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_SHA1 )); Collections.sort(artifacts, new ArtifactMetadataComparator()); assertEquals(Arrays.asList(artifact2, artifact1), artifacts); }); tryAssert(() -> { - ArrayList<ArtifactMetadata> artifacts = new ArrayList<>(repository.getArtifactsByChecksum(TEST_REPO_ID, TEST_MD5)); + ArrayList<ArtifactMetadata> artifacts = new ArrayList<>(repository.getArtifactsByChecksum( , TEST_REPO_ID, TEST_MD5 )); Collections.sort(artifacts, new ArtifactMetadataComparator()); assertEquals(Arrays.asList(artifact2, artifact1), artifacts); }); @@ -1233,10 +1233,10 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); Collection<ArtifactMetadata> artifactsByChecksum = - repository.getArtifactsByChecksum( TEST_REPO_ID, "not checksum" ); + repository.getArtifactsByChecksum( , TEST_REPO_ID, "not checksum" ); assertThat( artifactsByChecksum ).isNotNull().isEmpty(); } @@ -1246,7 +1246,7 @@ public abstract class AbstractMetadataRepositoryTest { createArtifactWithGenericMetadataFacet( 10 ); Collection<ArtifactMetadata> artifactsByMetadata = - repository.getArtifactsByProjectVersionMetadata( TEST_METADATA_KEY, TEST_METADATA_VALUE, TEST_REPO_ID ); + repository.getArtifactsByProjectVersionMetadata( , TEST_METADATA_KEY, TEST_METADATA_VALUE, TEST_REPO_ID ); assertThat( artifactsByMetadata ).hasSize( 1 ); ArtifactMetadata artifactMetadata = artifactsByMetadata.iterator().next(); assertThat( artifactMetadata.getId() ).isEqualTo( "projectId-1.0.jar" ); @@ -1260,7 +1260,7 @@ public abstract class AbstractMetadataRepositoryTest { createArtifactWithGenericMetadataFacet(); Collection<ArtifactMetadata> artifactsByMetadata = - repository.getArtifactsByProjectVersionMetadata( TEST_METADATA_KEY, TEST_METADATA_VALUE, null ); + repository.getArtifactsByProjectVersionMetadata( , TEST_METADATA_KEY, TEST_METADATA_VALUE, null ); assertThat( artifactsByMetadata ).hasSize( 1 ); assertThat( artifactsByMetadata.iterator().next().getRepositoryId() ).isNotNull().isNotEmpty(); } @@ -1271,7 +1271,7 @@ public abstract class AbstractMetadataRepositoryTest { createArtifactWithGenericMetadataFacet(); Collection<ArtifactMetadata> artifactsByMetadata = - repository.getArtifactsByProjectVersionMetadata( TEST_METADATA_KEY, TEST_METADATA_VALUE, null ); + repository.getArtifactsByProjectVersionMetadata( , TEST_METADATA_KEY, TEST_METADATA_VALUE, null ); assertThat( artifactsByMetadata ).hasSize( 1 ); } @@ -1282,7 +1282,7 @@ public abstract class AbstractMetadataRepositoryTest createArtifactWithMavenArtifactFacet(); tryAssert(()-> { Collection<ArtifactMetadata> artifactsByMetadata = - repository.getArtifactsByMetadata("foo", TEST_METADATA_VALUE, null); + repository.getArtifactsByMetadata( , "foo", TEST_METADATA_VALUE, null ); assertThat(artifactsByMetadata).hasSize(1); ArtifactMetadata artifactMetadata = artifactsByMetadata.iterator().next(); assertThat(artifactMetadata.getId()).isEqualTo("projectId-1.0.jar"); @@ -1301,7 +1301,7 @@ public abstract class AbstractMetadataRepositoryTest createArtifactWithData(); // only works on JCR implementation // Collection<ArtifactMetadata> artifactsByProperty = repository.getArtifactsByProperty( "org.name", TEST_ORGANIZATION.getName(), TEST_REPO_ID ); - Collection<ArtifactMetadata> artifactsByProperty = repository.getArtifactsByProperty( "url", TEST_URL, TEST_REPO_ID ); + Collection<ArtifactMetadata> artifactsByProperty = repository.getArtifactsByProperty( , "url", TEST_URL, TEST_REPO_ID ); assertThat( artifactsByProperty ).hasSize( 1 ); ArtifactMetadata artifactMetadata = artifactsByProperty.iterator().next(); assertThat( artifactMetadata.getId() ).isEqualTo( "projectId-1.0.jar" ); @@ -1313,23 +1313,23 @@ public abstract class AbstractMetadataRepositoryTest public void testDeleteRepository() throws Exception { - repository.updateNamespace( TEST_REPO_ID, TEST_NAMESPACE ); + repository.updateNamespace( , TEST_REPO_ID, TEST_NAMESPACE ); ProjectMetadata project1 = new ProjectMetadata(); project1.setNamespace( TEST_NAMESPACE ); project1.setId( "project1" ); - repository.updateProject( TEST_REPO_ID, project1 ); + repository.updateProject( , TEST_REPO_ID, project1 ); ProjectMetadata project2 = new ProjectMetadata(); project2.setNamespace( TEST_NAMESPACE ); project2.setId( "project2" ); - repository.updateProject( TEST_REPO_ID, project2 ); + repository.updateProject( , TEST_REPO_ID, project2 ); ArtifactMetadata artifact1 = createArtifact(); artifact1.setProject( "project1" ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, "project1", TEST_PROJECT_VERSION, artifact1 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, "project1", TEST_PROJECT_VERSION, artifact1 ); ArtifactMetadata artifact2 = createArtifact(); artifact2.setProject( "project2" ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, "project2", TEST_PROJECT_VERSION, artifact2 ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, "project2", TEST_PROJECT_VERSION, artifact2 ); repository.save(); List<ArtifactMetadata> expected = Arrays.asList( artifact1, artifact2 ); @@ -1338,15 +1338,15 @@ public abstract class AbstractMetadataRepositoryTest tryAssert(()-> { List<ArtifactMetadata> actual = - new ArrayList<>( repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) ); + new ArrayList<>( repository.getArtifactsByDateRange( , TEST_REPO_ID, null, null ) ); Collections.sort( actual, new ArtifactMetadataComparator() ); assertEquals(expected, actual); }); - repository.removeRepository( TEST_REPO_ID ); + repository.removeRepository( , TEST_REPO_ID ); - assertTrue( repository.getArtifacts( TEST_REPO_ID ).isEmpty() ); - assertTrue( repository.getRootNamespaces( TEST_REPO_ID ).isEmpty() ); + assertTrue( repository.getArtifacts( , TEST_REPO_ID ).isEmpty() ); + assertTrue( repository.getRootNamespaces( , TEST_REPO_ID ).isEmpty() ); } @@ -1357,32 +1357,32 @@ public abstract class AbstractMetadataRepositoryTest ArtifactMetadata artifact = createArtifact(); artifact.addFacet( new TestMetadataFacet( "value" ) ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); - assertThat( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ) ).containsExactly( artifact ); + assertThat( repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ) ).containsExactly( artifact ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION_2_0, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION_2_0, artifact ); - Collection<String> versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + Collection<String> versions = repository.getProjectVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); log.info( "versions {}", versions ); assertThat( versions ).isNotNull().isNotEmpty().hasSize( 2 ).contains( "1.0", "2.0" ); - repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() ); + repository.removeArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() ); - versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + versions = repository.getProjectVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); log.info( "versions {}", versions ); assertThat( versions ).isNotNull().isNotEmpty().hasSize( 1 ).contains( "2.0" ); - assertThat( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION ) ).isNotNull().isEmpty(); + assertThat( repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION ) ).isNotNull().isEmpty(); - assertThat( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, - TEST_PROJECT_VERSION_2_0 ) ).isNotEmpty().hasSize( 1 ); + assertThat( repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, + TEST_PROJECT, TEST_PROJECT_VERSION_2_0 ) ).isNotEmpty().hasSize( 1 ); } @Test @@ -1392,18 +1392,18 @@ public abstract class AbstractMetadataRepositoryTest ArtifactMetadata artifact = createArtifact(); artifact.addFacet( new TestMetadataFacet( "value" ) ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); Collection<ArtifactMetadata> artifacts = - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertEquals( Collections.singletonList( artifact ), new ArrayList<>( artifacts ) ); - repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() ); + repository.removeArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() ); - artifacts = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + artifacts = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); assertThat( artifacts ).isNotNull().isEmpty(); } @@ -1415,17 +1415,17 @@ public abstract class AbstractMetadataRepositoryTest ArtifactMetadata artifact = createArtifact(); artifact.addFacet( new TestMetadataFacet( "value" ) ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); - Collection<String> versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + Collection<String> versions = repository.getProjectVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); assertThat( versions ).isNotNull().isNotEmpty().hasSize( 1 ); - repository.removeProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.removeProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); - versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + versions = repository.getProjectVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); assertThat( versions ).isNotNull().isEmpty(); } @@ -1437,15 +1437,15 @@ public abstract class AbstractMetadataRepositoryTest ArtifactMetadata artifact = createArtifact(); artifact.addFacet( new TestMetadataFacet( "value" ) ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); - assertEquals( 1, repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ).size() ); + assertEquals( 1, repository.getProjectVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ).size() ); - repository.removeProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + repository.removeProject( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); - Collection<String> versions = repository.getProjectVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); + Collection<String> versions = repository.getProjectVersions( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT ); assertThat( versions ).isNotNull().isEmpty(); } @@ -1461,7 +1461,7 @@ public abstract class AbstractMetadataRepositoryTest artifactOne.addFacet( new TestMetadataFacet( "value" ) ); artifactOne.setId( TEST_PROJECT + "-" + "2.0-20120618.214127-1" + "." + "jar" ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT", artifactOne ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT", artifactOne ); ArtifactMetadata artifactTwo = createArtifact(); artifactTwo.setVersion( "2.0-20120618.214135-2" ); @@ -1469,24 +1469,24 @@ public abstract class AbstractMetadataRepositoryTest artifactTwo.addFacet( new TestMetadataFacet( "value" ) ); artifactTwo.setId( TEST_PROJECT + "-" + "2.0-20120618.214135-2" + "." + "jar" ); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT", artifactTwo ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT", artifactTwo ); Collection<ArtifactMetadata> artifactMetadatas = - repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); + repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); assertThat( artifactMetadatas ).isNotNull().isNotEmpty().hasSize( 2 ); log.info( "artifactMetadatas: {}", artifactMetadatas ); - repository.removeArtifact( artifactOne, "2.0-SNAPSHOT" ); + repository.removeArtifact( , artifactOne, "2.0-SNAPSHOT" ); - artifactMetadatas = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); + artifactMetadatas = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); assertThat( artifactMetadatas ).isNotNull().isNotEmpty().hasSize( 1 ); - repository.removeArtifact( artifactTwo, "2.0-SNAPSHOT" ); + repository.removeArtifact( , artifactTwo, "2.0-SNAPSHOT" ); - artifactMetadatas = repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); + artifactMetadatas = repository.getArtifacts( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, "2.0-SNAPSHOT" ); assertThat( artifactMetadatas ).isNotNull().isEmpty(); } @@ -1525,14 +1525,14 @@ public abstract class AbstractMetadataRepositoryTest d.setOptional( true ); metadata.addDependency( d ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); repository.save(); - metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + metadata = repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); Collection<ProjectVersionReference> references = - repository.getProjectReferences( TEST_REPO_ID, d.getGroupId(), d.getArtifactId(), d.getVersion() ); + repository.getProjectReferences( , TEST_REPO_ID, d.getGroupId(), d.getArtifactId(), d.getVersion() ); log.info( "references: {}", references ); @@ -1547,7 +1547,7 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { createArtifactWithData(); - Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( "url", TEST_URL, TEST_REPO_ID, false ); + Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( , TEST_REPO_ID, "url", TEST_URL, false ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); } @@ -1556,9 +1556,9 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { createArtifactWithData(); - Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( "url", TEST_URL, TEST_REPO_ID, true ); + Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( , TEST_REPO_ID, "url", TEST_URL, true ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); - artifactsByProperty = repository.searchArtifacts( "org.name", "pache", TEST_REPO_ID, true ); + artifactsByProperty = repository.searchArtifacts( , TEST_REPO_ID, "org.name", "pache", true ); assertThat( artifactsByProperty ).isNotNull().isEmpty(); } @@ -1567,7 +1567,7 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { createArtifactWithGenericMetadataFacet(); - Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( TEST_METADATA_KEY, TEST_METADATA_VALUE, TEST_REPO_ID, false ); + Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( , TEST_REPO_ID, TEST_METADATA_KEY, TEST_METADATA_VALUE, false ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); } @@ -1577,7 +1577,7 @@ public abstract class AbstractMetadataRepositoryTest { createArtifactWithGenericMetadataFacet(); tryAssert(()-> { - Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( TEST_METADATA_KEY, TEST_METADATA_VALUE, null, false ); + Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( , null, TEST_METADATA_KEY, TEST_METADATA_VALUE, false ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); }); } @@ -1590,7 +1590,7 @@ public abstract class AbstractMetadataRepositoryTest // only works in JCR // Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( TEST_URL, TEST_REPO_ID, false ); Collection<ArtifactMetadata> artifactsByProperty = - repository.searchArtifacts( TEST_METADATA_VALUE, TEST_REPO_ID, false ); + repository.searchArtifacts( , TEST_REPO_ID, TEST_METADATA_VALUE, false ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); } @@ -1602,9 +1602,9 @@ public abstract class AbstractMetadataRepositoryTest // only works in JCR // Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( TEST_URL, TEST_REPO_ID, true ); Collection<ArtifactMetadata> artifactsByProperty = - repository.searchArtifacts( TEST_METADATA_VALUE, TEST_REPO_ID, true ); + repository.searchArtifacts( , TEST_REPO_ID, TEST_METADATA_VALUE, true ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); - artifactsByProperty = repository.searchArtifacts( TEST_METADATA_VALUE.substring( 2 ), TEST_REPO_ID, true ); + artifactsByProperty = repository.searchArtifacts( , TEST_REPO_ID, TEST_METADATA_VALUE.substring( 2 ), true ); assertThat( artifactsByProperty ).isNotNull().isEmpty(); } @@ -1613,7 +1613,7 @@ public abstract class AbstractMetadataRepositoryTest throws Exception { createArtifactWithGenericMetadataFacet(); - Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( TEST_METADATA_VALUE, TEST_REPO_ID, false ); + Collection<ArtifactMetadata> artifactsByProperty = repository.searchArtifacts( , TEST_REPO_ID, TEST_METADATA_VALUE, false ); assertThat( artifactsByProperty ).isNotNull().isNotEmpty(); } @@ -1670,16 +1670,16 @@ public abstract class AbstractMetadataRepositoryTest { artifact.addFacet( artifactFacet ); } - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); } if ( projectVersionMetadataFacet != null ) { ProjectVersionMetadata metadata = - repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); metadata.addFacet( projectVersionMetadataFacet ); metadata.setOrganization( TEST_ORGANIZATION ); metadata.setUrl( TEST_URL ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); } repository.save(); } @@ -1688,13 +1688,13 @@ public abstract class AbstractMetadataRepositoryTest throws MetadataRepositoryException, MetadataResolutionException { ArtifactMetadata artifact = createArtifact(); - repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); + repository.updateArtifact( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact ); ProjectVersionMetadata metadata = - repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); + repository.getProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ); metadata.setOrganization( TEST_ORGANIZATION ); metadata.setUrl( TEST_URL ); - repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); + repository.updateProjectVersion( , TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata ); repository.save(); } diff --git a/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryStatisticsProvider.java b/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryStatisticsProvider.java index 112f86a11..6fb375194 100644 --- a/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryStatisticsProvider.java +++ b/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryStatisticsProvider.java @@ -21,6 +21,7 @@ package org.apache.archiva.metadata.repository.stats.model; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; +import org.apache.archiva.metadata.repository.RepositorySession; /** * @@ -37,11 +38,13 @@ public interface RepositoryStatisticsProvider /** * Populate the statistics object with the statistics data of this repository. * + * + * @param repositorySession * @param repository The current metadata repository implementation * @param repositoryId The repository Id * @param statistics The statistics object that should be filled. * @throws MetadataRepositoryException Is thrown, if an error occurs while accessing the repository */ - void populateStatistics( MetadataRepository repository, String repositoryId, RepositoryStatistics statistics) + void populateStatistics( RepositorySession repositorySession, MetadataRepository repository, String repositoryId, RepositoryStatistics statistics ) throws MetadataRepositoryException; } diff --git a/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryWalkingStatisticsProvider.java b/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryWalkingStatisticsProvider.java index 9cc426c8c..172332209 100644 --- a/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryWalkingStatisticsProvider.java +++ b/archiva-modules/metadata/metadata-statistics-api/src/main/java/org/apache/archiva/metadata/repository/stats/model/RepositoryWalkingStatisticsProvider.java @@ -24,6 +24,7 @@ import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.archiva.metadata.repository.MetadataResolutionException; +import org.apache.archiva.metadata.repository.RepositorySession; import java.util.Collection; @@ -43,19 +44,21 @@ public class RepositoryWalkingStatisticsProvider implements RepositoryStatistics /** * Walks each namespace of the given repository id and counts the artifacts. * + * + * @param repositorySession * @param metadataRepository The repository implementation * @param repositoryId The repository Id * @param repositoryStatistics The statistics object that must be populated * @throws MetadataRepositoryException Throws the repository exception, if an error occurs while accessing the repository. */ @Override - public void populateStatistics( MetadataRepository metadataRepository, String repositoryId, - RepositoryStatistics repositoryStatistics ) + public void populateStatistics( RepositorySession repositorySession, MetadataRepository metadataRepository, String repositoryId, + RepositoryStatistics repositoryStatistics ) throws MetadataRepositoryException { try { - for ( String ns : metadataRepository.getRootNamespaces( repositoryId ) ) + for ( String ns : metadataRepository.getRootNamespaces( , repositoryId ) ) { walkRepository( metadataRepository, repositoryStatistics, repositoryId, ns ); } @@ -70,12 +73,12 @@ public class RepositoryWalkingStatisticsProvider implements RepositoryStatistics String ns ) throws MetadataResolutionException { - for ( String namespace : metadataRepository.getNamespaces( repositoryId, ns ) ) + for ( String namespace : metadataRepository.getNamespaces( , repositoryId, ns ) ) { walkRepository( metadataRepository, stats, repositoryId, ns + "." + namespace ); } - Collection<String> projects = metadataRepository.getProjects( repositoryId, ns ); + Collection<String> projects = metadataRepository.getProjects( , repositoryId, ns ); if ( !projects.isEmpty() ) { stats.setTotalGroupCount( stats.getTotalGroupCount() + 1 ); @@ -83,10 +86,10 @@ public class RepositoryWalkingStatisticsProvider implements RepositoryStatistics for ( String project : projects ) { - for ( String version : metadataRepository.getProjectVersions( repositoryId, ns, project ) ) + for ( String version : metadataRepository.getProjectVersions( , repositoryId, ns, project ) ) { - for ( ArtifactMetadata artifact : metadataRepository.getArtifacts( repositoryId, ns, project, - version ) ) + for ( ArtifactMetadata artifact : metadataRepository.getArtifacts( , repositoryId, ns, + project, version ) ) { stats.setTotalArtifactCount( stats.getTotalArtifactCount() + 1 ); stats.setTotalArtifactFileSize( stats.getTotalArtifactFileSize() + artifact.getSize() ); |