public class GetDNSFutureResult extends java.lang.Object implements java.util.concurrent.Future<java.util.HashMap<java.lang.String,java.lang.Object>>, IGetDNSCallback
This is used to consume response from methods invoked on IGetDNSContextAsyncWithFuture call implementation. It implements java Future.
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
This method can be invoked to cancel the request
|
java.util.HashMap<java.lang.String,java.lang.Object> |
get()
This method will return response of a dns lookup.
|
java.util.HashMap<java.lang.String,java.lang.Object> |
get(long timeout,
java.util.concurrent.TimeUnit unit)
This method will return response of a dns lookup.
|
void |
handleResponse(java.util.HashMap<java.lang.String,java.lang.Object> response,
java.lang.RuntimeException exception)
This method will be invoked when the response to a dns query is ready.
|
boolean |
isCancelled()
This method will return true in case the dns request is canceled.
|
boolean |
isDone()
This method will return true when the dns lookup is complete
|
public boolean cancel(boolean mayInterruptIfRunning) throws GetDNSException
cancel
in interface java.util.concurrent.Future<java.util.HashMap<java.lang.String,java.lang.Object>>
GetDNSException
public java.util.HashMap<java.lang.String,java.lang.Object> get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<java.util.HashMap<java.lang.String,java.lang.Object>>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public java.util.HashMap<java.lang.String,java.lang.Object> get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<java.util.HashMap<java.lang.String,java.lang.Object>>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public void handleResponse(java.util.HashMap<java.lang.String,java.lang.Object> response, java.lang.RuntimeException exception)
IGetDNSCallback
handleResponse
in interface IGetDNSCallback
response
- This is response from the dns queryexception
- This parameter will be non-null, in case there was a problem during the dns query.public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<java.util.HashMap<java.lang.String,java.lang.Object>>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<java.util.HashMap<java.lang.String,java.lang.Object>>