use of eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeServiceBean method upsertSettings.
@Override
public ServiceResponseType upsertSettings(String serviceClassName, SettingListType settingListType, String username) throws ExchangeServiceException {
LOG.info("Upsert settings in service layer: {} {} {}", serviceClassName, settingListType, username);
try {
ServiceResponseType updatedSettings = serviceRegistryModel.updatePluginSettings(serviceClassName, settingListType, username);
sendAuditLogMessageForUpdateService(compressServiceClassName(serviceClassName), username);
return updatedSettings;
} catch (ExchangeModelException e) {
throw new ExchangeServiceException(e.getMessage());
}
}
use of eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeServiceBean method unregisterService.
/**
* {@inheritDoc}
*
* @param data
* @throws ExchangeServiceException
*/
@Override
public ServiceResponseType unregisterService(ServiceType data, String username) throws ExchangeServiceException {
LOG.info("Unregister service invoked in service layer: {} {}", data, username);
try {
ServiceResponseType serviceResponseType = serviceRegistryModel.unregisterService(data, username);
sendAuditLogMessageForUnregisterService(compressServiceClassName(serviceResponseType.getServiceClassName()), username);
return serviceResponseType;
} catch (ExchangeModelException ex) {
throw new ExchangeServiceException(ex.getMessage());
}
}
use of eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeServiceBean method updateServiceStatus.
@Override
public ServiceResponseType updateServiceStatus(String serviceClassName, StatusType status, String username) throws ExchangeServiceException {
LOG.info("Update service status invoked in service layer: {} {} {}", serviceClassName, status, username);
try {
ServiceResponseType updatedServiceStatus = serviceRegistryModel.updatePluginStatus(serviceClassName, status, username);
sendAuditLogMessageForUpdateServiceStatus(serviceClassName, status, username);
return updatedServiceStatus;
} catch (ExchangeModelException e) {
throw new ExchangeServiceException(e.getMessage());
}
}
use of eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeLogModelBean method createExchangeLog.
@Override
public ExchangeLogType createExchangeLog(ExchangeLogType log, String username) throws ExchangeModelException {
if (log == null) {
throw new InputArgumentException("No log to create");
}
if (log.getType() == null) {
throw new InputArgumentException("No type in log to create");
}
try {
ExchangeLog exchangeLog = LogMapper.toNewEntity(log, username);
ExchangeLog persistedLog = logDao.createLog(exchangeLog);
return LogMapper.toModel(persistedLog);
} catch (ExchangeDaoException ex) {
LOG.error("[ Error when creating Exchange log {} {}] {}", log, username, ex.getMessage());
throw new ExchangeModelException("Error when creating Exchange log ");
}
}
use of eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException in project UVMS-ExchangeModule-APP by UnionVMS.
the class ExchangeLogModelBean method getExchangeLogByGuidAndType.
@Override
public ExchangeLogType getExchangeLogByGuidAndType(String guid, TypeRefType typeRefType) throws ExchangeModelException {
ExchangeLogType exchangeLogType;
try {
ExchangeLog exchangeLogByGuid = logDao.getExchangeLogByGuid(guid, typeRefType);
exchangeLogType = LogMapper.toModel(exchangeLogByGuid);
} catch (Exception e) {
LOG.error("[ Error when getting exchange log by GUID. {}] {}", guid, e.getMessage());
exchangeLogType = null;
}
return exchangeLogType;
}
Aggregations