class FilterServiceImpl implements FilterService, Constants {

    public List<Map<String, Object>> getRules(String assetGroup, String domain)
            throws ServiceException {
        List<Map<String, Object>> ruleDetList = new ArrayList<>();
        String ttypes = complianceRepository.getTargetTypeForAG(assetGroup,
                domain);
        List<Map<String, Object>> ruleIdsFromDb;
        try{
        ruleIdsFromDb = complianceRepository
                .getRuleIdWithDisplayNameQuery(ttypes);
      }catch(DataException e){
          throw new ServiceException(e);
      }
        noDataFoundCheck(emptyAssetCount, ruleIdsFromDb);
        ruleIdsFromDb.parallelStream().forEach(policy -> {
            Map<String, Object> ruleMap = new HashMap<>();
            String ruleId = policy.get(RULEID).toString();
            String ruleName = policy.get(RULE_DISPAY_NAME).toString();

            ruleMap.put(NAME, ruleName);
            ruleMap.put(ID, ruleId);
            synchronized (ruleDetList) {
                ruleDetList.add(ruleMap);
            }

        });
        if(ruleDetList.isEmpty()){
            throw new ServiceException(NO_DATA_FOUND);
        }
        return ruleDetList;
    }

}