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