java.lang.Object
com.hedera.hashgraph.sdk.AddressBookQuery
Query the mirror node for the address book.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) AddressBookQueryBuild the address book query.Execute the query with preset timeout.Execute the query with user supplied timeout.executeAsync(Client client) Execute the query with preset timeout asynchronously.(package private) voidexecuteAsync(Client client, io.grpc.Deadline deadline, CompletableFuture<NodeAddressBook> returnFuture, int attempt) Execute the query.executeAsync(Client client, Duration timeout) Execute the query with user supplied timeout.Extract the file id.getLimit()Extract the limit number.intExtract the maximum number of attempts.Assign the file id of address book to retrieve.Assign the number of node addresses to retrieve or all nodes set to 0.setMaxAttempts(int maxAttempts) Assign the maximum number of attempts.setMaxBackoff(Duration maxBackoff) Assign the maximum backoff duration.
-
Constructor Details
-
AddressBookQuery
public AddressBookQuery()Constructor.
-
-
Method Details
-
getFileId
Extract the file id.- Returns:
- the file id that was assigned
-
setFileId
Assign the file id of address book to retrieve.- Parameters:
fileId- the file id of the address book- Returns:
this
-
getLimit
Extract the limit number.- Returns:
- the limit number that was assigned
-
setLimit
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
Assign the maximum number of attempts.- Parameters:
maxAttempts- the maximum number of attempts- Returns:
this
-
setMaxBackoff
Assign the maximum backoff duration.- Parameters:
maxBackoff- the maximum backoff duration- Returns:
this
-
execute
Execute the query with preset timeout.- Parameters:
client- the client object- Returns:
- the node address book
-
execute
Execute the query with user supplied timeout.- Parameters:
client- the client objecttimeout- the user supplied timeout- Returns:
- the node address book
-
executeAsync
Execute the query with preset timeout asynchronously.- Parameters:
client- the client object- Returns:
- the node address book
-
executeAsync
Execute the query with user supplied timeout.- Parameters:
client- the client objecttimeout- 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 objectdeadline- the user supplied timeoutreturnFuture- returned promise callbackattempt- maximum number of attempts
-
buildQuery
AddressBookQuery buildQuery()Build the address book query.- Returns:
buildQuery
-