From 8d2d1e28cc8dfa876cda808f970639a3cf7e68fe Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Thu, 5 Apr 2012 14:18:23 +0000 Subject: [PATCH] Queues fuer Mail- und DNS-Server konfigurierbar --- .../de/hsadmin/mods/dom/DomainProcessorFactory.java | 11 +++++++---- .../mods/email/EMailAddressProcessorFactory.java | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index a411ae3..07cadec 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -17,6 +17,7 @@ import de.hsadmin.core.qserv.ProcessorException; import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.TemplateProcessor; 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.INetAddress; @@ -47,10 +48,11 @@ public class DomainProcessorFactory implements EntityProcessorFactory { WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(createHiveDNSSetupProcessor(domName, templateVars)); mainProcessor.appendProcessor(hiveName, createHiveEMailSetupProcessor(em, domName), "Setup EMail"); String hiveInetAddr = pac.getHive().getInetAddr().getInetAddr(); - for (String queueName : new String[] { "dns1", "dns2", "dns3" }) { + Config config = Config.getInstance(); + for (String queueName : config.getProperty("queues.dns").split(",")) { mainProcessor.appendProcessor(queueName, createDNSServerSetupProcessor(domName, hiveInetAddr), queueName + ".hostsharing.net"); } - for (String queueName : new String[] { "mail1", "mail2", "mail3" }) { + for (String queueName : config.getProperty("queues.mail").split(",")) { mainProcessor.appendProcessor(queueName, createMailinSetupProcessor(domName, pac), queueName + ".hostsharing.net"); } templateVars = new HashMap(); @@ -83,10 +85,11 @@ public class DomainProcessorFactory implements EntityProcessorFactory { createHiveDNSRemoveProcessor(domName) ) ); - for (String queueName : new String[] { "dns1", "dns2", "dns3" }) { + Config config = Config.getInstance(); + for (String queueName : config.getProperty("queues.dns").split(",")) { mainProcessor.appendProcessor(queueName, createDNSServerRemoveProcessor(domName), queueName + ".hostsharing.net"); } - for (String queueName : new String[] { "mail1", "mail2", "mail3" }) { + for (String queueName : config.getProperty("queues.mail").split(",")) { mainProcessor.appendProcessor(queueName, createMailinDeleteProcessor(domName), queueName + ".hostsharing.net"); } mainProcessor.appendProcessor(dom.getHiveName(), createApacheVHostDeleteProcessor(dom), "remove apache vhost"); diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java b/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java index 608d115..4611661 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java @@ -11,6 +11,7 @@ import de.hsadmin.core.qserv.EntityProcessorFactory; import de.hsadmin.core.qserv.Processor; import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.WaitingTasksProcessor; +import de.hsadmin.core.util.Config; public class EMailAddressProcessorFactory implements EntityProcessorFactory { @@ -26,7 +27,8 @@ public class EMailAddressProcessorFactory implements EntityProcessorFactory { WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); String pacName = email.getDomain().getUser().getPac().getName(); String domName = email.getDomain().getName(); - for (String queueName : new String[] { "mail1", "mail2", "mail3" }) { + Config config = Config.getInstance(); + for (String queueName : config.getProperty("queues.mail").split(",")) { waitingTasksProcessor.appendProcessor(queueName, createMailinSetupProcessor(domName, pacName), queueName + ".hostsharing.net"); } return waitingTasksProcessor; @@ -53,7 +55,8 @@ public class EMailAddressProcessorFactory implements EntityProcessorFactory { cp.appendProcessor( new ShellProcessor( "postmap -d '" + fullDomain + "' /etc/postfix/virtual" ) ); WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp); - for (String queueName : new String[] { "mail1", "mail2", "mail3" }) { + Config config = Config.getInstance(); + for (String queueName : config.getProperty("queues.mail").split(",")) { waitingTasksProcessor.appendProcessor(queueName, createMailinDeleteProcessor(fullDomain), queueName + ".hostsharing.net"); } return waitingTasksProcessor;