Package com.daml.ledger.rxjava
Class DamlLedgerClient
java.lang.Object
com.daml.ledger.rxjava.DamlLedgerClient
- All Implemented Interfaces:
LedgerClient
A
LedgerClient implementation that connects to an existing Ledger and provides clients to
query it. To use the DamlLedgerClient:
- Create an instance of a
DamlLedgerClient.BuilderusingnewBuilder(String, int) - Specify an expected ledger identifier,
SslContext, and/or access token, depending on your needs - Invoke
DamlLedgerClient.Builder.build()to finalize and construct aDamlLedgerClient - Call the method
connect()to initialize the clients for that particular ledger - Retrieve one of the clients by using a getter, e.g.
getStateClient()
Alternatively to newBuilder(String, int), you can use newBuilder(NettyChannelBuilder) to make sure you can specify additional
properties for the channel you're building, such as the maximum inbound message size.
For information on how to set up an SslContext object for mutual authentication please
refer to the section on
security in the grpc-java documentation.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidconnect()Connects this instance of theDamlLedgerClientto the Ledger.static DamlLedgerClient.BuildernewBuilder(@NonNull io.grpc.netty.NettyChannelBuilder channelBuilder) Create a newDamlLedgerClient.Builderwith the given parametersstatic DamlLedgerClient.BuildernewBuilder(@NonNull String host, int port) Create a newDamlLedgerClient.Builderwith the given parameters
-
Method Details
-
newBuilder
Create a newDamlLedgerClient.Builderwith the given parametersUseful as a shortcut unless you have to customize the
NettyChannelBuilderbeyond the builder's capabilities -
newBuilder
public static DamlLedgerClient.Builder newBuilder(@NonNull io.grpc.netty.NettyChannelBuilder channelBuilder) Create a newDamlLedgerClient.Builderwith the given parametersUseful to customize the
NettyChannelBuilderbeyond the builder's capabilities, otherwisenewBuilder(String, int)is probably more suited for your use case -
connect
public void connect()Connects this instance of theDamlLedgerClientto the Ledger. -
getStateClient
- Specified by:
getStateClientin interfaceLedgerClient- Returns:
- The identifier of the Ledger connected to this
LedgerClient
-
getTransactionsClient
- Specified by:
getTransactionsClientin interfaceLedgerClient
-
getCommandClient
- Specified by:
getCommandClientin interfaceLedgerClient
-
getCommandCompletionClient
- Specified by:
getCommandCompletionClientin interfaceLedgerClient
-
getCommandSubmissionClient
- Specified by:
getCommandSubmissionClientin interfaceLedgerClient
-
getEventQueryClient
- Specified by:
getEventQueryClientin interfaceLedgerClient
-
getPackageClient
- Specified by:
getPackageClientin interfaceLedgerClient
-
getTimeClient
- Specified by:
getTimeClientin interfaceLedgerClient
-
getUserManagementClient
- Specified by:
getUserManagementClientin interfaceLedgerClient
-
close
- Throws:
Exception
-