class ComplianceController implements Constants {

    @RequestMapping(path = "/v1/noncompliancepolicy", method = RequestMethod.POST)
    // @Cacheable(cacheNames="compliance",unless="#result.status==200")
    // commenting to performance after refacoting
    // @Cacheable(cacheNames="compliance",key="#request.key")
    
    public ResponseEntity<Object> getNonCompliancePolicyByRule(@RequestBody(required = false) Request request) {
        String assetGroup = request.getAg();

        Map<String, String> filters = request.getFilter();

        if (Strings.isNullOrEmpty(assetGroup) || MapUtils.isEmpty(filters)
                || Strings.isNullOrEmpty(filters.get(DOMAIN))) {
            return ResponseUtils.buildFailureResponse(new Exception(ASSET_GROUP_DOMAIN));
        }
        ResponseWithOrder response = null;
        try {
            response = (complianceService.getRulecompliance(request));
        } catch (ServiceException e) {
           return complianceService.formatException(e);
        }
        return ResponseUtils.buildSucessResponse(response);

    }

}