class LegacyDetectorRepositoryImpl implements LegacyDetectorRepository {

    @Override
    public void deleteDetector(String uuid) {
        MDC.put("DetectorUuid", uuid);
        val deleteRequest = new DeleteRequest(DETECTOR_INDEX, DETECTOR_DOC_TYPE, uuid);
        try {
            val deleteResponse = legacyElasticSearchClient.delete(deleteRequest, RequestOptions.DEFAULT);
            if (elasticsearchUtil.checkNullResponse(deleteResponse.getResult())) {
                throw new RecordNotFoundException("Invalid request: " + uuid);
            }
        } catch (IOException e) {
            log.error("Deleting detector failed", e);
            throw new RuntimeException(e);
        } finally {
            MDC.remove("DetectorUuid");
        }
    }

}