class VulnerabilityRepository implements Constants {

	public long getExemptedByRuleCount(String index, String vulnType) throws DataException {
		StringBuilder urlToQuery = new StringBuilder(esUrl).append("/").append(index).append("/")
				.append(UNDERSCORE_COUNT);
		StringBuilder requestBody = new StringBuilder(
				"{\"query\":{\"bool\":{\"must\":[{\"match\":{\"issueStatus.keyword\":\"exempted\"}},{\"match\":{\"ruleId.keyword\":\"");
		if (vulnType.equals(EC2)) {
			requestBody.append(EC2_QUALYS_RULEID);
		}else if(vulnType.equals(VIRTUALMACHINE)) {
			requestBody.append(VIRTUALMACHINE_QUALYS_RULEID);
		}else {
			requestBody.append(
					"PacMan_Onprem-asset-scanned-by-qualys-API_version-1_OnpremassetscannedbyqualysAPI_onpremserver");
		}
		requestBody.append("\"}}]}}}");

		try {
			String responseDetails = PacHttpUtils.doHttpPost(urlToQuery.toString(), requestBody.toString());
			JsonObject responseObj = (JsonObject) new JsonParser().parse(responseDetails);
			return responseObj.get("count").getAsLong();
		} catch (Exception e) {
			LOGGER.error("Error in getExemptedCount", e);
			throw new DataException(e);
		}
	}

}