tigase.util

## Interface DNSResolverIfc

- All Known Implementing Classes:
    DNSResolverDefault

      public interface DNSResolverIfc

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Logger` | `log`
    `static Random` | `rand`
    `static String` | `TIGASE_PRIMARY_ADDRESS`
    `static String` | `TIGASE_SECONDARY_ADDRESS`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDefaultHost()` Method provides default host information for the installation.
    `default String[]` | `getDefaultHosts()` Method provides an array of all local host informations, by default it contains defaultHost.
    `default String` | `getHostIP(String hostname)` Resolve IP address for the given `hostname`
    `String[]` | `getHostIPs(String hostname)` Resolve all IP addresses for the given `hostname`
    `default DNSEntry[]` | `getHostSRV_Entries(String hostname)` Retrieves list of SRV DNS entries for given `hostname`.
    `default DNSEntry[]` | `getHostSRV_Entries(String hostname, String service, int defPort)` Retrieves list of DNS entries for given `hostname`.
    `default DNSEntry` | `getHostSRV_Entry(String hostname)` Retrieves service DNS entry with highest priority for given `hostname`.
    `default DNSEntry` | `getHostSRV_Entry(String hostname, String service, int defPort)` Retrieves list of DNS entries for given `hostname`.
    `default String` | `getHostSRV_IP(String hostname)` Returns `IP address` of the machine providing the service.
    `default String` | `getSecondaryHost()` Method provides alternative host information for the current instance.

- - ### Field Detail

    - #### TIGASE_PRIMARY_ADDRESS

          static final String TIGASE_PRIMARY_ADDRESS

      See Also:
        Constant Field Values

    - #### TIGASE_SECONDARY_ADDRESS

          static final String TIGASE_SECONDARY_ADDRESS

      See Also:
        Constant Field Values

    - #### log

          static final Logger log

    - #### rand

          static final Random rand

  - ### Method Detail

    - #### getDefaultHost

          String getDefaultHost()

      Method provides default host information for the installation. It can be both hostname or IP address.
      Returns:
        a default host information.

    - #### getDefaultHosts

          default String[] getDefaultHosts()

      Method provides an array of all local host informations, by default it contains defaultHost.
      Returns:
        an array of all local hosts.

    - #### getSecondaryHost

          default String getSecondaryHost()

      Method provides alternative host information for the current instance. By default falls back to the default host information.
      Returns:
        alternative host information.

    - #### getHostIP

          default String getHostIP(String hostname)
                            throws UnknownHostException

      Resolve IP address for the given `hostname`
      Parameters:
        `hostname` - the domain name for which this record is valid
      Returns:
        `IP address` of the machine providing the service.
      Throws:
        `UnknownHostException`

    - #### getHostIPs

          String[] getHostIPs(String hostname)
                       throws UnknownHostException

      Resolve all IP addresses for the given `hostname`
      Parameters:
        `hostname` - the domain name for which this record is valid
      Returns:
        Array of all `IP addresses` on which target host provide service.
      Throws:
        `UnknownHostException`

    - #### getHostSRV_Entries

          default DNSEntry[] getHostSRV_Entries(String hostname)
                                         throws UnknownHostException

      Retrieves list of SRV DNS entries for given `hostname`. Performs lookup for `_xmpp-server._tcp` SRV records.
      Parameters:
        `hostname` - the domain name for which this record is valid
      Returns:
        Array of the DNSEntry objects containing SRV DNS records
      Throws:
        `UnknownHostException`

    - #### getHostSRV_Entries

          default DNSEntry[] getHostSRV_Entries(String hostname,
                                                String service,
                                                int defPort)
                                         throws UnknownHostException

      Retrieves list of DNS entries for given `hostname`. Allow specifying particular type of SRV record.
      Parameters:
        `hostname` - the domain name for which this record is valid
        `service` - type of SRV records, for example `_xmpp-server._tcp`
        `defPort` - default port number in case DNS records is missing one.
      Returns:
        Array of the DNSEntry records
      Throws:
        `UnknownHostException`

    - #### getHostSRV_Entry

          default DNSEntry getHostSRV_Entry(String hostname)
                                     throws UnknownHostException

      Retrieves service DNS entry with highest priority for given `hostname`. Performs lookup for `_xmpp-server._tcp` SRV records.
      Parameters:
        `hostname` - name to resolve
      Returns:
        DNSEntry object containing DNS record with highest priority for given `hostname`
      Throws:
        `UnknownHostException`

    - #### getHostSRV_Entry

          default DNSEntry getHostSRV_Entry(String hostname,
                                            String service,
                                            int defPort)
                                     throws UnknownHostException

      Retrieves list of DNS entries for given `hostname`. Allow specifying particular type of SRV record.
      Parameters:
        `hostname` - name to resolve
        `service` - type of SRV records, for example `_xmpp-server._tcp`
        `defPort` - default port number in case DNS records is missing one.
      Returns:
        DNSEntry object containing DNS record with highest priority for given `hostname`
      Throws:
        `UnknownHostException`

    - #### getHostSRV_IP

          default String getHostSRV_IP(String hostname)
                                throws UnknownHostException

      Returns `IP address` of the machine providing the service.
      Parameters:
        `hostname` - the domain name for which this record is valid
      Returns:
      Throws:
        `UnknownHostException`

Copyright © 2022 "Tigase, Inc.". All rights reserved.