Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CbsClient

Package version

Hierarchy

  • CbsClient

Index

Constructors

constructor

  • new CbsClient(connection: Connection, connectionLock: string): CbsClient

Properties

cbsLock

cbsLock: string = `${Constants.negotiateCbsKey}-${generate_uuid()}`
property

{string} cbsLock The unique lock name per $cbs session per connection that is used to acquire the lock for establishing a cbs session if one does not exist for an amqp connection.

connection

connection: Connection
property

{Connection} connection The AMQP connection.

connectionLock

connectionLock: string
property

{string} connectionLock The unique lock name per connection that is used to acquire the lock for establishing an amqp connection if one does not exist.

endpoint

endpoint: string = Constants.cbsEndpoint
property

{string} endpoint CBS endpoint - "$cbs"

replyTo

replyTo: string = `${Constants.cbsReplyTo}-${generate_uuid()}`
property

{string} replyTo CBS replyTo - The receiver link name that the service should reply to.

Methods

close

  • close(): Promise<void>

init

  • init(): Promise<void>

negotiateClaim

  • Negotiates the CBS claim with the EventHub/ServiceBus Service.

    Parameters

    • audience: string

      The entity token audience for which the token is requested in one of the following forms:

      • ServiceBus

        • Sender

          • "sb://<yournamespace>.servicebus.windows.net/<queue-name>"
          • "sb://<yournamespace>.servicebus.windows.net/<topic-name>"
        • Receiver

          • "sb://<yournamespace>.servicebus.windows.net/<queue-name>"
          • "sb://<yournamespace>.servicebus.windows.net/<topic-name>"
        • ManagementClient

          • "sb://<your-namespace>.servicebus.windows.net/<queue-name>/$management".
          • "sb://<your-namespace>.servicebus.windows.net/<topic-name>/$management".
      • EventHubs

        • Sender

          • "sb://<yournamespace>.servicebus.windows.net/<hubName>"
          • "sb://<yournamespace>.servicebus.windows.net/<hubName>/Partitions/<partitionId>".
        • Receiver

          • "sb://<your-namespace>.servicebus.windows.net/<event-hub-name>/ConsumerGroups/<consumer-group-name>/Partitions/<partition-id>".
        • ManagementClient

          • "sb://<your-namespace>.servicebus.windows.net/<event-hub-name>/$management".
    • token: string

      The token that needs to be sent in the put-token request.

    • tokenType: TokenType

    Returns Promise<CbsResponse>

    Returns a Promise that resolves when $cbs authentication is successful and rejects when an error occurs during $cbs authentication.

remove

  • remove(): void

Generated using TypeDoc