Package com.daml.ledger.rxjava
Class DamlLedgerClient
- java.lang.Object
-
- com.daml.ledger.rxjava.DamlLedgerClient
-
- All Implemented Interfaces:
LedgerClient
public final class DamlLedgerClient extends java.lang.Object implements LedgerClient
ALedgerClient
implementation that connects to an existing Ledger and provides clients to query it. To use theDamlLedgerClient
:- 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.
getActiveContractSetClient()
Alternatively to
newBuilder(String, int)
, you can usenewBuilder(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 Modifier and Type Class Description static class
DamlLedgerClient.Builder
-
Method Summary
-
-
-
Method Detail
-
newBuilder
public static DamlLedgerClient.Builder newBuilder(@NonNull java.lang.String host, int port)
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.
-
getLedgerId
public java.lang.String getLedgerId()
- Specified by:
getLedgerId
in interfaceLedgerClient
- Returns:
- The identifier of the Ledger connected to this
LedgerClient
-
getActiveContractSetClient
public ActiveContractsClient getActiveContractSetClient()
- Specified by:
getActiveContractSetClient
in interfaceLedgerClient
-
getTransactionsClient
public TransactionsClient getTransactionsClient()
- Specified by:
getTransactionsClient
in interfaceLedgerClient
-
getCommandClient
public CommandClient getCommandClient()
- Specified by:
getCommandClient
in interfaceLedgerClient
-
getCommandCompletionClient
public CommandCompletionClient getCommandCompletionClient()
- Specified by:
getCommandCompletionClient
in interfaceLedgerClient
-
getCommandSubmissionClient
public CommandSubmissionClient getCommandSubmissionClient()
- Specified by:
getCommandSubmissionClient
in interfaceLedgerClient
-
getLedgerIdentityClient
@Deprecated public LedgerIdentityClient getLedgerIdentityClient()
Deprecated.- Specified by:
getLedgerIdentityClient
in interfaceLedgerClient
-
getPackageClient
public PackageClient getPackageClient()
- Specified by:
getPackageClient
in interfaceLedgerClient
-
getLedgerConfigurationClient
public LedgerConfigurationClient getLedgerConfigurationClient()
- Specified by:
getLedgerConfigurationClient
in interfaceLedgerClient
-
getTimeClient
public TimeClient getTimeClient()
- Specified by:
getTimeClient
in interfaceLedgerClient
-
getUserManagementClient
public UserManagementClient getUserManagementClient()
- Specified by:
getUserManagementClient
in interfaceLedgerClient
-
close
public void close() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-