Search in sources :

Example 1 with DeleteRequest

use of co.elastic.clients.elasticsearch.core.DeleteRequest in project syncope by apache.

the class ElasticsearchIndexManager method after.

@TransactionalEventListener
public void after(final AnyDeletedEvent event) throws IOException {
    LOG.debug("About to delete index for {}[{}]", event.getAnyTypeKind(), event.getAnyKey());
    DeleteRequest request = new DeleteRequest.Builder().index(ElasticsearchUtils.getContextDomainName(AuthContextUtils.getDomain(), event.getAnyTypeKind())).id(event.getAnyKey()).build();
    DeleteResponse response = client.delete(request);
    LOG.debug("Index successfully deleted for {}[{}]: {}", event.getAnyTypeKind(), event.getAnyKey(), response);
}
Also used : DeleteResponse(co.elastic.clients.elasticsearch.core.DeleteResponse) DeleteRequest(co.elastic.clients.elasticsearch.core.DeleteRequest) TransactionalEventListener(org.springframework.transaction.event.TransactionalEventListener)

Aggregations

DeleteRequest (co.elastic.clients.elasticsearch.core.DeleteRequest)1 DeleteResponse (co.elastic.clients.elasticsearch.core.DeleteResponse)1 TransactionalEventListener (org.springframework.transaction.event.TransactionalEventListener)1