com.verisign.getdns

Interface IGetDNSContextAsyncWithCallback



  • public interface IGetDNSContextAsyncWithCallback

    This interface is for calling the API asynchronously using a callback mechanism.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Long addressAsync(java.lang.String name, java.util.HashMap<ExtensionName,java.lang.Object> extensions, IGetDNSCallback callback)
      This API call takes argument only as a host name.
      void cancelRequest(java.lang.Long transactionId)
      This function uses the transaction_id to determine which callback is to be cancelled.
      void close()
      This method is used to close the current context.
      java.lang.Long generalAsync(java.lang.String name, RRType requestType, java.util.HashMap<ExtensionName,java.lang.Object> extensions, IGetDNSCallback callback)
      This API call is used for looking up any type of DNS record.
      java.lang.Long hostnameAsync(java.lang.String address, java.util.HashMap<ExtensionName,java.lang.Object> extensions, IGetDNSCallback callback)
      This API call takes both IPV4 AND IPV6 address.
      void run()
      This method is used to wait for completion of pending DNS requests and populate the response in the future objects.
      java.lang.Long serviceAsync(java.lang.String name, java.util.HashMap<ExtensionName,java.lang.Object> extensions, IGetDNSCallback callback)
      This API call takes arguments as a domain name for an SRV lookup.
      void setExecutor(java.util.concurrent.ExecutorService executor)
      This function is used to set a threadpool executor to execute the callback.
    • Method Detail

      • addressAsync

        java.lang.Long addressAsync(java.lang.String name,
                                  java.util.HashMap<ExtensionName,java.lang.Object> extensions,
                                  IGetDNSCallback callback)
                                    throws GetDNSException

        This API call takes argument only as a host name.

        There are three critical differences between addressAsync() and GeneralAsync() beyond the missing request_type argument:

        • In addressAsync(), the name argument can only take a host name.
        • You do not need to include a return_both_v4_and_v6 extension with the call in addressAsync(): it will always return both IPv4 and IPv6 addresses.
        • addressAsync() always uses all of namespaces from the context, while generalSync() only uses the DNS namespace

        Parameters:
        name - a representation of the query term; usually a string but must be a dict (as described below) in the case of a PTR record lookup
        extensions - (optional) a dictionary containing attribute/value pairs
        callback - to handle response
        Returns:
        transactionId
        Throws:
        GetDNSException
      • cancelRequest

        void cancelRequest(java.lang.Long transactionId)
                           throws GetDNSException

        This function uses the transaction_id to determine which callback is to be cancelled. If the function fails, transaction_id is set to 0.

        Parameters:
        transactionId -
        Throws:
        GetDNSException
      • generalAsync

        java.lang.Long generalAsync(java.lang.String name,
                                  RRType requestType,
                                  java.util.HashMap<ExtensionName,java.lang.Object> extensions,
                                  IGetDNSCallback callback)
                                    throws GetDNSException

        This API call is used for looking up any type of DNS record.

        context.generalAsync("getdnsapi.net", RRType.valueOf("A"), null, new IGetDNSCallback() {
         
         public void handleResponse(HashMap<String, Object> response, RuntimeException exception) {
         checkResponse(domain, "A", response);
         });
         context.run();
         });
         
         
        Parameters:
        name - a representation of the query term; usually a string.
        requestType - a DNS RR type as a getdns constant (listed here)
        extensions - (optional) a dictionary containing attribute/value pairs
        callback - to handle response
        Returns:
        transactionId
        Throws:
        GetDNSException
      • hostnameAsync

        java.lang.Long hostnameAsync(java.lang.String address,
                                   java.util.HashMap<ExtensionName,java.lang.Object> extensions,
                                   IGetDNSCallback callback)
                                     throws GetDNSException,
                                            java.net.UnknownHostException

        This API call takes both IPV4 AND IPV6 address.

        Parameters:
        address - IPV4 or IPV6 Address
        extensions - (optional) a dictionary containing attribute/value pairs
        callback - to handle response
        Returns:
        transactionId
        Throws:
        GetDNSException
        java.net.UnknownHostException
      • run

        void run()
        This method is used to wait for completion of pending DNS requests and populate the response in the future objects.
      • serviceAsync

        java.lang.Long serviceAsync(java.lang.String name,
                                  java.util.HashMap<ExtensionName,java.lang.Object> extensions,
                                  IGetDNSCallback callback)
                                    throws GetDNSException
        This API call takes arguments as a domain name for an SRV lookup. The call returns the relevant SRV information for the name
        Parameters:
        name - a representation of the query term; usually a string but must be a dict (as described below) in the case of a PTR record lookup
        extensions - (optional) a dictionary containing attribute/value pairs
        callback - to handle response
        Returns:
        transactionId
        Throws:
        GetDNSException
      • setExecutor

        void setExecutor(java.util.concurrent.ExecutorService executor)

        This function is used to set a threadpool executor to execute the callback.

        Parameters:
        executor -
      • close

        void close()
        This method is used to close the current context.