class AssetGroupStatsCollector implements Constants {

    public  void uploadAssetGroupRuleCompliance(Map<String, List<String>> assetGroups) throws Exception {
        log.info("    Start Collecing Rule  compliance");
        List<Map<String, Object>> docs = new ArrayList<>();
        assetGroups.entrySet().stream().forEach(entry -> {
            String ag = entry.getKey();
            List<String> domains = entry.getValue();
            List<Map<String, Object>> docList = new ArrayList<>();
            try {
                docList = AssetGroupUtil.fetchRuleComplianceInfo(COMP_API_URL, ag, domains,getToken());
            } catch (Exception e) {
                log.error("Exception in uploadAssetGroupRuleCompliance" , e);
                Map<String,String> errorMap = new HashMap<>();
                errorMap.put(ERROR, "Exception in uploadAssetGroupRuleCompliance for Asset Group"+ag);
                errorMap.put(ERROR_TYPE, WARN);
                errorMap.put(EXCEPTION, e.getMessage());
                synchronized(errorList){
                    errorList.add(errorMap);
                }
            }
            docList.parallelStream().forEach(doc -> {
                doc.put("ag", ag);
                doc.put("date", CURR_DATE);
                doc.put("@id", Util.getUniqueID(ag + doc.get(DOMAIN) + doc.get("ruleId") + CURR_DATE));
            });
            docs.addAll(docList);
        });

        ESManager.uploadData(AG_STATS, "issuecompliance", docs, "@id", false);
        log.info("    End Collecing Rule  compliance");
    }

}