diff options
author | Olivier Lamy <olamy@apache.org> | 2014-03-20 23:23:44 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-03-20 23:23:44 +0000 |
commit | c3bb4dc7143de41ea8e81b37d2db92f27197dba8 (patch) | |
tree | 81fa1ee2cbb68a16476195961788f7b99210a885 /archiva-modules | |
parent | 6e362e8235cb5cda6e703663fecfeadf4e9b68d2 (diff) | |
download | archiva-c3bb4dc7143de41ea8e81b37d2db92f27197dba8.tar.gz archiva-c3bb4dc7143de41ea8e81b37d2db92f27197dba8.zip |
fix removeProject
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1579828 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
2 files changed, 18 insertions, 2 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java index a08ae5a10..31751224c 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java @@ -98,7 +98,7 @@ public class CassandraMetadataRepository .createRangeSlicesQuery( keyspace, StringSerializer.get(), StringSerializer.get(), StringSerializer.get() ) // .setColumnFamily( cassandraArchivaManager.getRepositoryFamilyName() ) // - .setColumnNames( "repositoryName" ) // + .setColumnNames( "repositoryName" ) // .addEqualsExpression( "repositoryName", repositoryId ) // .execute(); @@ -124,7 +124,8 @@ public class CassandraMetadataRepository } - return new Repository( result.get().getList().get( 0 ).getColumnSlice().getColumnByName( "repositoryName" ).getValue() ); + return new Repository( + result.get().getList().get( 0 ).getColumnSlice().getColumnByName( "repositoryName" ).getValue() ); } @@ -569,6 +570,17 @@ public class CassandraMetadataRepository throws MetadataRepositoryException { + String key = new Project.KeyBuilder() // + .withProjectId( projectId ) // + .withNamespace( new Namespace( namespaceId, new Repository( repositoryId ) ) ) // + .build(); + + HFactory.createMutator( cassandraArchivaManager.getKeyspace(), new StringSerializer() ) // + .addDeletion( key, cassandraArchivaManager.getProjectFamilyName() ) // + .execute(); + + // TODO finish linked data to delete + /* // cleanup ArtifactMetadataModel final List<ArtifactMetadataModel> artifactMetadataModels = new ArrayList<ArtifactMetadataModel>(); diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java index 403a9326e..1b1c21fbc 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java @@ -118,6 +118,10 @@ public class RepositoriesNamespaceTest Assertions.assertThat( cmr.getProjects( "release", "org" ) ).isNotEmpty().hasSize( 1 ).containsExactly( "theproject" ); + cmr.removeProject( "release", "org", "theproject" ); + + Assertions.assertThat( cmr.getProjects( "release", "org" ) ).isEmpty(); + cmr.removeRepository( "release" ); r = cmr.getRepository( "release" ); |