class ComplianceRepositoryImpl implements ComplianceRepository, Constants {

    @Override
    public Boolean revokeAndUpdateIssueDetails(String issueId) throws DataException {
        try {
            List<Map<String, Object>> issueDetails = getExemptedIssueDetails(issueId);
            Boolean isUpdated = false;
            if (!issueDetails.isEmpty()) {
                Map<String, Object> issueDetail = issueDetails.get(0);
                Map<String, Object> issueExceptionDetails = Maps.newHashMap();
                issueExceptionDetails.put(TARGET_TYPE, String.valueOf(issueDetail.get(TARGET_TYPE)));
                issueExceptionDetails.put("source", "issueException");
                String dataSource = issueDetail.get(PAC_DS) + "_" + issueDetail.get(TARGET_TYPE);
                String targetType = 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, OPEN);
                SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT, Locale.US);
                sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
                partialDocument.put(MODIFIED_DATE, sdf.format(new Date()));
                partialDocument.put(STATUS, "revoked");
                isUpdated = elasticSearchRepository.updatePartialDataToES(dataSource, targetType, id, routing, parent,
                        partialDocument);
                if (isUpdated) {
                    try {
                        List<Map<String, Object>> exceptionDetails = getIssueDetails(issueId, null);
                        Map<String, Object> exceptionDetail = exceptionDetails.get(0);
                        String exceptionId = String.valueOf(exceptionDetail.get(ES_DOC_ID_KEY));
                        StringBuilder esQueryUrl = new StringBuilder(esUrl);
                        esQueryUrl.append("/").append(dataSource).append("/" + targetType).append("_exception/")
                                .append(exceptionId).append("?routing=" + routing);
                        HttpClient client = HttpClientBuilder.create().build();
                        HttpDelete httpdelete = new HttpDelete(esQueryUrl.toString());
                        httpdelete.setHeader("Content-Type", ContentType.APPLICATION_JSON.toString());
                        client.execute(httpdelete);
                    } catch (Exception exception) {
                        logger.info("No Issue Exception found!!!" + exception);
                    }
                    return isUpdated;
                }
            }
            return false;
        } catch (Exception e) {
            throw new DataException(e);
        }
    }

}