class ProjectionRepositoryImpl implements ProjectionRepository, Constants {

    public Map<String, Long> getUnPatchedDetailsByApplication(String assetGroup, String resourceType)
            throws DataException {
        Map<String, Object> mustFilter = new HashMap<>();
        mustFilter.put(CommonUtils.convertAttributetoKeyword(TYPE), ISSUE);
        mustFilter.put(CommonUtils.convertAttributetoKeyword(ISSUE_STATUS), OPEN);
        if (resourceType.equals(ONPREMSERVER)) {
            mustFilter.put(CommonUtils.convertAttributetoKeyword(RULEID), ONPREM_KERNEL_COMPLIANCE_RULE);
        } else if (resourceType.equals(EC2)) {
            mustFilter.put(CommonUtils.convertAttributetoKeyword(RULEID), EC2_KERNEL_COMPLIANCE_RULE);
        }

        String aggsFilterApp = CommonUtils.convertAttributetoKeyword(TAGS_APPLICATION);

        try {
            return esRepository.getTotalDistributionForIndexAndType(assetGroup, "issue_" + resourceType, mustFilter,
                    null, null, aggsFilterApp, TEN_THOUSAND, null);
        } catch (Exception e) {
            logger.error(e);
            throw new DataException(e);
        }

    }

}