Interface OpenBuilder

All Superinterfaces:
OpBuilder<ReadHandle>
All Known Implementing Classes:
LedgerOpenOp.OpenBuilderImpl, OpenBuilderBase

@Public @Unstable public interface OpenBuilder extends OpBuilder<ReadHandle>
Builder-style interface to open exiting ledgers.
Since:
4.6
  • Method Details

    • withLedgerId

      OpenBuilder withLedgerId(long ledgerId)
      Set the id of the ledger to be opened.
      Parameters:
      ledgerId -
      Returns:
      the builder itself
    • withRecovery

      OpenBuilder withRecovery(boolean recovery)
      Define to open the ledger in recovery mode or in readonly mode. In recovery mode the ledger will be fenced and the writer of the ledger will be prevented from issuing other writes to the ledger. It defaults to 'false'
      Parameters:
      recovery - recovery mode
      Returns:
      the builder itself
    • withPassword

      OpenBuilder withPassword(byte[] password)
      Sets the password to be used to open the ledger. It defaults to an empty password
      Parameters:
      password - the password to unlock the ledger
      Returns:
      the builder itself
    • withDigestType

      OpenBuilder withDigestType(DigestType digestType)
      Sets the expected digest type used to check the contents of the ledger. It defaults to DigestType.CRC32. If ClientConfiguration.setEnableDigestTypeAutodetection(boolean) is set to true this value is ignored and the digest type is read directly from metadata
      Parameters:
      digestType - the type of digest
      Returns:
      the builder itself