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
ALedgerClientimplementation that connects to an existing Ledger and provides clients to query it. To use theDamlLedgerClient:- 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.
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
SslContextobject 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 classDamlLedgerClient.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconnect()Connects this instance of theDamlLedgerClientto the Ledger.ActiveContractsClientgetActiveContractSetClient()CommandClientgetCommandClient()CommandCompletionClientgetCommandCompletionClient()CommandSubmissionClientgetCommandSubmissionClient()LedgerConfigurationClientgetLedgerConfigurationClient()java.lang.StringgetLedgerId()LedgerIdentityClientgetLedgerIdentityClient()PackageClientgetPackageClient()TimeClientgetTimeClient()TransactionsClientgetTransactionsClient()UserManagementClientgetUserManagementClient()static DamlLedgerClient.BuildernewBuilder(@NonNull io.grpc.netty.NettyChannelBuilder channelBuilder)Create a newDamlLedgerClient.Builderwith the given parametersstatic DamlLedgerClient.BuildernewBuilder(@NonNull java.lang.String host, int port)Create a newDamlLedgerClient.Builderwith the given parameters
-
-
-
Method Detail
-
newBuilder
public static DamlLedgerClient.Builder newBuilder(@NonNull java.lang.String host, int port)
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.
-
getLedgerId
public java.lang.String getLedgerId()
- Specified by:
getLedgerIdin interfaceLedgerClient- Returns:
- The identifier of the Ledger connected to this
LedgerClient
-
getActiveContractSetClient
public ActiveContractsClient getActiveContractSetClient()
- Specified by:
getActiveContractSetClientin interfaceLedgerClient
-
getTransactionsClient
public TransactionsClient getTransactionsClient()
- Specified by:
getTransactionsClientin interfaceLedgerClient
-
getCommandClient
public CommandClient getCommandClient()
- Specified by:
getCommandClientin interfaceLedgerClient
-
getCommandCompletionClient
public CommandCompletionClient getCommandCompletionClient()
- Specified by:
getCommandCompletionClientin interfaceLedgerClient
-
getCommandSubmissionClient
public CommandSubmissionClient getCommandSubmissionClient()
- Specified by:
getCommandSubmissionClientin interfaceLedgerClient
-
getLedgerIdentityClient
public LedgerIdentityClient getLedgerIdentityClient()
- Specified by:
getLedgerIdentityClientin interfaceLedgerClient
-
getPackageClient
public PackageClient getPackageClient()
- Specified by:
getPackageClientin interfaceLedgerClient
-
getLedgerConfigurationClient
public LedgerConfigurationClient getLedgerConfigurationClient()
- Specified by:
getLedgerConfigurationClientin interfaceLedgerClient
-
getTimeClient
public TimeClient getTimeClient()
- Specified by:
getTimeClientin interfaceLedgerClient
-
getUserManagementClient
public UserManagementClient getUserManagementClient()
- Specified by:
getUserManagementClientin interfaceLedgerClient
-
close
public void close() throws java.lang.Exception- Throws:
java.lang.Exception
-
-