class VulnerabilityRepository implements Constants {

	public long getTotalQualysHostCount(String index, String vulnType) throws DataException {
		StringBuilder urlToQuery = new StringBuilder(esUrl).append("/").append(index).append("/").append(vulnType)
				.append("/").append(UNDERSCORE_COUNT);
		StringBuilder requestBody = new StringBuilder(
				"{\"query\":{\"bool\":{\"must\":[{\"match\":{\"latest\":\"true\"}},{\"has_child\":{\"type\":\"qualysinfo\",\"query\":{\"bool\":{\"must\":[{\"match\":{\"latest\":\"true\"}}]}}}}]}}}");
		try {
			String responseDetails = PacHttpUtils.doHttpPost(urlToQuery.toString(), requestBody.toString());
			JsonObject responseObj = (JsonObject) new JsonParser().parse(responseDetails);
			return (long) responseObj.get("count").getAsLong();
		} catch (Exception e) {
			LOGGER.error("Error in getTotalQualysAssetCount", e);
			throw new DataException(e);
		}
	}

}