use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FACatchSummaryReportResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchReportServiceBean method getFACatchSummaryReportResponse.
/**
* This method is used to create Catch Details page from Run Report.
* So, To display summary of catches, we need to consider all fishing Activity filters as well as aggregation factors specified by user .
* Aggregation factors could be dynamically selected by user like veesel,period,area etc.
* @param query
* @return
* @throws ServiceException
*/
@Override
public FACatchSummaryReportResponse getFACatchSummaryReportResponse(FishingActivityQuery query) throws ServiceException {
log.debug("FACatchSummaryReportResponse creation starts");
// get processed information in the form of DTO
FACatchSummaryDTO faCatchSummaryDTO = getCatchSummaryReport(query, false);
log.debug("FACatchSummaryDTO created");
// We can not transfter DTO as it is over JMS because of JAVA maps.so, Map DTO to the type transferrable over JMS
FACatchSummaryHelper faCatchSummaryHelper = FACatchSummaryHelperFactory.getFACatchSummaryHelper(FACatchSummaryHelperFactory.STANDARD);
// Create response object for JMS
FACatchSummaryReportResponse faCatchSummaryReportResponse = new FACatchSummaryReportResponse();
faCatchSummaryReportResponse.setSummaryRecords(faCatchSummaryHelper.buildFACatchSummaryRecordList(faCatchSummaryDTO.getRecordDTOs()));
faCatchSummaryReportResponse.setTotal(FACatchSummaryMapper.INSTANCE.mapToSummaryTable(faCatchSummaryDTO.getTotal()));
log.debug("SummaryTable XML Schema response---->" + FACatchSummaryHelper.printJsonstructure(faCatchSummaryReportResponse));
return faCatchSummaryReportResponse;
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FACatchSummaryReportResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method getFACatchSummaryReport.
@Override
public void getFACatchSummaryReport(@Observes @GetFACatchSummaryReportEvent EventMessage message) {
log.info(GOT_JMS_INSIDE_ACTIVITY_TO_GET + "FACatchSummaryReport:");
try {
log.debug("JMS Incoming text message: {}", message.getJmsMessage().getText());
FACatchSummaryReportRequest baseRequest = JAXBMarshaller.unmarshallTextMessage(message.getJmsMessage(), FACatchSummaryReportRequest.class);
FACatchSummaryReportResponse faCatchSummaryReportResponse = faCatchReportService.getFACatchSummaryReportResponse(FishingActivityRequestMapper.buildFishingActivityQueryFromRequest(baseRequest));
String response = JAXBMarshaller.marshallJaxBObjectToString(faCatchSummaryReportResponse);
producer.sendResponseMessageToSender(message.getJmsMessage(), response);
} catch (ActivityModelMarshallException | JMSException | ServiceException | MessageException e) {
sendError(message, e);
}
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FACatchSummaryReportResponse 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);
}
Aggregations