Package org.arch.dns.exception

Examples of org.arch.dns.exception.NamingException


    {
      udpSocket = new DatagramSocket();
    }
    catch (java.net.SocketException e)
    {
      NamingException ne = new ConfigurationException();
      ne.setRootCause(e);
      throw ne;
    }
   
    this.servers = new InetAddress[servers.length];
    serverPorts = new int[servers.length];
   
    for (int i = 0; i < servers.length; i++)
    {
     
      // Is optional port given?
      int colon = servers[i].indexOf(':', servers[i].indexOf(']') + 1);
     
      serverPorts[i] = (colon < 0) ? DEFAULT_PORT : Integer
              .parseInt(servers[i].substring(colon + 1));
      String server = (colon < 0) ? servers[i] : servers[i].substring(0,
              colon);
      try
      {
        this.servers[i] = InetAddress.getByName(server);
      }
      catch (java.net.UnknownHostException e)
      {
        NamingException ne = new ConfigurationException(
                "Unknown DNS server: " + server);
        ne.setRootCause(e);
        throw ne;
      }
    }
    reqs = Collections.synchronizedSet(new HashSet<Integer>());
    resps = Collections.synchronizedMap(new HashMap<Integer, byte[]>());
View Full Code Here


    if (caughtException instanceof NamingException)
    {
      throw (NamingException) caughtException;
    }
    // A network timeout or other error occurred.
    NamingException ne = new CommunicationException("DNS error");
    ne.setRootCause(caughtException);
    throw ne;
  }
View Full Code Here

    }
    if (caughtException instanceof NamingException)
    {
      throw (NamingException) caughtException;
    }
    NamingException ne = new CommunicationException(
            "DNS error during zone transfer");
    ne.setRootCause(caughtException);
    throw ne;
  }
View Full Code Here

      case NOT_IMPL:
      case REFUSED:
        throw new OperationNotSupportedException(msg);
      case FORMAT_ERROR:
      default:
        throw new NamingException(msg);
    }
  }
View Full Code Here

TOP

Related Classes of org.arch.dns.exception.NamingException

Copyright © 2018 www.massapicom. 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.