use of eu.europa.ec.fisheries.schema.exchange.module.v1.LogRefIdByTypeExistsRequest in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeEventIncomingServiceBean method logRefIdByTypeExists.
@Override
public void logRefIdByTypeExists(@Observes @LogRefIdByTypeExists ExchangeMessageEvent event) {
try {
LogRefIdByTypeExistsRequest request = unMarshallMessage(event.getJmsMessage().getText(), LogRefIdByTypeExistsRequest.class);
String refGuid = request.getRefGuid();
List<TypeRefType> refTypes = request.getRefTypes();
List<ExchangeLogStatusType> exchangeStatusHistoryList = exchangeLogModel.getExchangeLogsStatusHistories(refGuid, refTypes);
LogRefIdByTypeExistsResponse response = new LogRefIdByTypeExistsResponse();
if (CollectionUtils.isNotEmpty(exchangeStatusHistoryList)) {
response.setRefGuid(exchangeStatusHistoryList.get(0).getTypeRef().getRefGuid());
}
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