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.Builder
usingnewBuilder(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 TypeMethodDescriptionvoid
close()
void
connect()
Connects this instance of theDamlLedgerClient
to the Ledger.static DamlLedgerClient.Builder
newBuilder
(@NonNull io.grpc.netty.NettyChannelBuilder channelBuilder) Create a newDamlLedgerClient.Builder
with the given parametersstatic DamlLedgerClient.Builder
newBuilder
(@NonNull String host, int port) Create a newDamlLedgerClient.Builder
with the given parameters
-
Method Details
-
newBuilder
Create a newDamlLedgerClient.Builder
with the given parametersUseful as a shortcut unless you have to customize the
NettyChannelBuilder
beyond the builder's capabilities -
newBuilder
public static DamlLedgerClient.Builder newBuilder(@NonNull io.grpc.netty.NettyChannelBuilder channelBuilder) Create a newDamlLedgerClient.Builder
with the given parametersUseful to customize the
NettyChannelBuilder
beyond the builder's capabilities, otherwisenewBuilder(String, int)
is probably more suited for your use case -
connect
public void connect()Connects this instance of theDamlLedgerClient
to the Ledger. -
getStateClient
- Specified by:
getStateClient
in interfaceLedgerClient
- Returns:
- The identifier of the Ledger connected to this
LedgerClient
-
getTransactionsClient
- Specified by:
getTransactionsClient
in interfaceLedgerClient
-
getCommandClient
- Specified by:
getCommandClient
in interfaceLedgerClient
-
getCommandCompletionClient
- Specified by:
getCommandCompletionClient
in interfaceLedgerClient
-
getCommandSubmissionClient
- Specified by:
getCommandSubmissionClient
in interfaceLedgerClient
-
getEventQueryClient
- Specified by:
getEventQueryClient
in interfaceLedgerClient
-
getPackageClient
- Specified by:
getPackageClient
in interfaceLedgerClient
-
getTimeClient
- Specified by:
getTimeClient
in interfaceLedgerClient
-
getUserManagementClient
- Specified by:
getUserManagementClient
in interfaceLedgerClient
-
close
- Throws:
Exception
-