org.xbill.DNS
Interface Resolver

All Known Implementing Classes:
SimpleResolver, ExtendedResolver

public interface Resolver

Interface describing a resolver.


Method Summary
 Message send(Message query)
          Sends a message, and waits for a response
 Object sendAsync(Message query, ResolverListener listener)
          Asynchronously sends a message, registering a listener to receive a callback.
 void setEDNS(int level)
          Sets the EDNS version used on outgoing messages (only 0 is meaningful)
 void setIgnoreTruncation(boolean flag)
          Sets whether truncated responses will be returned
 void setPort(int port)
          Sets the port to communicate with on the server
 void setTCP(boolean flag)
          Sets whether TCP connections will be sent by default
 void setTimeout(int secs)
          Sets the amount of time to wait for a response before giving up
 void setTSIGKey(Name name, byte[] key)
          Specifies the TSIG key that messages will be signed with
 void setTSIGKey(String key)
          Specifies the TSIG key (with the same name as the local host) that messages will be signed with
 void setTSIGKey(String name, String key)
          Specifies the TSIG key that messages will be signed with
 

Method Detail

setPort

public void setPort(int port)
Sets the port to communicate with on the server

setTCP

public void setTCP(boolean flag)
Sets whether TCP connections will be sent by default

setIgnoreTruncation

public void setIgnoreTruncation(boolean flag)
Sets whether truncated responses will be returned

setEDNS

public void setEDNS(int level)
Sets the EDNS version used on outgoing messages (only 0 is meaningful)

setTSIGKey

public void setTSIGKey(Name name,
                       byte[] key)
Specifies the TSIG key that messages will be signed with

setTSIGKey

public void setTSIGKey(String name,
                       String key)
Specifies the TSIG key that messages will be signed with

setTSIGKey

public void setTSIGKey(String key)
Specifies the TSIG key (with the same name as the local host) that messages will be signed with

setTimeout

public void setTimeout(int secs)
Sets the amount of time to wait for a response before giving up

send

public Message send(Message query)
             throws IOException
Sends a message, and waits for a response
Returns:
The response

sendAsync

public Object sendAsync(Message query,
                        ResolverListener listener)
Asynchronously sends a message, registering a listener to receive a callback. Multiple asynchronous lookups can be performed in parallel. Since the callback may be invoked before the function returns, external synchronization is necessary.
Returns:
An identifier, which is also a parameter in the callback