use of org.apache.syncope.core.persistence.api.entity.Domain in project syncope by apache.
the class JPADomainDAO method delete.
@Override
public void delete(final String key) {
Domain domain = find(key);
if (domain == null) {
return;
}
entityManager().remove(domain);
}
use of org.apache.syncope.core.persistence.api.entity.Domain in project syncope by apache.
the class DomainDataBinderImpl method create.
@Override
public Domain create(final DomainTO domainTO) {
Domain domain = entityFactory.newEntity(Domain.class);
update(domain, domainTO);
return domain;
}
use of org.apache.syncope.core.persistence.api.entity.Domain in project syncope by apache.
the class DomainLogic method delete.
@PreAuthorize("hasRole('" + StandardEntitlement.DOMAIN_DELETE + "') and authentication.details.domain == " + "T(org.apache.syncope.common.lib.SyncopeConstants).MASTER_DOMAIN")
public DomainTO delete(final String key) {
Domain domain = domainDAO.find(key);
if (domain == null) {
LOG.error("Could not find domain '" + key + "'");
throw new NotFoundException(key);
}
DomainTO deleted = binder.getDomainTO(domain);
domainDAO.delete(key);
return deleted;
}
use of org.apache.syncope.core.persistence.api.entity.Domain in project syncope by apache.
the class DomainLogic method update.
@PreAuthorize("hasRole('" + StandardEntitlement.DOMAIN_UPDATE + "') and authentication.details.domain == " + "T(org.apache.syncope.common.lib.SyncopeConstants).MASTER_DOMAIN")
public DomainTO update(final DomainTO domainTO) {
Domain domain = domainDAO.find(domainTO.getKey());
if (domain == null) {
LOG.error("Could not find domain '" + domainTO.getKey() + "'");
throw new NotFoundException(domainTO.getKey());
}
binder.update(domain, domainTO);
domain = domainDAO.save(domain);
return binder.getDomainTO(domain);
}
use of org.apache.syncope.core.persistence.api.entity.Domain in project syncope by apache.
the class DomainTest method findAll.
@Test
public void findAll() {
List<Domain> list = domainDAO.findAll();
assertNotNull(list);
assertFalse(list.isEmpty());
for (Domain domain : list) {
assertNotNull(domain);
}
}
Aggregations