use of javax.interceptor.Interceptors in project UVMS-ActivityModule-APP by UnionVMS.
the class FACatchResource method getFACatchSummaryReport.
@POST
@Path("/summary")
@Consumes(value = { MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON)
@Interceptors(ActivityExceptionInterceptor.class)
@IUserRoleInterceptor(requiredUserRole = { ActivityFeaturesEnum.LIST_ACTIVITY_REPORTS })
public Response getFACatchSummaryReport(@Context HttpServletRequest request, @HeaderParam("scopeName") String scopeName, @HeaderParam("roleName") String roleName, FishingActivityQuery fishingActivityQuery) throws ServiceException {
log.info("Query Received to getFACatchSummaryReport. " + fishingActivityQuery);
if (fishingActivityQuery == null) {
return createErrorResponse("Query to find list is null.");
}
FACatchSummaryReportResponse faCatchSummaryReportResponse = reportService.getFACatchSummaryReportResponse(fishingActivityQuery);
log.info("Successfully processed");
return createSuccessResponse(faCatchSummaryReportResponse);
}
use of javax.interceptor.Interceptors in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityResource method listActivityReportsByQuery.
@POST
@Path("/list")
@Consumes(value = { MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON)
@Interceptors(ActivityExceptionInterceptor.class)
@IUserRoleInterceptor(requiredUserRole = { ActivityFeaturesEnum.LIST_ACTIVITY_REPORTS })
public Response listActivityReportsByQuery(@Context HttpServletRequest request, @HeaderParam("scopeName") String scopeName, @HeaderParam("roleName") String roleName, FishingActivityQuery fishingActivityQuery) throws ServiceException {
log.info("Query Received to search Fishing Activity Reports. " + fishingActivityQuery);
if (fishingActivityQuery == null) {
return createErrorResponse("Query to find list is null.");
}
String username = request.getRemoteUser();
List<Dataset> datasets = usmService.getDatasetsPerCategory(USMSpatial.USM_DATASET_CATEGORY, username, USMSpatial.APPLICATION_NAME, roleName, scopeName);
log.info("Successful retrieved");
FilterFishingActivityReportResultDTO resultDTO = activityService.getFishingActivityListByQuery(fishingActivityQuery, datasets);
return createSuccessPaginatedResponse(resultDTO.getResultList(), resultDTO.getTotalCountOfRecords());
}
Aggregations