public class HttpConnectionResolver extends Object implements org.pipservices.commons.refer.IReferenceable, org.pipservices.commons.config.IConfigurable
In addition to regular functions of ConnectionResolver is able to parse http:// URIs and validate connection parameters before returning them.
### Configuration parameters ###
### References ###
### Example ###
ConfigParams config = ConfigParams.fromTuples(
"connection.host", "10.1.1.100",
"connection.port", 8080
);
HttpConnectionResolver connectionResolver = new HttpConnectionResolver();
connectionResolver.configure(config);
connectionResolver.setReferences(references);
ConnectionParams params = connectionResolver.resolve("123");
ConnectionParams,
ConnectionResolver| Modifier and Type | Field and Description |
|---|---|
protected org.pipservices.components.connect.ConnectionResolver |
_connectionResolver
The base connection resolver.
|
| Constructor and Description |
|---|
HttpConnectionResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.pipservices.commons.config.ConfigParams config)
Configures component by passing configuration parameters.
|
void |
register(String correlationId)
Registers the given connection in all referenced discovery services.
|
org.pipservices.components.connect.ConnectionParams |
resolve(String correlationId)
Resolves a single component connection.
|
List<org.pipservices.components.connect.ConnectionParams> |
resolveAll(String correlationId)
Resolves all component connection.
|
void |
setReferences(org.pipservices.commons.refer.IReferences references)
Sets references to dependent components.
|
protected org.pipservices.components.connect.ConnectionResolver _connectionResolver
public void configure(org.pipservices.commons.config.ConfigParams config)
configure in interface org.pipservices.commons.config.IConfigurableconfig - configuration parameters to be set.public void setReferences(org.pipservices.commons.refer.IReferences references)
setReferences in interface org.pipservices.commons.refer.IReferenceablereferences - references to locate the component dependencies.public org.pipservices.components.connect.ConnectionParams resolve(String correlationId) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.org.pipservices.commons.errors.ApplicationException - when error occured.public List<org.pipservices.components.connect.ConnectionParams> resolveAll(String correlationId) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.org.pipservices.commons.errors.ApplicationException - when error occured.public void register(String correlationId) throws org.pipservices.commons.errors.ApplicationException
correlationId - (optional) transaction id to trace execution through
call chain.org.pipservices.commons.errors.ApplicationException - when error occured.Copyright © 2018. All rights reserved.