@Test public void updateKernelVersionTest() throws Exception { KernelVersion kernelVersion = new KernelVersion(); kernelVersion.setInstanceId("12345"); kernelVersion.setKernelVersionId("12345"); String response = "{\"count\":0,\"_shards\":{\"total\":3,\"successful\":3,\"failed\":0}}"; String responsewithcount = "{\"count\":10,\"_shards\":{\"total\":3,\"successful\":3,\"failed\":0}}"; ReflectionTestUtils.setField(complianceRepositoryImpl, "esUrl", "dummyEsURL"); String kernelCriteria = "el6.x#2.6333.32-696.23.1.el6.x86_64|el7#3.10.0-6933333.231.1.el7.x86_64|el6uek#3.8.13-133318.20.3.el6uek-x86_64|amzn1#4.9.85-38.55558.amzn1.x86_64"; when(rdsepository.queryForString(anyString())).thenReturn(kernelCriteria); mockStatic(PacHttpUtils.class); when(PacHttpUtils.doHttpPost(anyString(), anyString())).thenReturn(responsewithcount); complianceRepositoryImpl.updateKernelVersion(kernelVersion); when(PacHttpUtils.doHttpPost(anyString(), anyString())).thenReturn(response); complianceRepositoryImpl.updateKernelVersion(kernelVersion); RhnSystemDetails systemDetails = new RhnSystemDetails(); systemDetails.setCompanyId(123l); when(rhnSystemDetailsRepository.findRhnSystemDetailsByInstanceId(kernelVersion.getInstanceId())).thenReturn( systemDetails); complianceRepositoryImpl.updateKernelVersion(kernelVersion); KernelVersion emptyKernalVersion = new KernelVersion(); complianceRepositoryImpl.updateKernelVersion(emptyKernalVersion); }
@SuppressWarnings("unchecked") @Override public Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion) { Map<String, Object> response = Maps.newHashMap(); RhnSystemDetails systemDetails = null; Map<String, String> kernelCriteriaMapCurrent = buildCriteriaMap(getCurrentQuarterCriteriaKey()); Set<String> kernelCriteriaMapkeysCurrent = kernelCriteriaMapCurrent.keySet(); try { if ((kernelVersion.getInstanceId() != null && !"".equals(kernelVersion.getInstanceId())) && (kernelVersion.getKernelVersionId() != null && !"".equals(kernelVersion.getKernelVersionId()))) { Boolean isKernelComplaint = isCompliant(kernelVersion.getKernelVersionId(), kernelCriteriaMapkeysCurrent, kernelCriteriaMapCurrent); systemDetails = rhnSystemDetailsRepository.findRhnSystemDetailsByInstanceId(kernelVersion .getInstanceId()); if (systemDetails != null) { systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setIsKernelCompliant(isKernelComplaint); systemDetails.setModifiedDate(new Date()); systemDetails.setUserName("webservice"); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Kernel Version Updated Successfully!!!"); response.put(STATUS, true); return response; } else { String instanceIdSearchQuery = "{\"query\":{\"bool\":{\"must\":[{\"term\":{\"latest\":{\"value\":\"true\"}}},{\"term\":{\"instanceid.keyword\":{\"value\":\"" + kernelVersion.getInstanceId() + "\"}}}]}}}"; StringBuilder urlToQueryinstanceId = new StringBuilder(esUrl).append("/").append("aws_ec2/ec2") .append("/").append(UNDERSCORE_COUNT); String instanceDetails = PacHttpUtils.doHttpPost(urlToQueryinstanceId.toString(), instanceIdSearchQuery); Gson serializer = new GsonBuilder().create(); Map<String, Object> instanceDetailsMap = (Map<String, Object>) serializer.fromJson(instanceDetails, Object.class); double count = (double) instanceDetailsMap.get(COUNT); if (count >= 1) { systemDetails = new RhnSystemDetails(); systemDetails.setGroupId(0L); systemDetails.setCompanyId(0L); systemDetails.setUserId(0L); systemDetails.setUserName("webservice"); systemDetails.setCreateDate(new Date()); systemDetails.setModifiedDate(new Date()); systemDetails.setSystemId(0); systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setInstanceId(kernelVersion.getInstanceId()); systemDetails.setLastCheckedIn(null); systemDetails.setOs(""); systemDetails.setIsKernelCompliant(isKernelComplaint); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Successfully added new Kernel Version for the InstanceId!!!"); response.put(STATUS, true); return response; } else { response.put(MESSAGE_KEY, "InstanceId not Found!!!"); response.put(STATUS, false); return response; } } } else { response.put(MESSAGE_KEY, "Kernel Version or InstanceId cannot be null!!!"); response.put(STATUS, false); return response; } } catch (Exception exception) { logger.error(exception); response.put(MESSAGE_KEY, "Unexpected Error Occurred!!!"); response.put(STATUS, false); return response; } }
ComplianceRepositoryImpl implements ComplianceRepository, Constants { @SuppressWarnings("unchecked") @Override public Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion) { Map<String, Object> response = Maps.newHashMap(); RhnSystemDetails systemDetails = null; Map<String, String> kernelCriteriaMapCurrent = buildCriteriaMap(getCurrentQuarterCriteriaKey()); Set<String> kernelCriteriaMapkeysCurrent = kernelCriteriaMapCurrent.keySet(); try { if ((kernelVersion.getInstanceId() != null && !"".equals(kernelVersion.getInstanceId())) && (kernelVersion.getKernelVersionId() != null && !"".equals(kernelVersion.getKernelVersionId()))) { Boolean isKernelComplaint = isCompliant(kernelVersion.getKernelVersionId(), kernelCriteriaMapkeysCurrent, kernelCriteriaMapCurrent); systemDetails = rhnSystemDetailsRepository.findRhnSystemDetailsByInstanceId(kernelVersion .getInstanceId()); if (systemDetails != null) { systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setIsKernelCompliant(isKernelComplaint); systemDetails.setModifiedDate(new Date()); systemDetails.setUserName("webservice"); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Kernel Version Updated Successfully!!!"); response.put(STATUS, true); return response; } else { String instanceIdSearchQuery = "{\"query\":{\"bool\":{\"must\":[{\"term\":{\"latest\":{\"value\":\"true\"}}},{\"term\":{\"instanceid.keyword\":{\"value\":\"" + kernelVersion.getInstanceId() + "\"}}}]}}}"; StringBuilder urlToQueryinstanceId = new StringBuilder(esUrl).append("/").append("aws_ec2/ec2") .append("/").append(UNDERSCORE_COUNT); String instanceDetails = PacHttpUtils.doHttpPost(urlToQueryinstanceId.toString(), instanceIdSearchQuery); Gson serializer = new GsonBuilder().create(); Map<String, Object> instanceDetailsMap = (Map<String, Object>) serializer.fromJson(instanceDetails, Object.class); double count = (double) instanceDetailsMap.get(COUNT); if (count >= 1) { systemDetails = new RhnSystemDetails(); systemDetails.setGroupId(0L); systemDetails.setCompanyId(0L); systemDetails.setUserId(0L); systemDetails.setUserName("webservice"); systemDetails.setCreateDate(new Date()); systemDetails.setModifiedDate(new Date()); systemDetails.setSystemId(0); systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setInstanceId(kernelVersion.getInstanceId()); systemDetails.setLastCheckedIn(null); systemDetails.setOs(""); systemDetails.setIsKernelCompliant(isKernelComplaint); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Successfully added new Kernel Version for the InstanceId!!!"); response.put(STATUS, true); return response; } else { response.put(MESSAGE_KEY, "InstanceId not Found!!!"); response.put(STATUS, false); return response; } } } else { response.put(MESSAGE_KEY, "Kernel Version or InstanceId cannot be null!!!"); response.put(STATUS, false); return response; } } catch (Exception exception) { logger.error(exception); response.put(MESSAGE_KEY, "Unexpected Error Occurred!!!"); response.put(STATUS, false); return response; } } }
ComplianceRepositoryImpl implements ComplianceRepository, Constants { @SuppressWarnings("unchecked") @Override public Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion) { Map<String, Object> response = Maps.newHashMap(); RhnSystemDetails systemDetails = null; Map<String, String> kernelCriteriaMapCurrent = buildCriteriaMap(getCurrentQuarterCriteriaKey()); Set<String> kernelCriteriaMapkeysCurrent = kernelCriteriaMapCurrent.keySet(); try { if ((kernelVersion.getInstanceId() != null && !"".equals(kernelVersion.getInstanceId())) && (kernelVersion.getKernelVersionId() != null && !"".equals(kernelVersion.getKernelVersionId()))) { Boolean isKernelComplaint = isCompliant(kernelVersion.getKernelVersionId(), kernelCriteriaMapkeysCurrent, kernelCriteriaMapCurrent); systemDetails = rhnSystemDetailsRepository.findRhnSystemDetailsByInstanceId(kernelVersion .getInstanceId()); if (systemDetails != null) { systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setIsKernelCompliant(isKernelComplaint); systemDetails.setModifiedDate(new Date()); systemDetails.setUserName("webservice"); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Kernel Version Updated Successfully!!!"); response.put(STATUS, true); return response; } else { String instanceIdSearchQuery = "{\"query\":{\"bool\":{\"must\":[{\"term\":{\"latest\":{\"value\":\"true\"}}},{\"term\":{\"instanceid.keyword\":{\"value\":\"" + kernelVersion.getInstanceId() + "\"}}}]}}}"; StringBuilder urlToQueryinstanceId = new StringBuilder(esUrl).append("/").append("aws_ec2/ec2") .append("/").append(UNDERSCORE_COUNT); String instanceDetails = PacHttpUtils.doHttpPost(urlToQueryinstanceId.toString(), instanceIdSearchQuery); Gson serializer = new GsonBuilder().create(); Map<String, Object> instanceDetailsMap = (Map<String, Object>) serializer.fromJson(instanceDetails, Object.class); double count = (double) instanceDetailsMap.get(COUNT); if (count >= 1) { systemDetails = new RhnSystemDetails(); systemDetails.setGroupId(0L); systemDetails.setCompanyId(0L); systemDetails.setUserId(0L); systemDetails.setUserName("webservice"); systemDetails.setCreateDate(new Date()); systemDetails.setModifiedDate(new Date()); systemDetails.setSystemId(0); systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setInstanceId(kernelVersion.getInstanceId()); systemDetails.setLastCheckedIn(null); systemDetails.setOs(""); systemDetails.setIsKernelCompliant(isKernelComplaint); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Successfully added new Kernel Version for the InstanceId!!!"); response.put(STATUS, true); return response; } else { response.put(MESSAGE_KEY, "InstanceId not Found!!!"); response.put(STATUS, false); return response; } } } else { response.put(MESSAGE_KEY, "Kernel Version or InstanceId cannot be null!!!"); response.put(STATUS, false); return response; } } catch (Exception exception) { logger.error(exception); response.put(MESSAGE_KEY, "Unexpected Error Occurred!!!"); response.put(STATUS, false); return response; } }  }
ComplianceRepositoryImpl implements ComplianceRepository, Constants { @SuppressWarnings("unchecked") @Override public Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion) { Map<String, Object> response = Maps.newHashMap(); RhnSystemDetails systemDetails = null; Map<String, String> kernelCriteriaMapCurrent = buildCriteriaMap(getCurrentQuarterCriteriaKey()); Set<String> kernelCriteriaMapkeysCurrent = kernelCriteriaMapCurrent.keySet(); try { if ((kernelVersion.getInstanceId() != null && !"".equals(kernelVersion.getInstanceId())) && (kernelVersion.getKernelVersionId() != null && !"".equals(kernelVersion.getKernelVersionId()))) { Boolean isKernelComplaint = isCompliant(kernelVersion.getKernelVersionId(), kernelCriteriaMapkeysCurrent, kernelCriteriaMapCurrent); systemDetails = rhnSystemDetailsRepository.findRhnSystemDetailsByInstanceId(kernelVersion .getInstanceId()); if (systemDetails != null) { systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setIsKernelCompliant(isKernelComplaint); systemDetails.setModifiedDate(new Date()); systemDetails.setUserName("webservice"); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Kernel Version Updated Successfully!!!"); response.put(STATUS, true); return response; } else { String instanceIdSearchQuery = "{\"query\":{\"bool\":{\"must\":[{\"term\":{\"latest\":{\"value\":\"true\"}}},{\"term\":{\"instanceid.keyword\":{\"value\":\"" + kernelVersion.getInstanceId() + "\"}}}]}}}"; StringBuilder urlToQueryinstanceId = new StringBuilder(esUrl).append("/").append("aws_ec2/ec2") .append("/").append(UNDERSCORE_COUNT); String instanceDetails = PacHttpUtils.doHttpPost(urlToQueryinstanceId.toString(), instanceIdSearchQuery); Gson serializer = new GsonBuilder().create(); Map<String, Object> instanceDetailsMap = (Map<String, Object>) serializer.fromJson(instanceDetails, Object.class); double count = (double) instanceDetailsMap.get(COUNT); if (count >= 1) { systemDetails = new RhnSystemDetails(); systemDetails.setGroupId(0L); systemDetails.setCompanyId(0L); systemDetails.setUserId(0L); systemDetails.setUserName("webservice"); systemDetails.setCreateDate(new Date()); systemDetails.setModifiedDate(new Date()); systemDetails.setSystemId(0); systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setInstanceId(kernelVersion.getInstanceId()); systemDetails.setLastCheckedIn(null); systemDetails.setOs(""); systemDetails.setIsKernelCompliant(isKernelComplaint); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Successfully added new Kernel Version for the InstanceId!!!"); response.put(STATUS, true); return response; } else { response.put(MESSAGE_KEY, "InstanceId not Found!!!"); response.put(STATUS, false); return response; } } } else { response.put(MESSAGE_KEY, "Kernel Version or InstanceId cannot be null!!!"); response.put(STATUS, false); return response; } } catch (Exception exception) { logger.error(exception); response.put(MESSAGE_KEY, "Unexpected Error Occurred!!!"); response.put(STATUS, false); return response; } }  long getIssuesCount(String assetGroup, String ruleId, String domain); @SuppressWarnings("rawtypes") ResponseWithOrder getIssuesFromES(Request request); @SuppressWarnings("rawtypes") Map<String, Long> getTagging(String assetGroup, String targetType); Map<String, Long> getCertificates(String assetGroup); @SuppressWarnings("rawtypes") List<Map<String, Object>> getRecommendations(String assetGroup, String targetType); Long getTotalAssetCountForAnytargetType(String assetGroup, String targetType); List<Map<String, Object>> getResourceDetailsFromES(String assetGroup, String resourceId); List<LinkedHashMap<String, Object>> getIssueAuditLog(String annotationId, String targetType, int from,
            int size, String searchText); Long getIssueAuditLogCount(String annotationId, String targetType); Map<String, Long> getRulesFromES(String assetGroup); @Override Boolean exemptAndUpdateIssueDetails(IssueResponse issueException); @Override Boolean closeIssuesByRule(RuleDetails ruleDetails); @Override Boolean revokeAndUpdateIssueDetails(String issueId); @Override List<Map<String, Object>> getExemptedIssueDetails(String issueId); @Override List<Map<String, Object>> getOpenIssueDetails(final String issueId); List<Map<String, Object>> getRuleIdWithDisplayNameQuery(String targetType); List<Map<String, Object>> getRuleIDsForTargetType(String targetType); List<Map<String, Object>> getRuleIdDetails(String ruleId); @Override List<Object> getRuleIds(String targetType); @SuppressWarnings("rawtypes") Map<String, Long> getNonCompliancePolicyByEsWithAssetGroup(String assetGroup, String searchText,
            Map<String, String> filters, int from, int size, String targetTypes); String getTargetTypeForAG(String assetGroup, String domain); List<Map<String, Object>> getRulesLastScanDate(); String getScanDate(String ruleId, Map<String, String> rulidwithScanDate); String getRuleCategory(Object ruleId, Map<String, String> ruleIdwithruleParamsMap); JsonArray getRuleDetailsByApplicationFromES(String assetGroup, String ruleId, String searchText); Map<String, Long> getAllApplicationsAssetCountForTargetType(String assetGroup, String targetType); List<Map<String, Object>> getTargetTypeByRuleId(String ruleId); Long getTotalAssetCountForEnvironment(String assetGroup, String application, String environment,
            String targetType); JsonArray getRuleDetailsByEnvironmentFromES(String assetGroup, String ruleId, String application,
            String searchText,String targetType); JsonArray getEventsProcessedFromEs(); List<Map<String, Object>> getRuleDescriptionFromDb(String ruleId); List<Map<String, Object>> getKernelComplianceByInstanceIdFromDb(String instanceId); String fetchSystemConfiguration(final String keyname); @SuppressWarnings("unchecked") @Override Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion); Map<String, Object> getRuleCategoryWeightagefromDB(String domain); @SuppressWarnings("rawtypes") Map<String, Object> getTaggingByAG(String assetGroup, String targetTypes, String application); @SuppressWarnings("rawtypes") Map<String, Object> getPolicyViolationDetailsByIssueId(String assetGroup, String issueId); Map<String, Long> getPatchableAssetsByApplication(String assetGroup, String application, String resourceType); List<Map<String, Object>> getRuleIdWithDisplayNameWithRuleCategoryQuery(String targetType,
            String ruleCategory); Long getPatchabeAssetsCount(String assetGroup, String targetType); Long getUnpatchedAssetsCount(String assetGroup, String targetType, String application); Map<String, Object> formatUnpatchedMustFilter(String targetType, String ruleId); Map<String, Long> getRulesDistribution(String assetGroup, String domain, List<Object> rules,
            String aggsFiltername); Map<String, Object> getRuleCategoryPercentage(Map<String, Long> ruleCategoryDistribution, Long totalIssues); Long getInstanceCountForQualys(String assetGroup, String apiType, String application, String environment,
			String resourceType); Map<String, Long> getInstanceCountForQualysByAppsOrEnv(String assetGroup, String apiType, String application,
			String environment, String resourceType); @Override IssueExceptionResponse exemptAndUpdateMultipleIssueDetails(IssuesException issuesException); @Override IssueExceptionResponse revokeAndUpdateMultipleIssueDetails(List<String> issueIds); String createESDoc(Map<String, ?> doc); Response invokeAPI(String method, String endpoint, String payLoad); Map<String,Long> getTotalAssetCountByEnvironment(String assetGroup, String application,String targetType); List<Map<String, String>> getDataSourceForTargetTypeForAG(String assetGroup, String domain,
			String targetType); Map<String, Long> getTotalAssetCount(String assetGroup, String domain, String application, String type); @Override Map<String, Integer> getExemptedAssetsCountByRule(String assetGroup, String application, String type); Long getPatchabeAssetsCount(String assetGroup, String targetType, String application, String environment,
			String searchText); }
ComplianceRepositoryImpl implements ComplianceRepository, Constants { @SuppressWarnings("unchecked") @Override public Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion) { Map<String, Object> response = Maps.newHashMap(); RhnSystemDetails systemDetails = null; Map<String, String> kernelCriteriaMapCurrent = buildCriteriaMap(getCurrentQuarterCriteriaKey()); Set<String> kernelCriteriaMapkeysCurrent = kernelCriteriaMapCurrent.keySet(); try { if ((kernelVersion.getInstanceId() != null && !"".equals(kernelVersion.getInstanceId())) && (kernelVersion.getKernelVersionId() != null && !"".equals(kernelVersion.getKernelVersionId()))) { Boolean isKernelComplaint = isCompliant(kernelVersion.getKernelVersionId(), kernelCriteriaMapkeysCurrent, kernelCriteriaMapCurrent); systemDetails = rhnSystemDetailsRepository.findRhnSystemDetailsByInstanceId(kernelVersion .getInstanceId()); if (systemDetails != null) { systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setIsKernelCompliant(isKernelComplaint); systemDetails.setModifiedDate(new Date()); systemDetails.setUserName("webservice"); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Kernel Version Updated Successfully!!!"); response.put(STATUS, true); return response; } else { String instanceIdSearchQuery = "{\"query\":{\"bool\":{\"must\":[{\"term\":{\"latest\":{\"value\":\"true\"}}},{\"term\":{\"instanceid.keyword\":{\"value\":\"" + kernelVersion.getInstanceId() + "\"}}}]}}}"; StringBuilder urlToQueryinstanceId = new StringBuilder(esUrl).append("/").append("aws_ec2/ec2") .append("/").append(UNDERSCORE_COUNT); String instanceDetails = PacHttpUtils.doHttpPost(urlToQueryinstanceId.toString(), instanceIdSearchQuery); Gson serializer = new GsonBuilder().create(); Map<String, Object> instanceDetailsMap = (Map<String, Object>) serializer.fromJson(instanceDetails, Object.class); double count = (double) instanceDetailsMap.get(COUNT); if (count >= 1) { systemDetails = new RhnSystemDetails(); systemDetails.setGroupId(0L); systemDetails.setCompanyId(0L); systemDetails.setUserId(0L); systemDetails.setUserName("webservice"); systemDetails.setCreateDate(new Date()); systemDetails.setModifiedDate(new Date()); systemDetails.setSystemId(0); systemDetails.setKernelVersion(kernelVersion.getKernelVersionId()); systemDetails.setInstanceId(kernelVersion.getInstanceId()); systemDetails.setLastCheckedIn(null); systemDetails.setOs(""); systemDetails.setIsKernelCompliant(isKernelComplaint); rhnSystemDetailsRepository.save(systemDetails); response.put(MESSAGE_KEY, "Successfully added new Kernel Version for the InstanceId!!!"); response.put(STATUS, true); return response; } else { response.put(MESSAGE_KEY, "InstanceId not Found!!!"); response.put(STATUS, false); return response; } } } else { response.put(MESSAGE_KEY, "Kernel Version or InstanceId cannot be null!!!"); response.put(STATUS, false); return response; } } catch (Exception exception) { logger.error(exception); response.put(MESSAGE_KEY, "Unexpected Error Occurred!!!"); response.put(STATUS, false); return response; } }  long getIssuesCount(String assetGroup, String ruleId, String domain); @SuppressWarnings("rawtypes") ResponseWithOrder getIssuesFromES(Request request); @SuppressWarnings("rawtypes") Map<String, Long> getTagging(String assetGroup, String targetType); Map<String, Long> getCertificates(String assetGroup); @SuppressWarnings("rawtypes") List<Map<String, Object>> getRecommendations(String assetGroup, String targetType); Long getTotalAssetCountForAnytargetType(String assetGroup, String targetType); List<Map<String, Object>> getResourceDetailsFromES(String assetGroup, String resourceId); List<LinkedHashMap<String, Object>> getIssueAuditLog(String annotationId, String targetType, int from,
            int size, String searchText); Long getIssueAuditLogCount(String annotationId, String targetType); Map<String, Long> getRulesFromES(String assetGroup); @Override Boolean exemptAndUpdateIssueDetails(IssueResponse issueException); @Override Boolean closeIssuesByRule(RuleDetails ruleDetails); @Override Boolean revokeAndUpdateIssueDetails(String issueId); @Override List<Map<String, Object>> getExemptedIssueDetails(String issueId); @Override List<Map<String, Object>> getOpenIssueDetails(final String issueId); List<Map<String, Object>> getRuleIdWithDisplayNameQuery(String targetType); List<Map<String, Object>> getRuleIDsForTargetType(String targetType); List<Map<String, Object>> getRuleIdDetails(String ruleId); @Override List<Object> getRuleIds(String targetType); @SuppressWarnings("rawtypes") Map<String, Long> getNonCompliancePolicyByEsWithAssetGroup(String assetGroup, String searchText,
            Map<String, String> filters, int from, int size, String targetTypes); String getTargetTypeForAG(String assetGroup, String domain); List<Map<String, Object>> getRulesLastScanDate(); String getScanDate(String ruleId, Map<String, String> rulidwithScanDate); String getRuleCategory(Object ruleId, Map<String, String> ruleIdwithruleParamsMap); JsonArray getRuleDetailsByApplicationFromES(String assetGroup, String ruleId, String searchText); Map<String, Long> getAllApplicationsAssetCountForTargetType(String assetGroup, String targetType); List<Map<String, Object>> getTargetTypeByRuleId(String ruleId); Long getTotalAssetCountForEnvironment(String assetGroup, String application, String environment,
            String targetType); JsonArray getRuleDetailsByEnvironmentFromES(String assetGroup, String ruleId, String application,
            String searchText,String targetType); JsonArray getEventsProcessedFromEs(); List<Map<String, Object>> getRuleDescriptionFromDb(String ruleId); List<Map<String, Object>> getKernelComplianceByInstanceIdFromDb(String instanceId); String fetchSystemConfiguration(final String keyname); @SuppressWarnings("unchecked") @Override Map<String, Object> updateKernelVersion(final KernelVersion kernelVersion); Map<String, Object> getRuleCategoryWeightagefromDB(String domain); @SuppressWarnings("rawtypes") Map<String, Object> getTaggingByAG(String assetGroup, String targetTypes, String application); @SuppressWarnings("rawtypes") Map<String, Object> getPolicyViolationDetailsByIssueId(String assetGroup, String issueId); Map<String, Long> getPatchableAssetsByApplication(String assetGroup, String application, String resourceType); List<Map<String, Object>> getRuleIdWithDisplayNameWithRuleCategoryQuery(String targetType,
            String ruleCategory); Long getPatchabeAssetsCount(String assetGroup, String targetType); Long getUnpatchedAssetsCount(String assetGroup, String targetType, String application); Map<String, Object> formatUnpatchedMustFilter(String targetType, String ruleId); Map<String, Long> getRulesDistribution(String assetGroup, String domain, List<Object> rules,
            String aggsFiltername); Map<String, Object> getRuleCategoryPercentage(Map<String, Long> ruleCategoryDistribution, Long totalIssues); Long getInstanceCountForQualys(String assetGroup, String apiType, String application, String environment,
			String resourceType); Map<String, Long> getInstanceCountForQualysByAppsOrEnv(String assetGroup, String apiType, String application,
			String environment, String resourceType); @Override IssueExceptionResponse exemptAndUpdateMultipleIssueDetails(IssuesException issuesException); @Override IssueExceptionResponse revokeAndUpdateMultipleIssueDetails(List<String> issueIds); String createESDoc(Map<String, ?> doc); Response invokeAPI(String method, String endpoint, String payLoad); Map<String,Long> getTotalAssetCountByEnvironment(String assetGroup, String application,String targetType); List<Map<String, String>> getDataSourceForTargetTypeForAG(String assetGroup, String domain,
			String targetType); Map<String, Long> getTotalAssetCount(String assetGroup, String domain, String application, String type); @Override Map<String, Integer> getExemptedAssetsCountByRule(String assetGroup, String application, String type); Long getPatchabeAssetsCount(String assetGroup, String targetType, String application, String environment,
			String searchText);  }