class DetectorMappingRepositoryImpl implements DetectorMappingRepository {

    @Override
    public void disableDetectorMapping(String id) {
        val detectorMapping = findDetectorMapping(id);
        if (detectorMapping.isEnabled()) {
            final PercolatorDetectorMapping percolatorDetectorMapping = new PercolatorDetectorMapping()
                    .setUser(detectorMapping.getUser())
                    .setConsumerDetectorMapping(detectorMapping.getDetector())
                    .setQuery(QueryUtil.buildQuery(detectorMapping.getExpression()))
                    .setEnabled(false)
                    .setLastModifiedTimeInMillis(System.currentTimeMillis())
                    .setCreatedTimeInMillis(detectorMapping.getCreatedTimeInMillis());
            updateDetectorMapping(id, percolatorDetectorMapping);
        }
    }

    @Autowired public  DetectorMappingRepositoryImpl(MetricRegistry metricRegistry);

}