RoutexRefreshAsyncClient

Java-friendly async facade for RoutexRefreshClient: every public method is exposed here as an instance method returning CompletableFuture. Kotlin callers should use RoutexRefreshClient directly; this class is intended for Java consumers and other JVM languages that integrate with CompletableFuture.

The conceptual model carries over from RoutexRefreshClient: each call is authorized by a typed Ticket and uses a ConnectionData envelope (obtained from a prior interactive flow's Response.Result.connectionData). There is no interrupt loop; calls either return a NonInteractiveResponse with the typed payload, or throw a RoutexError subclass. The two that signal "drive a fresh interactive flow" are InterruptError (the umbrella signal when the bank wants user input on a non-interactive call) and ConsentExpired (the typed signal that the consent itself has expired or been revoked).

Usage

try (RoutexRefreshAsyncClient refresh = new RoutexRefreshAsyncClient()) {
refresh
.balances(ticket, connectionData, accountReferences)
.whenComplete(
(response, error) -> {
if (error != null) {
// RoutexError subclass, RoutexClientError, or I/O exception
handleFailure(error);
return;
}
Balances balances = response.getResult();
// ...
});
}

Calling CompletableFuture.get / CompletableFuture.join instead rewraps failures in ExecutionException (get) or CompletionException (join); unwrap with e.getCause() to recover the underlying exception.

Lifecycle

The supplied Executor (default ForkJoinPool.commonPool) backs every emitted future. close cancels in-flight futures with CancellationException and rejects later calls. Instances are safe to share across threads.

Constructors

Link copied to clipboard
constructor(baseUrl: Url = DEFAULT_BASE_URL, httpTransport: HttpTransport = defaultHttpTransport(), executor: Executor = ForkJoinPool.commonPool())

Construct a client.

constructor(baseUrl: String, httpTransport: HttpTransport = defaultHttpTransport(), executor: Executor = ForkJoinPool.commonPool())

Convenience overload that parses baseUrl as a Ktor Url.

Functions

Link copied to clipboard
fun accounts(ticket: Ticket.Accounts, connectionData: ConnectionData, fields: List<AccountField<*>>, filter: AccountFilter? = null, session: Session? = null): CompletableFuture<NonInteractiveResponse<List<Account>>>

Refresh accounts (and selected fields) for the connection encoded in connectionData.

Link copied to clipboard

Refresh current balances for accounts under connectionData.

Link copied to clipboard
open override fun close()

Cancel in-flight futures and release the underlying coroutine scope.

Link copied to clipboard

Fetch metadata for a single service connection.

Link copied to clipboard
fun search(ticket: Ticket, filters: List<SearchFilter>, ibanDetection: Boolean = false, limit: Int? = null, details: List<ConnectionDetails> = emptyList()): CompletableFuture<List<ConnectionInfo>>

Search for service connections (banks and other providers).

Link copied to clipboard

Authenticated TEE system version learned during settlement of ticket's key-settlement session.

Link copied to clipboard

Refresh booked-and-pending transactions for connectionData.