class ComplianceRepositoryImpl implements ComplianceRepository, Constants {

    @Override
    public Boolean closeIssuesByRule(RuleDetails ruleDetails) {
        List<Map<String, Object>> issueDetails;
        try {
            issueDetails = getOpenIssueDetailsByRuleId(ruleDetails.getRuleId());
            Boolean status = true;
            for (Map<String, Object> issueDetail : issueDetails) {
                if (status) {
                    String dataSource = String.valueOf(issueDetail.get(PAC_DS)) + "_" + issueDetail.get(TARGET_TYPE);
                    String targetType = String.valueOf(issueDetail.get(TYPE)) + "_" + issueDetail.get(TARGET_TYPE);
                    String id = String.valueOf(issueDetail.get(ES_DOC_ID_KEY));
                    String routing = String.valueOf(issueDetail.get(ES_DOC_ROUTING_KEY));
                    String parent = String.valueOf(issueDetail.get(ES_DOC_PARENT_KEY));
                    Map<String, Object> partialDocument = Maps.newHashMap();
                    partialDocument.put(ISSUE_STATUS, CLOSED);
                    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT, Locale.US);
                    sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
                    partialDocument.put(MODIFIED_DATE, sdf.format(new Date()));
                    partialDocument.put("reasonForCloser", "Rule disabled by : " + ruleDetails.getUserId());
                    status = elasticSearchRepository.updatePartialDataToES(dataSource, targetType, id, routing, parent,
                            partialDocument);
                }
            }
            return status;
        } catch (Exception e) {
            logger.error(e);
            return false;
        }
    }

}