com.verisign.getdns

Enum ContextOptionName

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ContextOptionName>


    public enum ContextOptionName
    extends java.lang.Enum<ContextOptionName>

    This contains possible context option names that can be used while configuring the context manually.

     HashMap options = new HashMap();
     options.put(ContextOptionName.DNS_TRANSPORT, ContextOptionValue.GETDNS_TRANSPORT_UDP_ONLY);
     IGetDNSContextSync context = GetDNSFactory.createSync(1, options);
     

    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      APPEND_NAME
      This is used to Specify a suffix to the query string before the API starts resolving a name.
      DNS_ROOT_SERVERS
      The value of dns_root_servers is a list of dictionaries containing addresses to be used for looking up top-level domains.
      DNS_TRANSPORT
      Specifies what transport is used for DNS lookups.
      DNSSEC_ALLOWED_SKEW
      This takes values as number of seconds of skew that is allowed in either direction when checking an RRSIG’s Expiration and Inception fields.
      DNSSEC_TRUST_ANCHOR
      This takes values as a list of DNSSEC trust anchors, expressed as RDATAs from DNSKEY resource records.
      EDNS_DO_BIT
      This takes values as an integer valued either 0 or 1.
      EDNS_EXTENDED_RCODE
      This takes values as an integer between 0 and 255, inclusive.
      EDNS_MAXIMUM_UDP_PAYLOADSIZE
      This takes values as an integer between 512 and 65535, inclusive.
      EDNS_VERSION
      This takes values as an integer between 0 and 255, inclusive.
      FOLLOW_REDIRECT
      Specifies whether or not DNS queries follow redirects.
      LIMIT_OUTSTANDING_QUERIES
      Specifies limit (an integer value) on the number of outstanding DNS queries.
      NAMESPACE
      The namespaces attribute takes an ordered list of namespaces that will be queried.
      RESOLUTION_TYPE
      Specifies whether DNS queries are performed with nonrecursive lookups or as a stub resolver.
      RETURN_DNSSEC_STATUS
      Specifies whether DNSSEC status should be returned in dns response
      the value is either true or false
      STUB
      Specifies whether DNS queries are performed with stub or recursive resolver.
      SUFFIX
      This takes values as a list of strings to be appended based on append_name.
      TIMEOUT
      This takes values as an integer specifying a timeout for a query, expressed in milliseconds.
      UPSTREAMS
      An application can change the quering mechanism of a context to be to act as a stub resolver.
      USE_THREADS
      This takes values as an boolean either true or false.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getName() 
      static ContextOptionName valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ContextOptionName[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • APPEND_NAME

        public static final ContextOptionName APPEND_NAME

        This is used to Specify a suffix to the query string before the API starts resolving a name. Its value must be one of

        • ContextOptionValue..GETDNS_APPEND_NAME_ALWAYS
        • ContextOptionValue..GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE
        • ContextOptionValue..GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE
        • ContextOptionValue..GETDNS_APPEND_NAME_NEVER
        This controls whether or not to append the suffix given by suffix.

      • DNS_ROOT_SERVERS

        public static final ContextOptionName DNS_ROOT_SERVERS

        The value of dns_root_servers is a list of dictionaries containing addresses to be used for looking up top-level domains. Each dict contains:
        address_data: a string representation of an IPv4 or IPv6 address

        For example, the addresses list could look like:

         HashMap<ContextOptionNames, Object> options = new HashMap<ContextOptionNames, Object>();
         Object[][] list = { { "8.8.8.8"}, { "2001:4860:4860::8888"} }
         options.put(ContextOptionNames.DNS_ROOT_SERVERS, list)
         IGetDNSContext context = null;
         context = GetDNSFactory.create(1, options);
         
         

      • DNS_TRANSPORT

        public static final ContextOptionName DNS_TRANSPORT

        Specifies what transport is used for DNS lookups. The value must be one of getdns:

        • ContextOptionValue.GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP
        • ContextOptionValue.GETDNS_TRANSPORT_UDP_ONLY
        • ContextOptionValue.GETDNS_TRANSPORT_TCP_ONLY
        • ContextOptionValue.GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN

      • DNSSEC_ALLOWED_SKEW

        public static final ContextOptionName DNSSEC_ALLOWED_SKEW

        This takes values as number of seconds of skew that is allowed in either direction when checking an RRSIG’s Expiration and Inception fields. The default is 0.

      • DNSSEC_TRUST_ANCHOR

        public static final ContextOptionName DNSSEC_TRUST_ANCHOR

        This takes values as a list of DNSSEC trust anchors, expressed as RDATAs from DNSKEY resource records.

      • EDNS_DO_BIT

        public static final ContextOptionName EDNS_DO_BIT

        This takes values as an integer valued either 0 or 1. The default is 0.

      • EDNS_EXTENDED_RCODE

        public static final ContextOptionName EDNS_EXTENDED_RCODE

        This takes values as an integer between 0 and 255, inclusive. The default is 0.

      • EDNS_MAXIMUM_UDP_PAYLOADSIZE

        public static final ContextOptionName EDNS_MAXIMUM_UDP_PAYLOADSIZE

        This takes values as an integer between 512 and 65535, inclusive. The default is 512.

      • EDNS_VERSION

        public static final ContextOptionName EDNS_VERSION

        This takes values as an integer between 0 and 255, inclusive. The default is 0.

      • FOLLOW_REDIRECT

        public static final ContextOptionName FOLLOW_REDIRECT

        Specifies whether or not DNS queries follow redirects. The value must be one of getdns.GETDNS_REDIRECTS_FOLLOW for normal following of redirects though CNAME and DNAME; or getdns.GETDNS_REDIRECTS_DO_NOT_FOLLOW to cause any lookups that would have gone through CNAME and DNAME to return the CNAME or DNAME, not the eventual target.

      • LIMIT_OUTSTANDING_QUERIES

        public static final ContextOptionName LIMIT_OUTSTANDING_QUERIES

        Specifies limit (an integer value) on the number of outstanding DNS queries. The API will block itself from sending more queries if it is about to exceed this value, and instead keep those queries in an internal queue. The a value of 0 indicates that the number of outstanding DNS queries is unlimited.

      • NAMESPACE

        public static final ContextOptionName NAMESPACE

        The namespaces attribute takes an ordered list of namespaces that will be queried. (Important: this context setting is ignored for the getdns.general() function; it is used for the other functions.)

        The allowed values are:

        • ContextOptionValue.GETDNS_NAMESPACE_DNS
        • ContextOptionValue.GETDNS_NAMESPACE_LOCALNAMES
        • ContextOptionValue.GETDNS_NAMESPACE_NETBIOS
        • ContextOptionValue.GETDNS_NAMESPACE_MDNS
        • ContextOptionValue.GETDNS_NAMESPACE_NIS
        • When a normal lookup is done, the API does the lookups in the order given and stops when it gets the first result; a different method with the same result would be to run the queries in parallel and return when it gets the first result. Because lookups might be done over different mechanisms because of the different namespaces, there can be information leakage that is similar to that seen with POSIX getaddrinfo(). The default is determined by the OS.

      • RESOLUTION_TYPE

        public static final ContextOptionName RESOLUTION_TYPE

        Specifies whether DNS queries are performed with nonrecursive lookups or as a stub resolver. The value is either getdns.GETDNS_RESOLUTION_RECURSING or getdns.GETDNS_RESOLUTION_STUB. If an implementation of this API is only able to act as a recursive resolver, setting resolution_type to getdns.GETDNS_RESOLUTION_STUB will throw an exception.

      • RETURN_DNSSEC_STATUS

        public static final ContextOptionName RETURN_DNSSEC_STATUS

        Specifies whether DNSSEC status should be returned in dns response
        the value is either true or false

      • STUB

        public static final ContextOptionName STUB

        Specifies whether DNS queries are performed with stub or recursive resolver.
        true for stub and false for recursive.

      • SUFFIX

        public static final ContextOptionName SUFFIX

        This takes values as a list of strings to be appended based on append_name. The list elements must follow the rules in RFC 4343

      • TIMEOUT

        public static final ContextOptionName TIMEOUT

        This takes values as an integer specifying a timeout for a query, expressed in milliseconds.

      • UPSTREAMS

        public static final ContextOptionName UPSTREAMS

        An application can change the quering mechanism of a context to be to act as a stub resolver.

         Usage:
         HashMap<ContextOptionName, Object> options = new HashMap<ContextOptionName, Object>();
           options.put(ContextOptionName.STUB, true);
           Object[][] list = { { "8.8.8.8" }, { "127.0.0.1", 80 } };
           options.put(ContextOptionName.UPSTREAMS, list);
           IGetDNSContextSync context = GetDNSFactory.createSync(1, options);
           
         

      • USE_THREADS

        public static final ContextOptionName USE_THREADS

        This takes values as an boolean either true or false.

    • Method Detail

      • getName

        public java.lang.String getName()
      • valueOf

        public static ContextOptionName valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • values

        public static ContextOptionName[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ContextOptionName c : ContextOptionName.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared