use of eu.europa.ec.fisheries.schema.exchange.module.v1.UpdatePluginSettingRequest in project UVMS-ExchangeModule-APP by UnionVMS.
the class PluginServiceBean method updatePluginSetting.
@Override
public void updatePluginSetting(@Observes @UpdatePluginSettingEvent ExchangeMessageEvent settingEvent) {
LOG.info("update plugin setting from module queue:{}", settingEvent);
try {
TextMessage jmsMessage = settingEvent.getJmsMessage();
UpdatePluginSettingRequest request = JAXBMarshaller.unmarshallTextMessage(jmsMessage, UpdatePluginSettingRequest.class);
updatePluginSetting(request.getServiceClassName(), request.getSetting(), request.getUsername());
String text = ExchangeModuleResponseMapper.mapUpdateSettingResponse(ExchangeModuleResponseMapper.mapAcknowledgeTypeOK());
producer.sendModuleResponseMessage(settingEvent.getJmsMessage(), text);
} catch (ExchangeModelMarshallException | ExchangeServiceException | ExchangeMessageException e) {
LOG.error("Couldn't unmarshall update setting request");
settingEvent.setErrorFault(ExchangeModuleResponseMapper.createFaultMessage(FaultCode.EXCHANGE_EVENT_SERVICE, "Couldn't update plugin setting"));
producer.sendModuleErrorResponseMessage(settingEvent);
}
}
Aggregations