org.camunda.connect.impl
Class AbstractConnector<Q extends ConnectorRequest<R>,R extends ConnectorResponse>

java.lang.Object
  extended by org.camunda.connect.impl.AbstractConnector<Q,R>
All Implemented Interfaces:
Connector<Q>

public abstract class AbstractConnector<Q extends ConnectorRequest<R>,R extends ConnectorResponse>
extends 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
protected  String connectorId
           
protected  List<ConnectorRequestInterceptor> requestInterceptors
          The ConnectorRequestInterceptor chain
 
Constructor Summary
AbstractConnector(String connectorId)
           
 
Method Summary
 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.
 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.
 
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 String connectorId

requestInterceptors

protected List<ConnectorRequestInterceptor> requestInterceptors
The ConnectorRequestInterceptor chain

Constructor Detail

AbstractConnector

public AbstractConnector(String connectorId)
Method Detail

getId

public String getId()
Description copied from interface: Connector
The unique Id for the connector.

Specified by:
getId in interface Connector<Q extends ConnectorRequest<R>>
Returns:
the unique connector id

getRequestInterceptors

public List<ConnectorRequestInterceptor> getRequestInterceptors()
Description copied from interface: Connector
Returns the 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.

Specified by:
getRequestInterceptors in interface Connector<Q extends ConnectorRequest<R>>
Returns:
the list of interceptors.

setRequestInterceptors

public void setRequestInterceptors(List<ConnectorRequestInterceptor> requestInterceptors)
Description copied from interface: Connector
Sets the ConnectorRequestInterceptors of this connector. The interceptors are invoked for all requests created by the connector.

Specified by:
setRequestInterceptors in interface Connector<Q extends ConnectorRequest<R>>

addRequestInterceptor

public Connector<Q> addRequestInterceptor(ConnectorRequestInterceptor interceptor)
Description copied from interface: Connector
Adds a 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.

Specified by:
addRequestInterceptor in interface Connector<Q extends ConnectorRequest<R>>

addRequestInterceptors

public Connector<Q> addRequestInterceptors(Collection<ConnectorRequestInterceptor> interceptors)
Description copied from interface: Connector
Adds a collection of 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.

Specified by:
addRequestInterceptors in interface Connector<Q extends ConnectorRequest<R>>


Copyright © 2015 camunda services GmbH. All rights reserved.