Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CompositeConnectionResolver

Helper class that resolves connection and credential parameters, validates them and generates connection options.

Configuration parameters

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

References

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

Hierarchy

  • CompositeConnectionResolver

Implements

  • any
  • any

Index

Properties

Protected _clusterSupported

_clusterSupported: boolean = true

The cluster support (multiple connections)

Protected _connectionResolver

_connectionResolver: ConnectionResolver = new ConnectionResolver()

The connections resolver.

Protected _credentialResolver

_credentialResolver: CredentialResolver = new CredentialResolver()

The credentials resolver.

Protected _defaultPort

_defaultPort: number = 0

The default port number

Protected _defaultProtocol

_defaultProtocol: string = null

The default protocol

Protected _options

_options: ConfigParams

The connection options

Protected _supportedProtocols

_supportedProtocols: string[] = null

The list of supported protocols

Methods

compose

  • Composes Composite connection options from connection and credential parameters.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • connections: ConnectionParams[]

      connection parameters

    • credential: CredentialParams

      credential parameters

    • parameters: ConfigParams

      optional parameters

    • callback: function

      callback function that receives resolved options or error.

        • (err: any, options: any): void
        • Parameters

          • err: any
          • options: any

          Returns void

    Returns void

Protected composeOptions

  • Composes connection and credential parameters into connection options. This method can be overriden in child classes.

    Parameters

    • connections: ConnectionParams[]

      a list of connection parameters

    • credential: CredentialParams

      credential parameters

    • parameters: ConfigParams

      optional parameters

    Returns ConfigParams

    a composed connection options.

configure

  • configure(config: ConfigParams): void
  • Configures component by passing configuration parameters.

    Parameters

    • config: ConfigParams

      configuration parameters to be set.

    Returns void

Protected finalizeOptions

  • finalizeOptions(options: ConfigParams): ConfigParams
  • Finalize merged options This method can be overriden in child classes.

    Parameters

    • options: ConfigParams

      connection options

    Returns ConfigParams

    finalized connection options

Protected mergeConnection

  • mergeConnection(options: ConfigParams, connection: ConnectionParams): ConfigParams
  • Merges connection options with connection parameters This method can be overriden in child classes.

    Parameters

    • options: ConfigParams

      connection options

    • connection: ConnectionParams

      connection parameters to be merged

    Returns ConfigParams

    merged connection options.

Protected mergeCredential

  • mergeCredential(options: ConfigParams, credential: CredentialParams): ConfigParams
  • Merges connection options with credential parameters This method can be overriden in child classes.

    Parameters

    • options: ConfigParams

      connection options

    • credential: CredentialParams

      credential parameters to be merged

    Returns ConfigParams

    merged connection options.

Protected mergeOptional

  • mergeOptional(options: ConfigParams, parameters: ConfigParams): ConfigParams
  • Merges connection options with optional parameters This method can be overriden in child classes.

    Parameters

    • options: ConfigParams

      connection options

    • parameters: ConfigParams

      optional parameters to be merged

    Returns ConfigParams

    merged connection options.

resolve

  • resolve(correlationId: string, callback: function): void
  • Resolves connection options from connection and credential parameters.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • callback: function

      callback function that receives resolved options or error.

        • (err: any, options: ConfigParams): void
        • Parameters

          • err: any
          • options: ConfigParams

          Returns void

    Returns void

setReferences

  • setReferences(references: IReferences): void
  • Sets references to dependent components.

    Parameters

    • references: IReferences

      references to locate the component dependencies.

    Returns void

Protected validateConnection

  • Validates connection parameters. This method can be overriden in child classes.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • connection: ConnectionParams

      connection parameters to be validated

    Returns any

    error or null if validation was successful

Protected validateCredential

  • Validates credential parameters. This method can be overriden in child classes.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • credential: CredentialParams

      credential parameters to be validated

    Returns any

    error or null if validation was successful

Generated using TypeDoc