class DetectorMappingRepositoryImpl implements DetectorMappingRepository {

    @Override
    public DetectorMapping findDetectorMapping(String id) {
        val getRequest = new GetRequest(elasticSearchProperties.getIndexName(),
                elasticSearchProperties.getDocType(), id);
        try {
            val response = legacyElasticSearchClient.get(getRequest, RequestOptions.DEFAULT);
            return getDetectorMapping(response.getSourceAsString(), response.getId(), Optional.empty());
        } catch (IOException e) {
            log.error(String.format("Get mapping %s failed", id), e);
            throw new RuntimeException(e);
        }
    }

    @Autowired public  DetectorMappingRepositoryImpl(MetricRegistry metricRegistry);

}