Search in sources :

Example 1 with GetServiceListRequest

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

the class ExchangeEventIncomingServiceBean method getPluginListByTypes.

@Override
public void getPluginListByTypes(@Observes @PluginConfigEvent ExchangeMessageEvent message) {
    try {
        TextMessage jmsMessage = message.getJmsMessage();
        GetServiceListRequest request = JAXBMarshaller.unmarshallTextMessage(jmsMessage, GetServiceListRequest.class);
        log.info("Get plugin config LIST_SERVICE:{}", request);
        List<ServiceResponseType> serviceList = exchangeService.getServiceList(request.getType());
        producer.sendModuleResponseMessage(message.getJmsMessage(), ExchangeModuleResponseMapper.mapServiceListResponse(serviceList));
    } catch (ExchangeException e) {
        log.error("[ Error when getting plugin list from source {}] {}", message, e);
        exchangeErrorEvent.fire(new ExchangeMessageEvent(message.getJmsMessage(), ExchangeModuleResponseMapper.createFaultMessage(FaultCode.EXCHANGE_MESSAGE, "Excpetion when getting service list")));
    }
}
Also used : ServiceResponseType(eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceResponseType) ExchangeException(eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeException) GetServiceListRequest(eu.europa.ec.fisheries.schema.exchange.module.v1.GetServiceListRequest) TextMessage(javax.jms.TextMessage) ExchangeMessageEvent(eu.europa.ec.fisheries.uvms.exchange.message.event.carrier.ExchangeMessageEvent)

Aggregations

GetServiceListRequest (eu.europa.ec.fisheries.schema.exchange.module.v1.GetServiceListRequest)1 ServiceResponseType (eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceResponseType)1 ExchangeMessageEvent (eu.europa.ec.fisheries.uvms.exchange.message.event.carrier.ExchangeMessageEvent)1 ExchangeException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeException)1 TextMessage (javax.jms.TextMessage)1