HttpConnectionResolver class
Helper class to retrieve connections for HTTP-based services abd clients.
In addition to regular functions of ConnectionResolver is able to parse http:// URIs and validate connection parameters before returning them.
Configuration parameters
-
connection
:discovery_key
: (optional) a key to retrieve the connection fromIDiscovery
- ... other connection parameters
-
connections
: alternative to connectionconnection params 1
: first connection parameters- ...
connection params N
: Nth connection parameters- ...
References
\*:discovery:\*:\*:1.0
(optional)IDiscovery
] services
See ConnectionParams
See ConnectionResolver
Example
var config = ConfigParams.fromTuples([
'connection.host', '10.1.1.100',
'connection.port', 8080
]);
var connectionResolver = HttpConnectionResolver();
connectionResolver.configure(config);
connectionResolver.setReferences(references);
var connection = connectionResolver.resolve('123',
// Now use connection...
Constructors
Properties
- connectionResolver → ConnectionResolver
-
The base connection resolver.
final
- credentialResolver → CredentialResolver
-
The base credential resolver.
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
configure(
ConfigParams config ) → void - Configures component by passing configuration parameters. [...]
-
register(
String correlationId ) → Future - Registers the given connection in all referenced discovery services. This method can be used for dynamic service discovery. [...]
-
resolve(
String correlationId ) → Future< ConnectionParams> - Resolves a single component connection. If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there. [...]
-
resolveAll(
String correlationId ) → Future< List< ConnectionParams> > - Resolves all component connection. If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there. [...]
-
setReferences(
IReferences references ) → void - Sets references to dependent components. [...]
-
noSuchMethod(
Invocation invocation ) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other ) → bool -
The equality operator. [...]
inherited