Interface NumAPICallbacks

  • All Known Implementing Classes:
    NumAPICallbacksDefaultHandler

    public interface NumAPICallbacks
    This interface defines the callback contract for the NumAPI.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  NumAPICallbacks.Location
      The type of location the NUM record was received from
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isEncrypted()
      Check whether the record needs to be decrypted.
      boolean isSignedDNSSEC()
      Check whether the record was DNSSEC signed.
      NumAPICallbacks.Location receivedFrom()
      The type of location the NUM record was received from.
      void setEncrypted​(boolean encrypted)
      Set a flag to indicate whether the NUM record was encrypted or not.
      void setErrorResult​(java.lang.String error)
      Called if an error occurs while retrieving or processing the NUM recocrd.
      void setLocation​(NumAPICallbacks.Location location)
      Tell the library user where the record was retrieved from.
      void setResult​(java.lang.String json)
      Called when the result is available from DNS
      void setSignedDNSSEC​(boolean signedDNSSEC)
      Set a flag to indicate whether the record was DNSSEC signed or not.
      void setWasEncrypted​(boolean wasEncrypted)
      Tell the library user whether the record retrieved from DNS was encrypted or not.
      boolean wasEncrypted()
      Check whether the NUM record was encrypted when received from DNS.
    • Method Detail

      • setResult

        void setResult​(java.lang.String json)
        Called when the result is available from DNS
        Parameters:
        json - The JSON String containing the result.
      • setErrorResult

        void setErrorResult​(java.lang.String error)
        Called if an error occurs while retrieving or processing the NUM recocrd.
        Parameters:
        error - The error String.
      • isEncrypted

        boolean isEncrypted()
        Check whether the record needs to be decrypted.
        Returns:
        true if the record is encrypted
      • setEncrypted

        void setEncrypted​(boolean encrypted)
        Set a flag to indicate whether the NUM record was encrypted or not.
        Parameters:
        encrypted - true if the NUM record was encrypted
      • wasEncrypted

        boolean wasEncrypted()
        Check whether the NUM record was encrypted when received from DNS.
        Returns:
        true if the record was encrypted.
      • isSignedDNSSEC

        boolean isSignedDNSSEC()
        Check whether the record was DNSSEC signed.
        Returns:
        true if the record was DNSSEC signed.
      • setSignedDNSSEC

        void setSignedDNSSEC​(boolean signedDNSSEC)
        Set a flag to indicate whether the record was DNSSEC signed or not.
        Parameters:
        signedDNSSEC - true if the record was DNSSEC signed
      • receivedFrom

        NumAPICallbacks.Location receivedFrom()
        The type of location the NUM record was received from.
        Returns:
        Location::INDEPENDENT, Location::MANAGED, Location::POPULATED
      • setWasEncrypted

        void setWasEncrypted​(boolean wasEncrypted)
        Tell the library user whether the record retrieved from DNS was encrypted or not.
        Parameters:
        wasEncrypted - true if the record retrieved from DNS was encrypted
      • setLocation

        void setLocation​(NumAPICallbacks.Location location)
        Tell the library user where the record was retrieved from.
        Parameters:
        location - Location::INDEPENDENT, Location::MANAGED, Location::POPULATED