public interface ConnectorRequest<R extends ConnectorResponse>
A connector request. The request opens an interaction with the connector. Because a request represents a single interaction, the request is not thread-safe. Request objects should not be shared between multiple threads.
The parameters of a request can be provided using the generic map of input
parameters. See (setRequestParameters(Map)):
SomeConnectorRequest req = connector.createRequest();
req.setRequestParameter("endpointUrl", "http://mysystem.loc/foo");
req.setRequestParameter("payload", "some important payload");
req.execute();
This makes it possible to use the connector in a generic / configurable system like
the camunda process engine.
Optionally, a connector may also extend the request interface and provide dedicated (type-safe) methods for configuring a request, preferably in a fluent API fashion:
connector.createRequest()
.endpointUrl("http://mysystem.loc/foo")
.payload("some important payload")
.execute();
This makes it easy to use the connector in a standalone way.
A request must return a ConnectorResponse that contains response
data. Requests for which the response contains no payload or is not relevant should
return an empty response that provides no data.
| Modifier and Type | Method and Description |
|---|---|
R |
execute()
Execute the request.
|
<V> V |
getRequestParameter(String name)
Returns the value of a request parameter
|
Map<String,Object> |
getRequestParameters()
Returns the map of request parameters
|
void |
setRequestParameter(String name,
Object value)
Provides a named input parameters to the request.
|
void |
setRequestParameters(Map<String,Object> params)
Provides the named input parameters of the request.
|
void setRequestParameters(Map<String,Object> params)
params - the named input parameters of the request.void setRequestParameter(String name, Object value)
name - the name of the parametervalue - the value of the parameterMap<String,Object> getRequestParameters()
<V> V getRequestParameter(String name)
name - the name of the request parameterR execute()
Copyright © 2014–2020 Camunda Services GmbH. All rights reserved.