public MailAddress(String localPart, Domain domain) throws AddressException { this(new InternetAddress(localPart + "@" + domain.name())); }
public MaxDomainMessageCount(Domain domain, Long value) { this.domain = domain.asString(); this.value = value; }
@Override public void removeDomain(Domain domain) throws DomainListException { EntityManager entityManager = entityManagerFactory.createEntityManager(); final EntityTransaction transaction = entityManager.getTransaction(); try { transaction.begin(); if (!containsDomainInternal(domain, entityManager)) { transaction.commit(); throw new DomainListException(domain.name() + " was not found."); } entityManager.createNamedQuery("deleteDomainByName").setParameter("name", domain.asString()).executeUpdate(); transaction.commit(); } catch (PersistenceException e) { LOGGER.error("Failed to remove domain", e); rollback(transaction); throw new DomainListException("Unable to remove domain " + domain.name(), e); } finally { entityManager.close(); } }
private boolean mayChangeDefaultDomain() { return autoDetect && Domain.LOCALHOST.equals(defaultDomain); }
public static boolean isSpecialAddress(MailAddress mailAddress) { return mailAddress.getDomain().equals(AddressMarker.ADDRESS_MARKER); } }
/** * Use this simple constructor to create a new Domain. * * @param name * the name of the Domain */ public JPADomain(Domain name) { this.name = name.asString(); }
public MailAddress(String localPart, Domain domain) throws AddressException { this(new InternetAddress(localPart + "@" + domain.name())); }
public static final DLPAggregateId parse(String rawString) { Preconditions.checkArgument(rawString.startsWith(PREFIX + SEPARATOR)); return new DLPAggregateId(Domain.of( rawString.substring(PREFIX.length() + SEPARATOR.length()))); }
/** * Use this simple constructor to create a new RecipientRewriteTable. * * @param user * , domain and their associated targetAddress */ public JPARecipientRewrite(String user, Domain domain, String targetAddress) { this.user = user; this.domain = domain.asString(); this.targetAddress = targetAddress; }
@Override public void removeDomain(Domain domain) throws DomainListException { if (!domains.remove(domain)) { throw new DomainListException(domain.name() + " was not found"); } } }
@Override public void addDomain(String domain) throws Exception { domainList.addDomain(Domain.of(domain)); }
@Override public String asAggregateKey() { return PREFIX + SEPARATOR + domain.asString(); }
private static Stream<Domain> getDomainIpStream(Domain domain, DNSService dns, Logger log) { try { return dns.getAllByName(domain.name()).stream() .map(InetAddress::getHostAddress) .map(Domain::of) .distinct(); } catch (UnknownHostException e) { log.error("Cannot get IP address(es) for {}", domain); return Stream.of(); } }
@Override public void removeDomain(String domain) throws Exception { domainList.removeDomain(Domain.of(domain)); }
public MaxDomainStorage(Domain domain, Long value) { this.domain = domain.asString(); this.value = value; }
private void addDomain(Domain domain) throws DomainListException { Preconditions.checkArgument(domain.name().length() < MAXIMUM_DOMAIN_SIZE); domainList.addDomain(domain); }