Search in sources :

Example 1 with GetFishingActivitiesForTripRequest

use of eu.europa.ec.fisheries.uvms.activity.model.schemas.GetFishingActivitiesForTripRequest 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);
    }
}
Also used : ActivityModelMarshallException(eu.europa.ec.fisheries.uvms.activity.model.exception.ActivityModelMarshallException) ServiceException(eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException) MessageException(eu.europa.ec.fisheries.uvms.commons.message.api.MessageException) GetFishingActivitiesForTripRequest(eu.europa.ec.fisheries.uvms.activity.model.schemas.GetFishingActivitiesForTripRequest) GetFishingActivitiesForTripResponse(eu.europa.ec.fisheries.uvms.activity.model.schemas.GetFishingActivitiesForTripResponse) JMSException(javax.jms.JMSException)

Aggregations

ActivityModelMarshallException (eu.europa.ec.fisheries.uvms.activity.model.exception.ActivityModelMarshallException)1 GetFishingActivitiesForTripRequest (eu.europa.ec.fisheries.uvms.activity.model.schemas.GetFishingActivitiesForTripRequest)1 GetFishingActivitiesForTripResponse (eu.europa.ec.fisheries.uvms.activity.model.schemas.GetFishingActivitiesForTripResponse)1 MessageException (eu.europa.ec.fisheries.uvms.commons.message.api.MessageException)1 ServiceException (eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException)1 JMSException (javax.jms.JMSException)1