Search in sources :

Example 1 with LogIdByTypeExistsResponse

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);
    }
}
Also used : TypeRefType(eu.europa.ec.fisheries.schema.exchange.v1.TypeRefType) LogIdByTypeExistsResponse(eu.europa.ec.fisheries.schema.exchange.module.v1.LogIdByTypeExistsResponse) ExchangeLogType(eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogType) JAXBException(javax.xml.bind.JAXBException) ExchangeModelException(eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException) JMSException(javax.jms.JMSException) LogIdByTypeExistsRequest(eu.europa.ec.fisheries.schema.exchange.module.v1.LogIdByTypeExistsRequest)

Aggregations

LogIdByTypeExistsRequest (eu.europa.ec.fisheries.schema.exchange.module.v1.LogIdByTypeExistsRequest)1 LogIdByTypeExistsResponse (eu.europa.ec.fisheries.schema.exchange.module.v1.LogIdByTypeExistsResponse)1 ExchangeLogType (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogType)1 TypeRefType (eu.europa.ec.fisheries.schema.exchange.v1.TypeRefType)1 ExchangeModelException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException)1 JMSException (javax.jms.JMSException)1 JAXBException (javax.xml.bind.JAXBException)1