public interface Connector<Q extends ConnectorRequest<?>>
A connector represents a way to interact with some system, library or technology. Examples of connectors are connectors for HTTP interaction, a connector to a third-party library like a rules engine or file system abstraction.
Once an instance of a connector is created, it is thread-safe, meaning that single
connector instance my be used by multiple threads concurrently. Each thread will create
new Requests which are not thread-safe and must not be shared
among multiple threads.
Connectors support interceptors. Interceptors may be used for customizing connector behavior or for adding management aspects such as logging to a connector.
| Modifier and Type | Method and Description |
|---|---|
Connector<Q> |
addRequestInterceptor(ConnectorRequestInterceptor interceptor)
Adds a
ConnectorRequestInterceptor to this connector. |
Connector<Q> |
addRequestInterceptors(Collection<ConnectorRequestInterceptor> interceptors)
Adds a collection of
ConnectorRequestInterceptor to this connector. |
Q |
createRequest()
Create a request on the connector.
|
ConnectorResponse |
execute(Q request)
Execute the request on the connector.
|
String |
getId()
The unique Id for the connector.
|
List<ConnectorRequestInterceptor> |
getRequestInterceptors()
Returns the
ConnectorRequestInterceptor chain for this connector. |
void |
setRequestInterceptors(List<ConnectorRequestInterceptor> requestInterceptors)
Sets the
ConnectorRequestInterceptors of this connector. |
String getId()
Q createRequest()
List<ConnectorRequestInterceptor> getRequestInterceptors()
ConnectorRequestInterceptor chain for this connector.
The implementation will return the actual list, modifications on the list will
be reflected in the internal connector state. This means that you can use the
returned list to modify the connector's ConnectorRequestInterceptor chain.void setRequestInterceptors(List<ConnectorRequestInterceptor> requestInterceptors)
ConnectorRequestInterceptors of this connector. The interceptors
are invoked for all requests created by the connector.Connector<Q> addRequestInterceptor(ConnectorRequestInterceptor interceptor)
ConnectorRequestInterceptor to this connector. The interceptor is added
at the end of the interceptor chain. The interceptor is invoked for all requests
created by the connector.Connector<Q> addRequestInterceptors(Collection<ConnectorRequestInterceptor> interceptors)
ConnectorRequestInterceptor to this connector. The interceptors
are added at the end of the interceptor chain. The interceptor is invoked for all
requests created by the connector.ConnectorResponse execute(Q request)
request - the requestCopyright © 2014–2022 Camunda Services GmbH. All rights reserved.