use of eu.europa.ec.fisheries.uvms.commons.message.api.MessageException in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method getNonUniqueIdsRequest.
@Override
public void getNonUniqueIdsRequest(@Observes @GetNonUniqueIdsRequestEvent EventMessage message) {
log.info(GOT_JMS_INSIDE_ACTIVITY_TO_GET + "Non Matching Ids of different Tables : ");
try {
log.debug(message.getJmsMessage().getText());
GetNonUniqueIdsRequest getNonUniqueIdsRequest = JAXBMarshaller.unmarshallTextMessage(message.getJmsMessage(), GetNonUniqueIdsRequest.class);
GetNonUniqueIdsResponse faCatchSummaryReportResponse = matchingIdsService.getMatchingIdsResponse(getNonUniqueIdsRequest.getActivityUniquinessLists());
String response = JAXBMarshaller.marshallJaxBObjectToString(faCatchSummaryReportResponse);
producer.sendResponseMessageToSender(message.getJmsMessage(), response);
} catch (ActivityModelMarshallException | JMSException | MessageException e) {
sendError(message, e);
}
}
use of eu.europa.ec.fisheries.uvms.commons.message.api.MessageException in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method getFishingActivityForTripsRequest.
@Override
public void getFishingActivityForTripsRequest(@Observes @GetFishingActivityForTripsRequestEvent EventMessage message) {
log.info(GOT_JMS_INSIDE_ACTIVITY_TO_GET + " Fishing activities related to trips.");
try {
log.debug(message.getJmsMessage().getText());
GetFishingActivitiesForTripRequest request = JAXBMarshaller.unmarshallTextMessage(message.getJmsMessage(), GetFishingActivitiesForTripRequest.class);
GetFishingActivitiesForTripResponse response = activityServiceBean.getFaAndTripIdsFromTripIds(request.getFaAndTripIds());
String responseStr = JAXBMarshaller.marshallJaxBObjectToString(response);
producer.sendResponseMessageToSender(message.getJmsMessage(), responseStr);
} catch (ActivityModelMarshallException | JMSException | ServiceException | MessageException e) {
sendError(message, e);
}
}
use of eu.europa.ec.fisheries.uvms.commons.message.api.MessageException in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEventServiceBean method getFishingTripList.
@Override
public void getFishingTripList(@Observes @GetFishingTripListEvent EventMessage message) {
log.info(GOT_JMS_INSIDE_ACTIVITY_TO_GET + "FishingTripIds:");
try {
log.debug("JMS Incoming text message: {}", message.getJmsMessage().getText());
FishingTripRequest baseRequest = JAXBMarshaller.unmarshallTextMessage(message.getJmsMessage(), FishingTripRequest.class);
log.debug("FishingTriId Request Unmarshalled");
FishingTripResponse baseResponse = fishingTripService.filterFishingTripsForReporting(FishingActivityRequestMapper.buildFishingActivityQueryFromRequest(baseRequest));
log.debug("FishingTripResponse ::: " + FACatchSummaryHelper.printJsonstructure(baseResponse));
String response = JAXBMarshaller.marshallJaxBObjectToString(baseResponse);
log.debug("FishingTriId response marshalled");
producer.sendResponseMessageToSender(message.getJmsMessage(), response);
log.debug("Response sent back.");
} catch (ActivityModelMarshallException | JMSException | ServiceException | MessageException e) {
sendError(message, e);
}
}
use of eu.europa.ec.fisheries.uvms.commons.message.api.MessageException 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.commons.message.api.MessageException in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivitySubscriptionPermissionChecker method getPermissionFromSubscription.
public SubscriptionPermissionResponse getPermissionFromSubscription(String subscrPermissionRequest, Destination activityReplyToQueue) throws ActivityModuleException {
try {
String corrID = subscriptionProducerBean.sendModuleMessage(subscrPermissionRequest, activityReplyToQueue);
TextMessage message = activityConsumerBean.getMessage(corrID, TextMessage.class);
return SubscriptionModuleResponseMapper.mapToSubscriptionPermissionResponse(message.getText());
} catch (MessageException | JMSException | JAXBException e) {
throw new ActivityModuleException("Error while trying to check permissions from Subscription Module!", e);
}
}
Aggregations