class PatchingRepositoryImpl implements PatchingRepository, Constants {

    @Override
    public Map<String, Object> getDirectorsAndExcutiveSponsers(String appTag,
            String appType) throws DataException {

        String responseJson = null;
        String director = null;
        String executiveSponsor = null;
        String ipprotocol = null;
        JsonParser jsonParser;
        JsonObject resultJson;
        Map<String, Object> dirAndExecMap = new HashMap<>();
        StringBuilder urlToQueryBuffer = new StringBuilder(esUrl).append("/")
                .append("aws_apps").append("/").append("apps").append("/")
                .append(SEARCH);
        StringBuilder requestBody = new StringBuilder(
                "{\"size\":10000,\"query\":{\"bool\":{\"must\":[{\"match\":{\"_appType\":\""
                        + appType + "\"}},{\"match\":{\"appTag.keyword\":\""
                        + appTag + "\"}}]}}}");
        try {
            responseJson = PacHttpUtils.doHttpPost(urlToQueryBuffer.toString(),
                    requestBody.toString());
        } catch(Exception e){
            throw new DataException(e);
        }
        jsonParser = new JsonParser();
        resultJson = (JsonObject) jsonParser.parse(responseJson);

        JsonObject hitsJson = (JsonObject) jsonParser.parse(resultJson.get(
                "hits").toString());
        JsonArray hitsArray = hitsJson.getAsJsonArray("hits");
        for (int i = 0; i < hitsArray.size(); i++) {
            JsonObject source = hitsArray.get(i).getAsJsonObject()
                    .get("_source").getAsJsonObject();
            if (null!=source.get(DIRECTOR)&&!source.get(DIRECTOR).isJsonNull()) {
                director = source.get(DIRECTOR).getAsString();
            } else {
                director = "";
            }
            if (null!=source.get(EXCUTIVE_SPONSOR)&&!source.get(EXCUTIVE_SPONSOR).isJsonNull()) {
                executiveSponsor = source.get(EXCUTIVE_SPONSOR).getAsString();
            } else {
                executiveSponsor = "";
            }
            logger.info(ipprotocol);
            dirAndExecMap.put(DIRECTOR, director);
            dirAndExecMap.put(EXCUTIVE_SPONSOR, executiveSponsor);
        }
        return dirAndExecMap;

    }

}