public abstract class AbstractApiEndpoint<E extends ApiName,T> extends ScheduledPollEndpoint implements org.apache.camel.ApiEndpoint, PropertyNamesInterceptor, PropertiesInterceptor
| Modifier and Type | Field and Description |
|---|---|
protected E |
apiName |
protected T |
configuration |
protected String |
inBody |
protected org.slf4j.Logger |
log |
protected ApiMethodHelper<? extends ApiMethod> |
methodHelper |
protected String |
methodName |
| Constructor and Description |
|---|
AbstractApiEndpoint(String endpointUri,
org.apache.camel.Component component,
E apiName,
String methodName,
ApiMethodHelper<? extends ApiMethod> methodHelper,
T endpointConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
afterConfigureProperties()
Initialize proxies, create server connections, etc.
|
protected void |
configureConsumer(org.apache.camel.Consumer consumer) |
void |
configureProperties(Map<String,Object> options) |
E |
getApiName()
Returns API name.
|
abstract Object |
getApiProxy(ApiMethod method,
Map<String,Object> args)
Returns an instance of an API Proxy based on apiName, method and args.
|
List<ApiMethod> |
getCandidates()
Returns candidate methods for this endpoint.
|
T |
getConfiguration()
Returns endpoint configuration object.
|
Map<String,Object> |
getEndpointProperties() |
Set<String> |
getEndpointPropertyNames() |
ExecutorService |
getExecutorService() |
String |
getInBody()
Returns name of parameter passed in the exchange In Body.
|
ApiMethodHelper<? extends ApiMethod> |
getMethodHelper()
Returns method helper.
|
String |
getMethodName()
Returns method name.
|
protected abstract ApiMethodPropertiesHelper<T> |
getPropertiesHelper()
Returns generated helper that extends
ApiMethodPropertiesHelper to work with API properties. |
protected abstract String |
getThreadProfileName()
Returns Thread profile name.
|
void |
interceptProperties(Map<String,Object> properties)
Intercept method invocation arguments used to find and invoke API method.
|
void |
interceptPropertyNames(Set<String> propertyNames)
Intercept property names used to find API Method.
|
void |
setInBody(String inBody)
Sets the name of a parameter to be passed in the exchange In Body.
|
configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelayconfigurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringbuild, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateAsyncProducer, createConsumer, createExchange, createExchange, createPollingConsumer, createProducer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, isLenientProperties, isSingletonProducer, setCamelContextprotected final org.slf4j.Logger log
protected final String methodName
protected final ApiMethodHelper<? extends ApiMethod> methodHelper
protected final T configuration
@UriParam(description="Sets the name of a parameter to be passed in the exchange In Body") protected String inBody
protected abstract ApiMethodPropertiesHelper<T> getPropertiesHelper()
ApiMethodPropertiesHelper to work with API properties.public void configureProperties(Map<String,Object> options)
configureProperties in interface org.apache.camel.EndpointconfigureProperties in class ScheduledPollEndpointprotected abstract void afterConfigureProperties()
protected void configureConsumer(org.apache.camel.Consumer consumer)
throws Exception
configureConsumer in class ScheduledPollEndpointExceptionpublic void interceptPropertyNames(Set<String> propertyNames)
PropertyNamesInterceptorinterceptPropertyNames in interface PropertyNamesInterceptorpropertyNames - argument names.public void interceptProperties(Map<String,Object> properties)
PropertiesInterceptorinterceptProperties in interface PropertiesInterceptorproperties - method invocation arguments.public final T getConfiguration()
public final E getApiName()
public final String getMethodName()
public final ApiMethodHelper<? extends ApiMethod> getMethodHelper()
public final List<ApiMethod> getCandidates()
public final String getInBody()
public final void setInBody(String inBody) throws IllegalArgumentException
inBody - parameter nameIllegalArgumentException - for invalid parameter name.public abstract Object getApiProxy(ApiMethod method, Map<String,Object> args)
AbstractApiConsumer or
AbstractApiProducer.method - method about to be invokedargs - method argumentsAbstractApiProducer,
AbstractApiConsumerpublic final ExecutorService getExecutorService()
protected abstract String getThreadProfileName()
Apache Camel