Search in sources :

Example 11 with ServiceSetting

use of eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceSetting 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)

Aggregations

ServiceSetting (eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceSetting)11 Service (eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.Service)6 ArrayList (java.util.ArrayList)6 ServiceCapability (eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability)4 Test (org.junit.Test)4 ServiceType (eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceType)3 ExchangeDaoException (eu.europa.ec.fisheries.uvms.exchange.exception.ExchangeDaoException)3 SettingListType (eu.europa.ec.fisheries.schema.exchange.service.v1.SettingListType)2 SettingType (eu.europa.ec.fisheries.schema.exchange.service.v1.SettingType)2 CapabilityListType (eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityListType)1 ServiceResponseType (eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceResponseType)1 NoEntityFoundException (eu.europa.ec.fisheries.uvms.exchange.exception.NoEntityFoundException)1 ExchangeModelException (eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelException)1 HashMap (java.util.HashMap)1 EntityExistsException (javax.persistence.EntityExistsException)1 NoResultException (javax.persistence.NoResultException)1 DateTime (org.joda.time.DateTime)1 Ignore (org.junit.Ignore)1