em.persist(domainConfiguration);
}
@Override
public DomainConfiguration findDomainConfigurationByDomain(String domain) {
DomainConfiguration domainConfiguration;
try {
domainConfiguration = em.find(DomainConfiguration.class, domain);
} catch (Exception e) {
log.debug("Exception while looking for domain {} : {}", domain, e.toString());
return null;
}
if (domainConfiguration == null) {
domainConfiguration = new DomainConfiguration();
domainConfiguration.setDomain(domain);
setDefaultValues(domainConfiguration);
em.persist(domainConfiguration);
}
if (domain.equals("ippon.fr")) {
domainConfiguration.setSubscriptionLevel(DomainConfiguration.SubscriptionAndStorageSizeOptions.IPPONSUSCRIPTION);
domainConfiguration.setStorageSize(DomainConfiguration.SubscriptionAndStorageSizeOptions.IPPONSIZE);
}
return domainConfiguration;
}