Class DnsQueryContextManager


  • final class DnsQueryContextManager
    extends java.lang.Object
    • Constructor Detail

      • DnsQueryContextManager

        DnsQueryContextManager()
    • Method Detail

      • add

        int add​(java.net.InetSocketAddress nameServerAddr,
                DnsQueryContext qCtx)
        Add DnsQueryContext to the context manager and return the ID that should be used for the query. This method will return -1 if an ID could not be generated and the context was not stored.
        Parameters:
        nameServerAddr - The InetSocketAddress of the nameserver to query.
        qCtx - The {@link {@link DnsQueryContext} to store.
        Returns:
        the ID that should be used or -1 if none could be generated.
      • get

        DnsQueryContext get​(java.net.InetSocketAddress nameServerAddr,
                            int id)
        Return the DnsQueryContext for the given InetSocketAddress and id or null if none could be found.
        Parameters:
        nameServerAddr - The InetSocketAddress of the nameserver.
        id - The id that identifies the DnsQueryContext and was used for the query.
        Returns:
        The context or null if none could be found.
      • remove

        DnsQueryContext remove​(java.net.InetSocketAddress nameServerAddr,
                               int id)
        Remove the DnsQueryContext for the given InetSocketAddress and id or null if none could be found.
        Parameters:
        nameServerAddr - The InetSocketAddress of the nameserver.
        id - The id that identifies the DnsQueryContext and was used for the query.
        Returns:
        The context or null if none could be removed.
      • toCompactAddress

        private static java.net.Inet6Address toCompactAddress​(java.net.Inet4Address a4)
      • toIPv4Address

        private static java.net.Inet4Address toIPv4Address​(java.net.Inet6Address a6)