Creates a new instance of the client.
a base route for remote service.
The base route.
The HTTP client.
The connection timeout in milliseconds.
The connection resolver.
The performance counters.
The default headers to be added to every request.
The logger.
The configuration options.
The number of retries.
The invocation timeout in milliseconds.
The remote service uri which is calculated on open.
Adds a correlation id (correlation_id) to invocation parameter map.
invocation parameters.
(optional) a correlation id to be added.
invocation parameters with added correlation id.
Adds filter parameters (with the same name as they defined) to invocation parameter map.
invocation parameters.
(optional) filter parameters
invocation parameters with added filter parameters.
Adds paging parameters (skip, take, total) to invocation parameter map.
invocation parameters.
(optional) paging parameters
invocation parameters with added paging parameters.
Calls a remote method via HTTP/REST protocol.
HTTP method: "get", "head", "post", "put", "delete"
a command route. Base route will be added to this route
(optional) transaction id to trace execution through call chain.
(optional) query parameters.
(optional) body object.
(optional) callback function that receives result object or error.
Calls a remote method via HTTP commadable protocol. The call is made via POST operation and all parameters are sent in body object. The complete route to remote method is defined as baseRoute + "/" + name.
a name of the command to call.
(optional) transaction id to trace execution through the call chain.
command parameters.
callback function that receives result or error.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Adds instrumentation to log calls and measure call time. It returns a CounterTiming object that is used to end the time measurement.
(optional) transaction id to trace execution through call chain.
a method name.
CounterTiming object to end the time measurement.
Adds instrumentation to error handling.
(optional) transaction id to trace execution through call chain.
a method name.
an occured error
(optional) an execution result
(optional) an execution callback
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Abstract client that calls commandable HTTP service.
Commandable services are generated automatically for ICommandable objects. Each command is exposed as POST operation that receives all parameters in body object.
Configuration parameters
base_route: base route for remote URI
References
*:logger:*:*:1.0
(optional) ILogger components to pass log messages*:counters:*:*:1.0
(optional) ICounters components to pass collected measurements*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connectionExample
class MyCommandableHttpClient extends CommandableHttpClient implements IMyClient { ... public getData(correlationId: string, id: string, callback: (err: any, result: MyData) => void): void { this.callCommand( "get_data", correlationId, { id: id }, (err, result) => { callback(err, result); } ); } ... } let client = new MyCommandableHttpClient(); client.configure(ConfigParams.fromTuples( "connection.protocol", "http", "connection.host", "localhost", "connection.port", 8080 )); client.getData("123", "1", (err, result) => { ... });