HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2017-10-02 b34d706e36fd7f7a9918c923822af6149e8bf06b
some logging
2 files modified
12 ■■■■■ changed files
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java 10 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/email/EMailAlias.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java
@@ -4,6 +4,7 @@
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;
@@ -30,6 +31,8 @@
    private static final String[] DOM_STRUCTURE = new String[] { 
        "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();
@@ -134,15 +137,16 @@
    }
    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 " +
                EMailAddress.class.getAnnotation(javax.persistence.Entity.class).name() + " adr " +
                "WHERE adr.domain.name='" + dom.getName() + "'");
            "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;
hsarback/src/de/hsadmin/mods/email/EMailAlias.java
@@ -29,7 +29,7 @@
 * Entity class for email aliases.
 * 
 */
@javax.persistence.Entity(name = "EMailAliases")
@Entity(name = "EMailAliases")
@Table(name = "emailalias")
@SequenceGenerator(name = "EMailAliasesSeqGen", sequenceName = "emailalias_emailalias_id_seq")
@SearchFilter("obj.pac = :loginUserPac OR obj.pac.customer.name = :loginUserName")