Search in sources :

Example 1 with ReceiveSalesResponseRequest

use of eu.europa.ec.fisheries.schema.exchange.module.v1.ReceiveSalesResponseRequest in project UVMS-ExchangeModule-APP by UnionVMS.

the class ExchangeEventIncomingServiceBean method receiveSalesResponse.

@Override
public void receiveSalesResponse(@Observes @ReceiveSalesResponseEvent ExchangeMessageEvent event) {
    try {
        ReceiveSalesResponseRequest request = JAXBMarshaller.unmarshallTextMessage(event.getJmsMessage(), ReceiveSalesResponseRequest.class);
        String response = request.getResponse();
        ExchangeLogType log = exchangeLog.log(request, LogType.RECEIVE_SALES_RESPONSE, ExchangeLogStatusTypeType.ISSUED, TypeRefType.SALES_RESPONSE, response, true);
        forwardToRules(RulesModuleRequestMapper.createReceiveSalesResponseRequest(response, log.getGuid(), request.getSenderOrReceiver()));
    } catch (ExchangeModelMarshallException e) {
        firePluginFault(event, "Error when receiving a Sales response from FLUX", e);
    } catch (ExchangeLogException e) {
        firePluginFault(event, "Could not log the incoming sales response.", e);
    } catch (RulesModelMarshallException e) {
        firePluginFault(event, "Could not create a request for the Rules module for an incoming sales response.", e);
    }
}
Also used : ExchangeModelMarshallException(eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelMarshallException) ReceiveSalesResponseRequest(eu.europa.ec.fisheries.schema.exchange.module.v1.ReceiveSalesResponseRequest) RulesModelMarshallException(eu.europa.ec.fisheries.uvms.rules.model.exception.RulesModelMarshallException) ExchangeLogType(eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogType) ExchangeLogException(eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException)

Aggregations

ReceiveSalesResponseRequest (eu.europa.ec.fisheries.schema.exchange.module.v1.ReceiveSalesResponseRequest)1 ExchangeLogType (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogType)1 ExchangeModelMarshallException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelMarshallException)1 ExchangeLogException (eu.europa.ec.fisheries.uvms.exchange.service.exception.ExchangeLogException)1 RulesModelMarshallException (eu.europa.ec.fisheries.uvms.rules.model.exception.RulesModelMarshallException)1