|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConnectorRequest<T extends ConnectorResponse>
A connector request. The request opens an interaction with the connector. Because a request represents a single interaction, the request is not threadsafe. 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 (typesafe) methods for configuring a request, preferably in a fluent API fashion:
conntector.createRequest()
.endpointUrl("http://mysystem.loc/foo")
.payload("some important payload")
.execute();
This makes it easy to use the connector in a standalone way.
The request may return a value representing the output of the connector
invocation. Requests not returning a value should be of type Void.
| Method Summary | ||
|---|---|---|
T |
execute()
Execute the request. |
|
|
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. |
|
| Method Detail |
|---|
void setRequestParameters(Map<String,Object> 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)
the - name of the request parameter
T execute()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||