Class Bot
- java.lang.Object
-
- com.daml.ledger.rxjava.components.Bot
-
public class Bot extends java.lang.ObjectA Bot is an automation that reacts to changes in the ledger by submitting zero or more commands. This class contains helpers to create bots. The main helper iswire(String, LedgerClient, TransactionFilter, Function, Function).
-
-
Constructor Summary
Constructors Constructor Description Bot()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R> io.reactivex.disposables.Disposablewire(java.lang.String applicationId, LedgerClient ledgerClient, com.daml.ledger.javaapi.data.TransactionFilter transactionFilter, java.util.function.Function<LedgerViewFlowable.LedgerView<R>,io.reactivex.Flowable<CommandsAndPendingSet>> bot, java.util.function.Function<CreatedContract,R> transform)Wires the Bot logic to an existingLedgerClientinstance.static <R> io.reactivex.disposables.Disposablewire(java.lang.String applicationId, LedgerClient ledgerClient, com.daml.ledger.javaapi.data.TransactionFilter transactionFilter, java.util.function.Function<LedgerViewFlowable.LedgerView<R>,io.reactivex.Flowable<CommandsAndPendingSet>> bot, java.util.function.Function<CreatedContract,R> transform, io.reactivex.Scheduler scheduler)Wires the Bot logic to an existingLedgerClientinstance.static io.reactivex.disposables.DisposablewireSimple(java.lang.String appId, LedgerClient ledgerClient, com.daml.ledger.javaapi.data.TransactionFilter transactionFilter, java.util.function.Function<LedgerViewFlowable.LedgerView<CreatedContract>,io.reactivex.Flowable<CommandsAndPendingSet>> bot)Wires the Bot logic to an existingLedgerClientinstance, storingCreatedContractinstances in theLedgerViewFlowable.LedgerView.
-
-
-
Method Detail
-
wire
public static <R> io.reactivex.disposables.Disposable wire(java.lang.String applicationId, LedgerClient ledgerClient, com.daml.ledger.javaapi.data.TransactionFilter transactionFilter, java.util.function.Function<LedgerViewFlowable.LedgerView<R>,io.reactivex.Flowable<CommandsAndPendingSet>> bot, java.util.function.Function<CreatedContract,R> transform)Wires the Bot logic to an existingLedgerClientinstance.- Type Parameters:
R- The type of the result of transform.- Parameters:
applicationId- The application identifier that will be sent to the LedgerledgerClient- TheLedgerClientinstance which will be wired to the bot.transactionFilter- A server-side filter of incoming transactionsbot- The business logic of the bot.transform- A function from the arguments of a Contract on the Ledger to a more refined type R. This can be used by the developer to, for instance, discard the fields of a Contract that are not needed and save space.- Returns:
- The subscription representing the connection.
-
wire
public static <R> io.reactivex.disposables.Disposable wire(java.lang.String applicationId, LedgerClient ledgerClient, com.daml.ledger.javaapi.data.TransactionFilter transactionFilter, java.util.function.Function<LedgerViewFlowable.LedgerView<R>,io.reactivex.Flowable<CommandsAndPendingSet>> bot, java.util.function.Function<CreatedContract,R> transform, io.reactivex.Scheduler scheduler)Wires the Bot logic to an existingLedgerClientinstance.- Type Parameters:
R- The type of the result of transform.- Parameters:
applicationId- The application identifier that will be sent to the LedgerledgerClient- TheLedgerClientinstance which will be wired to the bot.transactionFilter- A server-side filter of incoming transactionsbot- The business logic of the bot.transform- A function from the arguments of a Contract on the Ledger to a more refined type R. This can be used by the developer to, for instance, discard the fields of a Contract that are not needed and save space.scheduler- The scheduler used to run the flows- Returns:
- The subscription representing the connection.
-
wireSimple
public static io.reactivex.disposables.Disposable wireSimple(java.lang.String appId, LedgerClient ledgerClient, com.daml.ledger.javaapi.data.TransactionFilter transactionFilter, java.util.function.Function<LedgerViewFlowable.LedgerView<CreatedContract>,io.reactivex.Flowable<CommandsAndPendingSet>> bot)Wires the Bot logic to an existingLedgerClientinstance, storingCreatedContractinstances in theLedgerViewFlowable.LedgerView.- Parameters:
appId- The application identifier that will be sent to the LedgerledgerClient- TheLedgerClientinstance which will be wired to the bot.transactionFilter- A server-side filter of incoming transactionsbot- The business logic of the bot.- Returns:
-
-