Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk
Class RegisteredNodeAddressBookQuery
java.lang.Object
com.hedera.hashgraph.sdk.RegisteredNodeAddressBookQuery
Query the mirror node for the RegisteredAddressBook.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecutes the query with the user supplied clientExecutes the query with the user supplied client and timeoutexecuteAsync(Client client) Executes the query asynchronously with the user supplied clientexecuteAsync(Client client, Duration timeout) Executes the query asynchronously with the user supplied client with timeoutintgetLimit()Gets the page size limit currently set for the REST requests.intExtract the maximum number of attempts.Extract the maximum backoff duration.longReturns the set registered node ID.setLimit(int limit) Sets the maximum number of registered nodes to return per REST API request (page size).setMaxAttempts(int maxAttempts) Set the maximum number of attempts for the query.setMaxBackoff(Duration maxBackoff) Set the maximum backoff duration for retry attempts.setRegisteredNodeId(long registeredNodeId) Sets the ID of the registered node to retrieve.
-
Constructor Details
-
RegisteredNodeAddressBookQuery
public RegisteredNodeAddressBookQuery()
-
-
Method Details
-
getRegisteredNodeId
public long getRegisteredNodeId()Returns the set registered node ID.- Returns:
- The registered node ID.
-
setRegisteredNodeId
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
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
Set the maximum number of attempts for the query.- Parameters:
maxAttempts- the maximum number of attempts- Returns:
this
-
getMaxBackoff
Extract the maximum backoff duration.- Returns:
- the maximum backoff duration
-
setMaxBackoff
Set the maximum backoff duration for retry attempts.- Parameters:
maxBackoff- the maximum backoff duration- Returns:
this
-
execute
public RegisteredNodeAddressBook execute(Client client) throws ExecutionException, InterruptedException 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
public RegisteredNodeAddressBook execute(Client client, Duration timeout) throws ExecutionException, InterruptedException 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
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
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.
-