Helper class that resolves MySQL connection and credential parameters, validates them and generates a connection URI.
Implements: IReferenceable, IConfigurable
Description
The MySqlConnectionResolver class allows you to create a MySQL connection and credential parameters resolver that validates the parameters and generates a connection URI.
Important points
- It is able to process multiple connections to MySQL 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 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
Constructors
Creates a new instance of the connection component.
MySqlConnectionResolver()
Fields
Instance methods
configure
Configures components by passing configuration parameters.
configure(config: ConfigParams)
- config: ConfigParams - configuration parameters to be set.
resolve
Resolves a MySQL configuration from connection and credential parameters.
resolve(correlation_id: Optional[str]): str
- correlation_id: Optional[str] - (optional) transaction id used to trace execution through the call chain.
- returns: str - resolved connection config or raise error
set_references
Sets references to dependent components.
set_references(references: IReferences)
- references: IReferences - references to locate the component dependencies.