use of org.graylog2.indexer.indexset.events.IndexSetDeletedEvent in project graylog2-server by Graylog2.
the class MongoIndexSetService method delete.
/**
* {@inheritDoc}
*/
@Override
public int delete(ObjectId id) {
if (!isDeletable(id)) {
return 0;
}
final DBQuery.Query query = DBQuery.is("_id", id);
final WriteResult<IndexSetConfig, ObjectId> writeResult = collection.remove(query);
final int removedEntries = writeResult.getN();
if (removedEntries > 0) {
final IndexSetDeletedEvent deletedEvent = IndexSetDeletedEvent.create(id.toHexString());
clusterEventBus.post(deletedEvent);
}
return removedEntries;
}
Aggregations