Interface NamingApi

All Known Implementing Classes:
MoeraNaming

public interface NamingApi
The NamingApi interface provides prototypes of Moera Naming API calls.
  • Method Summary

    Modifier and Type
    Method
    Description
    getAll(long at, int page, int size)
    Retrieves a paginated list of all registered names up to a specific moment in time.
    getAllKeys(String name, int generation)
    Retrieves all signing keys associated with the specified name and generation.
    getAllNewer(long at, int page, int size)
    Retrieves a list of registered names that were created or updated after the specified timestamp.
    getCurrent(String name, int generation)
    Retrieves the current state of a registered name based on the specified name and generation.
    getPast(String name, int generation, long at)
    Retrieves historical information about a registered name at a specific point in time.
    Retrieves a RegisteredNameInfo object that represents a name similar to the specified name.
    getStatus(UUID operationId)
    Retrieves the status of the operation based on the provided operation ID.
    boolean
    isFree(String name, int generation)
    Checks whether a given name is free for registration in the naming service.
    put(String name, int generation, byte[] updatingKey, String nodeUri, byte[] signingKey, Long validFrom, byte[] previousDigest, byte[] signature)
    Registers or updates the given name in the Moera Naming Service.
  • Method Details

    • put

      UUID put(String name, int generation, byte[] updatingKey, String nodeUri, byte[] signingKey, Long validFrom, byte[] previousDigest, byte[] signature)
      Registers or updates the given name in the Moera Naming Service. See Architecture Overview for the detailed description of the algorithm.
      Parameters:
      name - the name to be registered or updated. Required.
      generation - the generation of the name. Required.
      updatingKey - the public key for verifying signatures of further updates of the name. May be null – the current key is preserved in this case.
      nodeUri - URI of the REST API endpoint of the node to which the name is assigned. May be null – the current URI is preserved in this case.
      signingKey - the public signing key of the name owner. May be null – the current key is preserved in this case.
      validFrom - the moment in time (in epoch seconds) the owner's key is valid from. May be null, if signingKey is also null.
      previousDigest - the unique identifier as reported by a naming server of the current state of the name. Used to detect the situations when the name was changed by someone else between sending the request and processing it. May be null, if the name was never registered before.
      signature - the signature, if required, null otherwise.
      Returns:
      the unique operation ID, which can be used to track the status of the operation
    • getStatus

      OperationStatusInfo getStatus(UUID operationId)
      Retrieves the status of the operation based on the provided operation ID.
      Parameters:
      operationId - the unique identifier of the operation
      Returns:
      an OperationStatusInfo object containing details about the operation's status, or null if the operation ID is unknown
    • getCurrent

      RegisteredNameInfo getCurrent(String name, int generation)
      Retrieves the current state of a registered name based on the specified name and generation.
      Parameters:
      name - the name for which the current state is to be retrieved
      generation - the generation of the name for which the current state is required
      Returns:
      a RegisteredNameInfo object containing the current state information of the registered name, or null if the name with the specified generation is not found.
    • getPast

      RegisteredNameInfo getPast(String name, int generation, long at)
      Retrieves historical information about a registered name at a specific point in time.
      Parameters:
      name - the name to retrieve information for
      generation - the generation of the name to retrieve information for
      at - the specific timestamp (in epoch seconds) for which the historical information is requested
      Returns:
      a RegisteredNameInfo object containing details about the registered name at the specified time, or null if no matching information is found.
    • isFree

      boolean isFree(String name, int generation)
      Checks whether a given name is free for registration in the naming service.
      Parameters:
      name - the name to be checked for availability
      generation - the generation of the name to check
      Returns:
      true if the name is free for the specified generation, false otherwise
    • getAllKeys

      List<SigningKeyInfo> getAllKeys(String name, int generation)
      Retrieves all signing keys associated with the specified name and generation.
      Parameters:
      name - the name for which the signing keys are to be retrieved
      generation - the generation of the name
      Returns:
      a list of SigningKeyInfo objects containing signing keys and their validity periods
    • getSimilar

      RegisteredNameInfo getSimilar(String name)
      Retrieves a RegisteredNameInfo object that represents a name similar to the specified name. This may be useful for obtaining details of a name that closely resembles the one provided.
      Parameters:
      name - the name to search for a similar registered name
      Returns:
      an instance of RegisteredNameInfo containing details of a similar registered name, or null if no similar name is found.
    • getAll

      List<RegisteredNameInfo> getAll(long at, int page, int size)
      Retrieves a paginated list of all registered names up to a specific moment in time.
      Parameters:
      at - the timestamp (in epoch seconds) up to which the registered names are returned
      page - the page number of the results (starting from 0)
      size - the number of entries per page
      Returns:
      a list of RegisteredNameInfo containing details of the registered names
    • getAllNewer

      List<RegisteredNameInfo> getAllNewer(long at, int page, int size)
      Retrieves a list of registered names that were created or updated after the specified timestamp. The results are paginated based on the provided page number and size.
      Parameters:
      at - the timestamp (in epoch seconds) to filter names that are newer
      page - the page number of the results (starting from 0)
      size - the number of entries per page
      Returns:
      a list of RegisteredNameInfo objects representing the names that match the criteria, or an empty list if no such names exist