Class RegisteredNodeAddressBookQuery

java.lang.Object
com.hedera.hashgraph.sdk.RegisteredNodeAddressBookQuery

public class RegisteredNodeAddressBookQuery extends Object
Query the mirror node for the RegisteredAddressBook.
  • Constructor Details

    • RegisteredNodeAddressBookQuery

      public RegisteredNodeAddressBookQuery()
  • Method Details

    • getRegisteredNodeId

      public long getRegisteredNodeId()
      Returns the set registered node ID.
      Returns:
      The registered node ID.
    • setRegisteredNodeId

      public RegisteredNodeAddressBookQuery setRegisteredNodeId(long registeredNodeId)
      Sets the ID of the registered node to retrieve.
      Parameters:
      registeredNodeId - The unique identifier of the node.
      Returns:
      this
    • getLimit

      public int getLimit()
      Gets the page size limit currently set for the REST requests.
      Returns:
      The maximum number of nodes requested per page.
    • setLimit

      public RegisteredNodeAddressBookQuery setLimit(int limit)
      Sets the maximum number of registered nodes to return per REST API request (page size). Note: The query will still follow 'next' links to fetch all available nodes.
      Parameters:
      limit - The maximum number of nodes to return per request.
      Returns:
      this
    • getMaxAttempts

      public int getMaxAttempts()
      Extract the maximum number of attempts.
      Returns:
      the maximum number of attempts
    • setMaxAttempts

      public RegisteredNodeAddressBookQuery setMaxAttempts(int maxAttempts)
      Set the maximum number of attempts for the query.
      Parameters:
      maxAttempts - the maximum number of attempts
      Returns:
      this
    • getMaxBackoff

      public Duration getMaxBackoff()
      Extract the maximum backoff duration.
      Returns:
      the maximum backoff duration
    • setMaxBackoff

      public RegisteredNodeAddressBookQuery setMaxBackoff(Duration maxBackoff)
      Set the maximum backoff duration for retry attempts.
      Parameters:
      maxBackoff - the maximum backoff duration
      Returns:
      this
    • execute

      Executes the query with the user supplied client
      Parameters:
      client - The Client instance to perform the operation with.
      Returns:
      The retrieved RegisteredNodeAddressBook.
      Throws:
      ExecutionException - if the query fails.
      InterruptedException - if the thread is interrupted.
    • execute

      Executes the query with the user supplied client and timeout
      Parameters:
      client - The Client instance to perform the operation with.
      timeout - The maximum duration for each individual HTTP request.
      Returns:
      The retrieved RegisteredNodeAddressBook.
      Throws:
      ExecutionException - if the query fails.
      InterruptedException - if the thread is interrupted.
    • executeAsync

      public CompletableFuture<RegisteredNodeAddressBook> executeAsync(Client client)
      Executes the query asynchronously with the user supplied client
      Parameters:
      client - The Client instance to perform the operation with.
      Returns:
      A future representing the retrieved RegisteredNodeAddressBook.
    • executeAsync

      public CompletableFuture<RegisteredNodeAddressBook> executeAsync(Client client, Duration timeout)
      Executes the query asynchronously with the user supplied client with timeout
      Parameters:
      client - The Client instance to perform the operation with.
      timeout - The maximum duration for each individual HTTP request.
      Returns:
      A future representing the retrieved RegisteredNodeAddressBook.