Package uk.num.numlib.api
Class NumAPICallbacksDefaultHandler
java.lang.Object
uk.num.numlib.api.NumAPICallbacksDefaultHandler
- All Implemented Interfaces:
NumAPICallbacks
public class NumAPICallbacksDefaultHandler extends java.lang.Object implements NumAPICallbacks
A default no-op implementation of the NumAPICallbacks.
-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.num.numlib.api.NumAPICallbacks
NumAPICallbacks.Location -
Constructor Summary
Constructors Constructor Description NumAPICallbacksDefaultHandler() -
Method Summary
Modifier and Type Method Description NumAPICallbacks.LocationreceivedFrom()The type of location the NUM record was received from.voidsetErrorResult(java.lang.String error)Called if an error occurs while retrieving or processing the NUM recocrd.voidsetResult(java.lang.String result)Called when the query result is available.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.num.numlib.api.NumAPICallbacks
getKey, getResult, isSignedDNSSEC, setKey, setLocation, setSignedDNSSEC
-
Constructor Details
-
NumAPICallbacksDefaultHandler
public NumAPICallbacksDefaultHandler()
-
-
Method Details
-
setResult
public void setResult(java.lang.String result)Called when the query result is available.Note: This may be called multiple times if the result if from the NUM scraping service, because more detailed records might become available after the initial quick response.
Clients should provide their own implementation of this method to receive those additional responses.
- Specified by:
setResultin interfaceNumAPICallbacks- Parameters:
result- the lookup result JSON String
-
setErrorResult
public void setErrorResult(java.lang.String error)Called if an error occurs while retrieving or processing the NUM recocrd.- Specified by:
setErrorResultin interfaceNumAPICallbacks- Parameters:
error- The error String.
-
receivedFrom
The type of location the NUM record was received from.- Specified by:
receivedFromin interfaceNumAPICallbacks- Returns:
- Location::INDEPENDENT, Location::HOSTED, Location::POPULATED
-