class ComplianceController implements Constants {

    @RequestMapping(path = "/v1/policydetailsbyenvironment", method = RequestMethod.GET)
    
    public ResponseEntity<Object> getpolicydetailsbyEnvironment(@RequestParam("ag") String assetGroup,
            @RequestParam("application") String application, @RequestParam("ruleId") String ruleId,
            @RequestParam(name = "searchText", required = false) String searchText) {

        if (Strings.isNullOrEmpty(assetGroup) || Strings.isNullOrEmpty(application) || Strings.isNullOrEmpty(ruleId)) {
            return ResponseUtils.buildFailureResponse(new Exception("assetgroup/application/ruleId is mandatory"));
        }
        ResponseData response = null;
        try {
            response = new ResponseData(complianceService.getRuleDetailsbyEnvironment(assetGroup, ruleId, application,
                    searchText));

        } catch (ServiceException e) {
           return complianceService.formatException(e);
        }
        return ResponseUtils.buildSucessResponse(response);
    }

}