Search in sources :

Example 6 with MessageException

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

Example 7 with MessageException

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);
    }
}
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)

Example 8 with MessageException

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);
    }
}
Also used : FishingTripRequest(eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingTripRequest) FishingTripResponse(eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingTripResponse) 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) JMSException(javax.jms.JMSException)

Example 9 with MessageException

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);
    }
}
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) FACatchSummaryReportRequest(eu.europa.ec.fisheries.uvms.activity.model.schemas.FACatchSummaryReportRequest) JMSException(javax.jms.JMSException) FACatchSummaryReportResponse(eu.europa.ec.fisheries.uvms.activity.model.schemas.FACatchSummaryReportResponse)

Example 10 with MessageException

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);
    }
}
Also used : MessageException(eu.europa.ec.fisheries.uvms.commons.message.api.MessageException) JAXBException(javax.xml.bind.JAXBException) JMSException(javax.jms.JMSException) ActivityModuleException(eu.europa.ec.fisheries.ers.service.exception.ActivityModuleException) TextMessage(javax.jms.TextMessage)

Aggregations

MessageException (eu.europa.ec.fisheries.uvms.commons.message.api.MessageException)16 TextMessage (javax.jms.TextMessage)10 ServiceException (eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException)9 JMSException (javax.jms.JMSException)8 ActivityModelMarshallException (eu.europa.ec.fisheries.uvms.activity.model.exception.ActivityModelMarshallException)7 ActivityModuleException (eu.europa.ec.fisheries.ers.service.exception.ActivityModuleException)3 AssetModelMapperException (eu.europa.ec.fisheries.uvms.asset.model.exception.AssetModelMapperException)3 RulesModelMapperException (eu.europa.ec.fisheries.uvms.rules.model.exception.RulesModelMapperException)2 SpatialModelMapperException (eu.europa.ec.fisheries.uvms.spatial.model.exception.SpatialModelMapperException)2 SubscriptionParameter (eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionParameter)2 SubscriptionPermissionResponse (eu.europa.ec.fisheries.wsdl.subscription.module.SubscriptionPermissionResponse)2 ArrayList (java.util.ArrayList)2 JAXBException (javax.xml.bind.JAXBException)2 FLUXFAQueryMessage (un.unece.uncefact.data.standard.fluxfaquerymessage._3.FLUXFAQueryMessage)2 ExchangeLogWithValidationResults (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogWithValidationResults)1 MovementMapResponseType (eu.europa.ec.fisheries.schema.movement.search.v1.MovementMapResponseType)1 MovementQuery (eu.europa.ec.fisheries.schema.movement.search.v1.MovementQuery)1 MovementType (eu.europa.ec.fisheries.schema.movement.v1.MovementType)1 ValidationMessageType (eu.europa.ec.fisheries.schema.rules.rule.v1.ValidationMessageType)1 ValidationMessageTypeResponse (eu.europa.ec.fisheries.schema.rules.rule.v1.ValidationMessageTypeResponse)1