CouchbaseConnectionResolver

Helper class that resolves Couchbase connection and credential parameters, validates them and generates a connection URI.

Extends: CompositeConnectionResolver

Description

The CouchbaseConnectionResolver class is used to resolve Couchbase connections and credential parameters, validate them and generate connection URIs/

Important points

  • It is able to process multiple connections to Couchbase cluster nodes.

Configuration parameters

  • connection(s):
    • discovery_key: (optional) key to retrieve the connection from IDiscovery
    • host: host name or IP address
    • port: port number (default: 27017)
    • database: database (bucket) name
    • uri: resource URI or connection string with all parameters in it
  • credential(s):
    • store_key: (optional) key to retrieve the credentials from ICredentialStore
    • username: username
    • password: user’s password

References

  • *:discovery:*:*:1.0 - (optional) IDiscovery services
  • *:credential-store:*:*:1.0 - (optional) ICredentialStore stores to resolve credentials

Fields

_connectionResolver

Connection resolver

protected _connectionResolver: ConnectionResolver

_credentialResolver

Credential resolver

protected _credentialResolver: CredentialResolver

Constructors

Creates an instance of this class.

public constructor()

Instance methods

resolve

Merges connection options with connection parameters. This method can be overriden in child classes.

public resolve(context: IContext: Promise<CouchbaseConnectionParams>

setReferences

Sets references to dependent components.

public setReferences(references: IReferences): void

  • references: IReferences - references to locate the component’s dependencies.