Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing an independent session to a QLDB ledger that handles endpoint requests. This class is used in QldbDriver and QldbSessionImpl. This class is not meant to be used directly by developers.

Hierarchy

  • Communicator

Index

Constructors

Private constructor

  • new Communicator(qldbClient: QLDBSession, ledgerName: string, sessionToken: string): Communicator
  • Creates a Communicator.

    Parameters

    • qldbClient: QLDBSession

      The low level service client.

    • ledgerName: string

      The QLDB ledger name.

    • sessionToken: string

      The initial session token representing the session connection.

    Returns Communicator

Properties

Private _ledgerName

_ledgerName: string

Private _qldbClient

_qldbClient: QLDBSession

Private _sessionToken

_sessionToken: string

Methods

Private _sendCommand

  • _sendCommand(request: SendCommandRequest): Promise<SendCommandResult>
  • Call the sendCommand method of the low level service client.

    Parameters

    • request: SendCommandRequest

      A SendCommandRequest object containing the request information to be sent to QLDB.

    Returns Promise<SendCommandResult>

    Promise which fulfills with a SendCommandResult object.

abortTransaction

  • abortTransaction(): Promise<AbortTransactionResult>
  • Send request to abort the currently active transaction.

    Returns Promise<AbortTransactionResult>

    Promise which fulfills with the abort transaction response returned from QLDB.

commit

  • commit(txnId: string, commitDigest: CommitDigest): Promise<CommitTransactionResult>
  • Send request to commit the currently active transaction.

    Parameters

    • txnId: string

      The ID of the transaction.

    • commitDigest: CommitDigest

      The digest hash of the transaction to commit.

    Returns Promise<CommitTransactionResult>

    Promise which fulfills with the commit transaction response returned from QLDB.

endSession

  • endSession(): Promise<void>
  • Send request to end the independent session represented by the instance of this class.

    Returns Promise<void>

    Promise which fulfills with void.

executeStatement

  • executeStatement(txnId: string, statement: string, parameters: ValueHolder[]): Promise<ExecuteStatementResult>
  • Send an execute statement request with parameters to QLDB.

    Parameters

    • txnId: string

      The ID of the transaction.

    • statement: string

      The statement to execute.

    • parameters: ValueHolder[]

      The parameters of the statement contained in ValueHolders.

    Returns Promise<ExecuteStatementResult>

    Promise which fulfills with the execute statement response returned from QLDB.

fetchPage

  • fetchPage(txnId: string, pageToken: PageToken): Promise<FetchPageResult>
  • Send fetch result request to QLDB, retrieving the next chunk of data for the result.

    Parameters

    • txnId: string

      The ID of the transaction.

    • pageToken: PageToken

      The token to fetch the next page.

    Returns Promise<FetchPageResult>

    Promise which fulfills with the fetch page response returned from QLDB.

getLedgerName

  • getLedgerName(): string

getQldbClient

  • getQldbClient(): QLDBSession
  • Get the low-level service client that communicates with QLDB.

    Returns QLDBSession

    The low-level service client.

getSessionToken

  • getSessionToken(): string
  • Get the session token representing the session connection.

    Returns string

    The session token.

startTransaction

  • startTransaction(): Promise<StartTransactionResult>
  • Send a request to start a transaction.

    Returns Promise<StartTransactionResult>

    Promise which fulfills with the start transaction response returned from QLDB.

Static create

  • create(qldbClient: QLDBSession, ledgerName: string): Promise<Communicator>
  • Static factory method that creates a Communicator object.

    Parameters

    • qldbClient: QLDBSession

      The low level client that communicates with QLDB.

    • ledgerName: string

      The QLDB ledger name.

    Returns Promise<Communicator>

    Promise which fulfills with a Communicator.

Generated using TypeDoc