use of org.apache.archiva.metadata.repository.cassandra.model.Repository in project archiva by apache.
the class CassandraMetadataRepository method removeProject.
@Override
public void removeProject(final String repositoryId, final String namespaceId, final String projectId) throws MetadataRepositoryException {
String key = //
new Project.KeyBuilder().withProjectId(//
projectId).withNamespace(//
new Namespace(namespaceId, new Repository(repositoryId))).build();
this.projectTemplate.deleteRow(key);
QueryResult<OrderedRows<String, String, String>> result = //
HFactory.createRangeSlicesQuery(keyspace, ss, ss, //
ss).setColumnFamily(//
cassandraArchivaManager.getProjectVersionMetadataFamilyName()).setColumnNames(//
ID.toString()).addEqualsExpression(REPOSITORY_NAME.toString(), //
repositoryId).addEqualsExpression(NAMESPACE_ID.toString(), //
namespaceId).addEqualsExpression(PROJECT_ID.toString(), //
projectId).execute();
for (Row<String, String, String> row : result.get()) {
this.projectVersionMetadataTemplate.deleteRow(row.getKey());
removeMailingList(row.getKey());
}
result = //
HFactory.createRangeSlicesQuery(keyspace, ss, ss, //
ss).setColumnFamily(//
cassandraArchivaManager.getArtifactMetadataFamilyName()).setColumnNames(//
PROJECT_ID.toString()).addEqualsExpression(REPOSITORY_NAME.toString(), //
repositoryId).addEqualsExpression(NAMESPACE_ID.toString(), //
namespaceId).addEqualsExpression(PROJECT_ID.toString(), //
projectId).execute();
for (Row<String, String, String> row : result.get()) {
this.artifactMetadataTemplate.deleteRow(row.getKey());
}
}
Aggregations