Package org.camunda.connect.impl
Class AbstractRequestInvocation<T>
- java.lang.Object
-
- org.camunda.connect.impl.AbstractRequestInvocation<T>
-
- All Implemented Interfaces:
ConnectorInvocation
public abstract class AbstractRequestInvocation<T> extends java.lang.Object implements ConnectorInvocation
A simple invocation implementation routing a request through a chain of interceptors. Implementations must implement theinvokeTarget()method in order to implement the actual request execution / target invocation.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected intcurrentIndexprotected java.util.List<ConnectorRequestInterceptor>interceptorChainprotected ConnectorRequest<?>requestprotected Ttarget
-
Constructor Summary
Constructors Constructor Description AbstractRequestInvocation(T target, ConnectorRequest<?> request, java.util.List<ConnectorRequestInterceptor> interceptorChain)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ConnectorRequest<?>getRequest()The connector request as created through the API.TgetTarget()The underlying raw request.abstract java.lang.ObjectinvokeTarget()java.lang.Objectproceed()Makes the request proceed through the interceptor chain.
-
-
-
Field Detail
-
target
protected T target
-
currentIndex
protected int currentIndex
-
interceptorChain
protected java.util.List<ConnectorRequestInterceptor> interceptorChain
-
request
protected ConnectorRequest<?> request
-
-
Constructor Detail
-
AbstractRequestInvocation
public AbstractRequestInvocation(T target, ConnectorRequest<?> request, java.util.List<ConnectorRequestInterceptor> interceptorChain)
-
-
Method Detail
-
getTarget
public T getTarget()
Description copied from interface:ConnectorInvocationThe underlying raw request.- Specified by:
getTargetin interfaceConnectorInvocation- Returns:
- the raw request as executed by the connector
-
getRequest
public ConnectorRequest<?> getRequest()
Description copied from interface:ConnectorInvocationThe connector request as created through the API. Accessing the request from an interceptor may be useful for setting additional properties on the raw request (returned by
ConnectorInvocation.getTarget()) that are not supported by the connector.NOTE: setting parameters on the request (via)
ConnectorRequest.setRequestParameter(String, Object)will not have any effects once the request is executed.- Specified by:
getRequestin interfaceConnectorInvocation- Returns:
- the connector request
-
proceed
public java.lang.Object proceed() throws java.lang.ExceptionDescription copied from interface:ConnectorInvocationMakes the request proceed through the interceptor chain.ConnectorRequestInterceptorimplementations are responsible for calling this method on the invocation.- Specified by:
proceedin interfaceConnectorInvocation- Returns:
- the result of the invocation.
- Throws:
java.lang.Exception
-
invokeTarget
public abstract java.lang.Object invokeTarget() throws java.lang.Exception- Throws:
java.lang.Exception
-
-