use of eu.europa.ec.fisheries.schema.exchange.module.v1.LogIdByTypeExistsResponse in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeEventIncomingServiceBean method logIdByTypeExists.
@Override
public void logIdByTypeExists(@Observes @LogIdByTypeExists ExchangeMessageEvent event) {
try {
LogIdByTypeExistsRequest request = unMarshallMessage(event.getJmsMessage().getText(), LogIdByTypeExistsRequest.class);
String messageGuid = request.getMessageGuid();
TypeRefType refType = request.getRefType();
ExchangeLogType exchangeLogByGuid = exchangeLogModel.getExchangeLogByGuidAndType(messageGuid, refType);
LogIdByTypeExistsResponse response = new LogIdByTypeExistsResponse();
if (exchangeLogByGuid != null) {
response.setMessageGuid(exchangeLogByGuid.getGuid());
}
String responseAsString = JAXBUtils.marshallJaxBObjectToString(response);
producer.sendModuleResponseMessage(event.getJmsMessage(), responseAsString);
} catch (ExchangeModelException | JAXBException | JMSException e) {
fireExchangeFault(event, "Could not un-marshall " + LogRefIdByTypeExistsRequest.class, e);
}
}
Aggregations