clean code
This commit is contained in:
parent
66e570cfb2
commit
a9f0fb6985
@ -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()) {
|
||||
|
@ -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 <T extends AbstractEntity> 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(
|
||||
|
Loading…
Reference in New Issue
Block a user