From a9f0fb69857fd6994c639d202fd56c6ca268411c Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Wed, 4 Oct 2017 17:15:37 +0200 Subject: [PATCH] clean code --- .../de/hsadmin/mods/dom/DomainModuleImpl.java | 9 ------- .../mods/dom/DomainProcessorFactory.java | 27 +------------------ 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java index c934c54..d32a8e0 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java @@ -185,15 +185,6 @@ public class DomainModuleImpl extends AbstractModuleImpl { if (dom.getValidsubdomainnames() == null) { dom.setValidsubdomainnames("www"); } -// if (dom.isPacDomain()) { -// em.persist(new EMailAddress("owner", "", dom, dom.getUser().getPac().getCustomer().getName().substring(6) + "@hostsharing.net")); -// em.persist(new EMailAddress("admin", "", dom, dom.getUser().getPac().getName() + "@hostsharing.net")); -// em.persist(new EMailAddress(dom.getUser().getPac().getName(), "", dom, dom.getUser().getPac().getName() + "@hostsharing.net")); -// } else { -// em.persist(new EMailAddress("abuse", "", dom, admin.getName())); -// em.persist(new EMailAddress("postmaster", "", dom, admin.getName())); -// em.persist(new EMailAddress("webmaster", "", dom, admin.getName())); -// } final AbstractEntity newDomain = super.add(dom); final GenericModuleImpl helperModule = new GenericModuleImpl(getTransaction()); if (dom.isPacDomain()) { diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index f62ca8c..5e11cbf 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Logger; import javax.persistence.EntityManager; import javax.persistence.Query; @@ -21,8 +20,6 @@ import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.VelocityProcessor; import de.hsadmin.core.qserv.WaitingTasksProcessor; import de.hsadmin.core.util.Config; -import de.hsadmin.mods.email.EMailAddress; -import de.hsadmin.mods.email.EMailAddressProcessorFactory; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -32,19 +29,13 @@ public class DomainProcessorFactory implements EntityProcessorFactory { "htdocs", "htdocs-ssl", "subs", "subs/www", "subs-ssl", "subs-ssl/www", "cgi", "fastcgi", "cgi-ssl", "fastcgi-ssl", "app", "app-ssl", "etc", "var" }; - private static final Logger LOG = Logger.getLogger(DomainProcessorFactory.class.getName()); - public Processor createCreateProcessor(EntityManager em, T entity) throws ProcessorException { String hiveName = entity.getHiveName(); Domain dom = (Domain) entity; UnixUser domUser = dom.getUser(); Pac pac = domUser.getPac(); WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor( - new CompoundProcessor( - createHiveDNSSetupProcessor(em, dom) -// , -// createHiveEMailSetupProcessor(em, dom) - ) + new CompoundProcessor(createHiveDNSSetupProcessor(em, dom)) ); Config config = Config.getInstance(); for (String queueName : config.getProperty("queues.dns").split(",")) { @@ -137,22 +128,6 @@ public class DomainProcessorFactory implements EntityProcessorFactory { " && invoke-rc.d bind9 reload"); } -// private CompoundProcessor createHiveEMailSetupProcessor(EntityManager em, Domain dom) { -// LOG.info("createHiveEMailSetupProcessor( " + dom.getName() + " )"); -// final EMailAddressProcessorFactory eMailAddressProcessorFactory = new EMailAddressProcessorFactory(); -// final CompoundProcessor emailAdrProcessor = new CompoundProcessor(); -// final Query query = em.createQuery( -// "SELECT adr FROM EMailAddresses adr WHERE adr.domain.name = :domname"); -// query.setParameter("domname", dom.getName()); -// final List resultList = query.getResultList(); -// for (final Object obj : resultList) { -// final EMailAddress eMailAddress = (EMailAddress) obj; -// LOG.info("EMail: " + eMailAddress.getEMailAddress()); -// emailAdrProcessor.appendProcessor(eMailAddressProcessorFactory.createCreateProcessor(em, eMailAddress)); -// } -// return emailAdrProcessor; -// } - private Processor createMailinSetupProcessor(EntityManager em, Domain dom, Pac pac) throws ProcessorException { final String inetAddr = pac.getCurINetAddr().getInetAddr(); final CompoundProcessor cp = new CompoundProcessor(