Queues fuer Mail- und DNS-Server konfigurierbar

This commit is contained in:
Peter Hormanns 2012-04-05 14:18:23 +00:00
parent a9e0da750f
commit 8d2d1e28cc
2 changed files with 12 additions and 6 deletions

View File

@ -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<String, String>();
@ -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");

View File

@ -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;