Package org.camunda.connect.spi
Interface Connector<Q extends ConnectorRequest<?>>
- All Known Subinterfaces:
HttpConnector
,SoapHttpConnector
- All Known Implementing Classes:
AbstractConnector
,AbstractHttpConnector
,HttpConnectorImpl
,SoapHttpConnectorImpl
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.
- Author:
- Daniel Meyer
-
Method Summary
Modifier and TypeMethodDescriptionaddRequestInterceptor
(ConnectorRequestInterceptor interceptor) Adds aConnectorRequestInterceptor
to this connector.addRequestInterceptors
(Collection<ConnectorRequestInterceptor> interceptors) Adds a collection ofConnectorRequestInterceptor
to this connector.Create a request on the connector.Execute the request on the connector.getId()
The unique Id for the connector.Returns theConnectorRequestInterceptor
chain for this connector.void
setRequestInterceptors
(List<ConnectorRequestInterceptor> requestInterceptors) Sets theConnectorRequestInterceptor
s of this connector.
-
Method Details
-
getId
String getId()The unique Id for the connector.- Returns:
- the unique connector id
-
createRequest
Q createRequest()Create a request on the connector.- Returns:
- the connector-specific request object.
-
getRequestInterceptors
List<ConnectorRequestInterceptor> getRequestInterceptors()Returns theConnectorRequestInterceptor
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'sConnectorRequestInterceptor
chain.- Returns:
- the list of interceptors.
-
setRequestInterceptors
Sets theConnectorRequestInterceptor
s of this connector. The interceptors are invoked for all requests created by the connector. -
addRequestInterceptor
Adds aConnectorRequestInterceptor
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. -
addRequestInterceptors
Adds a collection ofConnectorRequestInterceptor
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. -
execute
Execute the request on the connector.- Parameters:
request
- the request- Returns:
- the result.
-