Examples of DNSServer


Examples of org.apache.james.services.DNSServer

     * @since Mailet API v2.2.0a16-unstable
     * @param domainName - the domain for which to find mail servers
     * @return an Iterator over HostAddress instances, sorted by priority
     */
    public Iterator getSMTPHostAddresses(String domainName) {
        DNSServer dnsServer = null;
        try {
            dnsServer = (DNSServer) compMgr.lookup( DNSServer.ROLE );
        } catch ( final ServiceException cme ) {
            getLogger().error("Fatal configuration error - DNS Servers lost!", cme );
            throw new RuntimeException("Fatal configuration error - DNS Servers lost!");
        }
        return dnsServer.getSMTPHostAddresses(domainName);
    }
View Full Code Here

Examples of org.apache.james.services.DNSServer

     * <p>TODO: This needs to be made a more specific ordered subtype of Collection.</p>
     *
     * @param host
     */
    public Collection getMailServers(String host) {
        DNSServer dnsServer = null;
        try {
            dnsServer = (DNSServer) compMgr.lookup( DNSServer.ROLE );
        } catch ( final ServiceException cme ) {
            getLogger().error("Fatal configuration error - DNS Servers lost!", cme );
            throw new RuntimeException("Fatal configuration error - DNS Servers lost!");
        }
        return dnsServer.findMXRecords(host);
    }
View Full Code Here

Examples of org.apache.james.services.DNSServer

     * @since Mailet API v2.2.0a16-unstable
     * @param domainName - the domain for which to find mail servers
     * @return an Iterator over HostAddress instances, sorted by priority
     */
    public Iterator getSMTPHostAddresses(String domainName) {
        DNSServer dnsServer = null;
        try {
            dnsServer = (DNSServer) compMgr.lookup( DNSServer.ROLE );
        } catch ( final ServiceException cme ) {
            getLogger().error("Fatal configuration error - DNS Servers lost!", cme );
            throw new RuntimeException("Fatal configuration error - DNS Servers lost!");
        }
        return dnsServer.getSMTPHostAddresses(domainName);
    }
View Full Code Here

Examples of org.apache.james.services.DNSServer

        m_serviceManager.put(MailServer.ROLE, m_mailServer);
        m_serviceManager.put(UsersRepository.ROLE, m_usersRepository);
        m_serviceManager.put(SocketManager.ROLE, new MockSocketManager(m_smtpListenerPort));
        m_serviceManager.put(ThreadManager.ROLE, new MockThreadManager());
        // Mock DNS Server
        DNSServer dns = new DNSServer() {

            public Collection findMXRecords(String hostname) {
                List res = new ArrayList();
                if (hostname == null) {
                    return res;
View Full Code Here

Examples of org.platformlayer.service.dns.model.DnsServer

  }

  @Override
  public void beforeCreateItem(ItemBase item) throws OpsException {
    if (item instanceof DnsServer) {
      DnsServer model = (DnsServer) item;

      model.dnsName = normalize(model.dnsName);
      if (Strings.isNullOrEmpty(model.dnsName)) {
        throw new IllegalArgumentException("dnsName must be specified");
      }
    }

    if (item instanceof DnsRecord) {
      DnsRecord model = (DnsRecord) item;

      model.dnsName = normalize(model.dnsName);
      if (Strings.isNullOrEmpty(model.dnsName)) {
        throw new IllegalArgumentException("dnsName must be specified");
      }

      if (Strings.isNullOrEmpty(model.recordType)) {
        model.recordType = "A";
      }

      if (model.recordType.equals("A")) {
        // OK
      } else {
        throw new IllegalArgumentException("Record type not supported: " + model.recordType);
      }
    }

    if (item instanceof DnsZone) {
      DnsZone model = (DnsZone) item;

      model.dnsName = normalize(model.dnsName);
      if (Strings.isNullOrEmpty(model.dnsName)) {
        model.dnsName = normalize(model.getId());
      }
    }

    super.beforeCreateItem(item);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.