class CertificateController implements Constants {

    @RequestMapping(path = "/v1/certificates/expirybyapplication", method = RequestMethod.GET)
    
    public ResponseEntity<Object> getCerticatesExpiryByApplication(
            @RequestParam(name = "ag", required = true) String assetGroup)
            throws ServiceException {

        if (Strings.isNullOrEmpty(assetGroup)) {
            return ResponseUtils.buildFailureResponse(new ServiceException(
                    ASSET_MANDATORY));
        }
        DitributionDTO response;
        try {
            response = new DitributionDTO(
                    certificateService
                            .getCerticatesExpiryByApplication(assetGroup));
        } catch (ServiceException e) {
            LOGGER.error(EXE_CERT_EXPIRY,e);
            return ResponseUtils.buildFailureResponse(e);
        }
        return ResponseUtils.buildSucessResponse(response);
    }

}