Package org.camunda.connect.impl
Class AbstractConnector<Q extends ConnectorRequest<R>,R extends ConnectorResponse>
- java.lang.Object
-
- org.camunda.connect.impl.AbstractConnector<Q,R>
-
- All Implemented Interfaces:
Connector<Q>
public abstract class AbstractConnector<Q extends ConnectorRequest<R>,R extends ConnectorResponse> extends java.lang.Object implements Connector<Q>
Abstract implementation of the connector interface. This implementation provides a linked list of interceptors and related methods for handling interceptor invocation.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringconnectorIdprotected java.util.List<ConnectorRequestInterceptor>requestInterceptorsTheConnectorRequestInterceptorchain
-
Constructor Summary
Constructors Constructor Description AbstractConnector(java.lang.String connectorId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connector<Q>addRequestInterceptor(ConnectorRequestInterceptor interceptor)Adds aConnectorRequestInterceptorto this connector.Connector<Q>addRequestInterceptors(java.util.Collection<ConnectorRequestInterceptor> interceptors)Adds a collection ofConnectorRequestInterceptorto this connector.java.lang.StringgetId()The unique Id for the connector.java.util.List<ConnectorRequestInterceptor>getRequestInterceptors()Returns theConnectorRequestInterceptorchain for this connector.voidsetRequestInterceptors(java.util.List<ConnectorRequestInterceptor> requestInterceptors)Sets theConnectorRequestInterceptors of this connector.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.connect.spi.Connector
createRequest, execute
-
-
-
-
Field Detail
-
connectorId
protected java.lang.String connectorId
-
requestInterceptors
protected java.util.List<ConnectorRequestInterceptor> requestInterceptors
TheConnectorRequestInterceptorchain
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:ConnectorThe unique Id for the connector.- Specified by:
getIdin interfaceConnector<Q extends ConnectorRequest<R>>- Returns:
- the unique connector id
-
getRequestInterceptors
public java.util.List<ConnectorRequestInterceptor> getRequestInterceptors()
Description copied from interface:ConnectorReturns theConnectorRequestInterceptorchain 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'sConnectorRequestInterceptorchain.- Specified by:
getRequestInterceptorsin interfaceConnector<Q extends ConnectorRequest<R>>- Returns:
- the list of interceptors.
-
setRequestInterceptors
public void setRequestInterceptors(java.util.List<ConnectorRequestInterceptor> requestInterceptors)
Description copied from interface:ConnectorSets theConnectorRequestInterceptors of this connector. The interceptors are invoked for all requests created by the connector.- Specified by:
setRequestInterceptorsin interfaceConnector<Q extends ConnectorRequest<R>>
-
addRequestInterceptor
public Connector<Q> addRequestInterceptor(ConnectorRequestInterceptor interceptor)
Description copied from interface:ConnectorAdds aConnectorRequestInterceptorto this connector. The interceptor is added at the end of the interceptor chain. The interceptor is invoked for all requests created by the connector.- Specified by:
addRequestInterceptorin interfaceConnector<Q extends ConnectorRequest<R>>
-
addRequestInterceptors
public Connector<Q> addRequestInterceptors(java.util.Collection<ConnectorRequestInterceptor> interceptors)
Description copied from interface:ConnectorAdds a collection ofConnectorRequestInterceptorto this connector. The interceptors are added at the end of the interceptor chain. The interceptor is invoked for all requests created by the connector.- Specified by:
addRequestInterceptorsin interfaceConnector<Q extends ConnectorRequest<R>>
-
-