diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java index ec201e0..2e7038d 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java @@ -11,6 +11,7 @@ import javax.persistence.Query; import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; +import de.hsadmin.core.model.GenericModuleImpl; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.mods.email.EMailAddress; import de.hsadmin.mods.pac.Pac; @@ -177,9 +178,9 @@ public class DomainModuleImpl extends AbstractModuleImpl { Query query = em.createQuery("SELECT adr FROM " + EMailAddress.class.getAnnotation(javax.persistence.Entity.class).name() + " adr WHERE adr.domain.name='" + dom.getName() + "'"); List resultList = query.getResultList(); + GenericModuleImpl helperModule = new GenericModuleImpl(getTransaction()); for (Object obj : resultList) { - EMailAddress eMailAddress = (EMailAddress) obj; - em.remove(eMailAddress); + helperModule.delete((EMailAddress) obj); } super.delete(existingEntity); } diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index d6df480..dc7652f 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -100,11 +100,8 @@ public class DomainProcessorFactory implements EntityProcessorFactory { public Processor createDeleteProcessor(EntityManager em, T entity) throws ProcessorException { Domain dom = (Domain) entity; String domName = dom.getName(); - WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor( - new CompoundProcessor( - createHiveEMailRemoveProcessor(domName), - createHiveDNSRemoveProcessor(domName) - ) + WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor( + createHiveDNSRemoveProcessor(domName) ); Config config = Config.getInstance(); for (String queueName : config.getProperty("queues.dns").split(",")) { @@ -158,14 +155,6 @@ public class DomainProcessorFactory implements EntityProcessorFactory { return emailAdrProcessor; } - private ShellProcessor createHiveEMailRemoveProcessor(String domName) { - return new ShellProcessor( - "postmap -d '" + domName + "' /etc/postfix-mailin/virtual && " + - "for KEY in $(postmap -s /etc/postfix-mailin/virtual|grep '@" + domName + "\\s'|cut -f1); " + - "do postmap -d $KEY /etc/postfix-mailin/virtual; done" - ); - } - private Processor createDNSServerSetupProcessor(String domName, String pacInetAddr) { Processor seczonesFileProcessor; seczonesFileProcessor =