Search in sources :

Example 21 with ExchangeDaoException

use of eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException in project UVMS-ExchangeModule-APP by UnionVMS.

the class ServiceRegistryDaoBean method getServiceSettings.

@Override
public List<ServiceSetting> getServiceSettings(String serviceClassName) throws ExchangeDaoException {
    try {
        TypedQuery<ServiceSetting> query = em.createNamedQuery(ExchangeConstants.SETTING_FIND_BY_SERVICE, ServiceSetting.class);
        query.setParameter("serviceClassName", serviceClassName);
        return query.getResultList();
    } catch (IllegalArgumentException e) {
        LOG.error("[ Error when getting settings ] {}", e.getMessage());
        throw new ExchangeDaoException("[ Error when getting settings ] ");
    } catch (Exception e) {
        LOG.error("[ Error when getting settings ] {}", e.getMessage());
        throw new ExchangeDaoException("[ Error when getting settings ] ");
    }
}
Also used : ExchangeDaoException(eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException) EntityExistsException(javax.persistence.EntityExistsException) NoResultException(javax.persistence.NoResultException) ExchangeDaoException(eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException) NoEntityFoundException(eu.europa.ec.fisheries.uvms.exchange.exception.NoEntityFoundException) ServiceSetting(eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceSetting)

Example 22 with ExchangeDaoException

use of eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException in project UVMS-ExchangeModule-APP by UnionVMS.

the class ServiceRegistryDaoBean method getServiceCapabilities.

@Override
public List<ServiceCapability> getServiceCapabilities(String serviceClassName) throws ExchangeDaoException {
    try {
        TypedQuery<ServiceCapability> query = em.createNamedQuery(ExchangeConstants.CAPABILITY_FIND_BY_SERVICE, ServiceCapability.class);
        query.setParameter(SERVICE_CLASS_NAME_PARAMETER, serviceClassName);
        return query.getResultList();
    } catch (IllegalArgumentException e) {
        LOG.error("[ Error when getting capabilities ] {}", e.getMessage());
        throw new ExchangeDaoException("[ Error when getting capabilities ] ");
    } catch (Exception e) {
        LOG.error("[ Error when getting capabilities ] {}", e.getMessage());
        throw new ExchangeDaoException("[ Error when getting capabilities ] ");
    }
}
Also used : ExchangeDaoException(eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException) ServiceCapability(eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability) EntityExistsException(javax.persistence.EntityExistsException) NoResultException(javax.persistence.NoResultException) ExchangeDaoException(eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException) NoEntityFoundException(eu.europa.ec.fisheries.uvms.exchange.exception.NoEntityFoundException)

Aggregations

ExchangeDaoException (eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException)22 NoEntityFoundException (eu.europa.ec.fisheries.uvms.exchange.exception.NoEntityFoundException)10 ExchangeModelException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException)10 ExchangeLog (eu.europa.ec.fisheries.uvms.exchange.entity.exchangelog.ExchangeLog)9 NoResultException (javax.persistence.NoResultException)9 InputArgumentException (eu.europa.ec.fisheries.uvms.exchange.model.exception.InputArgumentException)8 ArrayList (java.util.ArrayList)6 PersistenceException (javax.persistence.PersistenceException)5 ExchangeLogStatus (eu.europa.ec.fisheries.uvms.exchange.entity.exchangelog.ExchangeLogStatus)4 EntityExistsException (javax.persistence.EntityExistsException)4 ExchangeLogType (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogType)3 Service (eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.Service)3 ServiceSetting (eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceSetting)3 UnsentMessage (eu.europa.ec.fisheries.uvms.exchange.entity.unsent.UnsentMessage)3 TypeRefType (eu.europa.ec.fisheries.schema.exchange.v1.TypeRefType)2 UnsentMessageType (eu.europa.ec.fisheries.schema.exchange.v1.UnsentMessageType)2 ServiceCapability (eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability)2 ExchangeLogStatusHistoryType (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogStatusHistoryType)1 ExchangeLogStatusType (eu.europa.ec.fisheries.schema.exchange.v1.ExchangeLogStatusType)1 LogWithRawMsgAndType (eu.europa.ec.fisheries.schema.exchange.v1.LogWithRawMsgAndType)1