Class AddressBookQuery

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

public class AddressBookQuery extends Object
Query the mirror node for the address book.
  • Constructor Details

    • AddressBookQuery

      public AddressBookQuery()
      Constructor.
  • Method Details

    • getFileId

      @Nullable public FileId getFileId()
      Extract the file id.
      Returns:
      the file id that was assigned
    • setFileId

      public AddressBookQuery setFileId(FileId fileId)
      Assign the file id of address book to retrieve.
      Parameters:
      fileId - the file id of the address book
      Returns:
      this
    • getLimit

      @Nullable public Integer getLimit()
      Extract the limit number.
      Returns:
      the limit number that was assigned
    • setLimit

      public AddressBookQuery setLimit(@Nullable @Nonnegative Integer limit)
      Assign the number of node addresses to retrieve or all nodes set to 0.
      Parameters:
      limit - number of node addresses to get
      Returns:
      this
    • getMaxAttempts

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

      public AddressBookQuery setMaxAttempts(@Nonnegative int maxAttempts)
      Assign the maximum number of attempts.
      Parameters:
      maxAttempts - the maximum number of attempts
      Returns:
      this
    • setMaxBackoff

      public AddressBookQuery setMaxBackoff(Duration maxBackoff)
      Assign the maximum backoff duration.
      Parameters:
      maxBackoff - the maximum backoff duration
      Returns:
      this
    • execute

      public NodeAddressBook execute(Client client)
      Execute the query with preset timeout.
      Parameters:
      client - the client object
      Returns:
      the node address book
    • execute

      public NodeAddressBook execute(Client client, Duration timeout)
      Execute the query with user supplied timeout.
      Parameters:
      client - the client object
      timeout - the user supplied timeout
      Returns:
      the node address book
    • executeAsync

      public CompletableFuture<NodeAddressBook> executeAsync(Client client)
      Execute the query with preset timeout asynchronously.
      Parameters:
      client - the client object
      Returns:
      the node address book
    • executeAsync

      public CompletableFuture<NodeAddressBook> executeAsync(Client client, Duration timeout)
      Execute the query with user supplied timeout.
      Parameters:
      client - the client object
      timeout - the user supplied timeout
      Returns:
      the node address book
    • executeAsync

      void executeAsync(Client client, io.grpc.Deadline deadline, CompletableFuture<NodeAddressBook> returnFuture, int attempt)
      Execute the query.
      Parameters:
      client - the client object
      deadline - the user supplied timeout
      returnFuture - returned promise callback
      attempt - maximum number of attempts
    • buildQuery

      AddressBookQuery buildQuery()
      Build the address book query.
      Returns:
      buildQuery