public class ExternalTaskClientBuilderImpl extends Object implements ExternalTaskClientBuilder
| Modifier and Type | Field and Description |
|---|---|
protected Long |
asyncResponseTimeout |
protected BackoffStrategy |
backoffStrategy |
protected String |
baseUrl |
protected String |
dateFormat |
protected String |
defaultSerializationFormat |
protected EngineClient |
engineClient |
protected List<ClientRequestInterceptor> |
interceptors |
protected boolean |
isAutoFetchingEnabled |
protected boolean |
isBackoffStrategyDisabled |
protected long |
lockDuration |
protected static ExternalTaskClientLogger |
LOG |
protected int |
maxTasks |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected TopicSubscriptionManager |
topicSubscriptionManager |
protected TypedValues |
typedValues |
protected boolean |
usePriority |
protected ValueMappers |
valueMappers |
protected String |
workerId |
| Constructor and Description |
|---|
ExternalTaskClientBuilderImpl() |
| Modifier and Type | Method and Description |
|---|---|
ExternalTaskClientBuilder |
addInterceptor(ClientRequestInterceptor interceptor)
Adds an interceptor to change a request before it is sent to the http server.
|
protected void |
applyConfigurator(Map<String,DataFormat> dataFormats,
DataFormatConfigurator configurator) |
protected void |
applyConfigurators(Map<String,DataFormat> dataFormats) |
ExternalTaskClientBuilder |
asyncResponseTimeout(long asyncResponseTimeout)
Asynchronous response (long polling) is enabled if a timeout is given.
|
ExternalTaskClientBuilder |
backoffStrategy(BackoffStrategy backoffStrategy)
Adds a custom strategy to the client for defining the org.camunda.bpm.client.backoff between two requests.
|
ExternalTaskClientBuilder |
baseUrl(String baseUrl)
Base url of the Camunda BPM Platform REST API.
|
ExternalTaskClient |
build()
Bootstraps the Camunda client
|
String |
checkHostname() |
protected void |
checkInterceptors() |
ExternalTaskClientBuilder |
dateFormat(String dateFormat)
Specifies the date format to de-/serialize date variables.
|
ExternalTaskClientBuilder |
defaultSerializationFormat(String defaultSerializationFormat)
Specifies the serialization format that is used to serialize objects when no specific
format is requested.
|
ExternalTaskClientBuilder |
disableAutoFetching()
Disables immediate fetching for external tasks after calling
ExternalTaskClientBuilder.build() to bootstrap the client. |
ExternalTaskClientBuilder |
disableBackoffStrategy()
Disables the client-side backoff strategy.
|
protected Long |
getAsyncResponseTimeout() |
protected BackoffStrategy |
getBackoffStrategy() |
String |
getBaseUrl() |
String |
getDateFormat() |
String |
getDefaultSerializationFormat() |
EngineClient |
getEngineClient() |
String |
getHostname() |
protected List<ClientRequestInterceptor> |
getInterceptors() |
protected long |
getLockDuration() |
protected int |
getMaxTasks() |
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
TypedValues |
getTypedValues() |
ValueMappers |
getValueMappers() |
protected String |
getWorkerId() |
protected void |
initBaseUrl() |
protected void |
initEngineClient() |
protected void |
initObjectMapper() |
protected void |
initTopicSubscriptionManager() |
protected void |
initVariableMappers() |
protected void |
initWorkerId() |
protected boolean |
isAutoFetchingEnabled() |
ExternalTaskClientBuilder |
lockDuration(long lockDuration) |
protected void |
lookupCustomDataFormats(Map<String,DataFormat> dataFormats) |
protected Map<String,DataFormat> |
lookupDataFormats() |
protected void |
lookupProvider(Map<String,DataFormat> dataFormats,
DataFormatProvider provider) |
ExternalTaskClientBuilder |
maxTasks(int maxTasks)
Specifies the maximum amount of tasks that can be fetched within one request.
|
protected String |
sanitizeUrl(String url) |
ExternalTaskClientBuilder |
usePriority(boolean usePriority)
Specifies whether tasks should be fetched based on their priority or arbitrarily.
|
ExternalTaskClientBuilder |
workerId(String workerId)
A custom worker id the Workflow Engine is aware of.
|
protected static final ExternalTaskClientLogger LOG
protected String baseUrl
protected String workerId
protected int maxTasks
protected boolean usePriority
protected Long asyncResponseTimeout
protected long lockDuration
protected String defaultSerializationFormat
protected String dateFormat
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
protected ValueMappers valueMappers
protected TypedValues typedValues
protected EngineClient engineClient
protected TopicSubscriptionManager topicSubscriptionManager
protected List<ClientRequestInterceptor> interceptors
protected boolean isAutoFetchingEnabled
protected BackoffStrategy backoffStrategy
protected boolean isBackoffStrategyDisabled
public ExternalTaskClientBuilder baseUrl(String baseUrl)
ExternalTaskClientBuilderbaseUrl in interface ExternalTaskClientBuilderbaseUrl - of the Camunda BPM Platform REST APIpublic ExternalTaskClientBuilder workerId(String workerId)
ExternalTaskClientBuilderworkerId in interface ExternalTaskClientBuilderworkerId - the Workflow Engine is aware ofpublic ExternalTaskClientBuilder addInterceptor(ClientRequestInterceptor interceptor)
ExternalTaskClientBuilderaddInterceptor in interface ExternalTaskClientBuilderinterceptor - which changes the requestpublic ExternalTaskClientBuilder maxTasks(int maxTasks)
ExternalTaskClientBuildermaxTasks in interface ExternalTaskClientBuildermaxTasks - which are supposed to be fetched within one requestpublic ExternalTaskClientBuilder usePriority(boolean usePriority)
ExternalTaskClientBuildertrue.usePriority in interface ExternalTaskClientBuilderusePriority - when fetching and locking taskspublic ExternalTaskClientBuilder asyncResponseTimeout(long asyncResponseTimeout)
ExternalTaskClientBuilderasyncResponseTimeout in interface ExternalTaskClientBuilderasyncResponseTimeout - of fetched and locked external tasks in millisecondspublic ExternalTaskClientBuilder lockDuration(long lockDuration)
lockDuration in interface ExternalTaskClientBuilderlockDuration - public ExternalTaskClientBuilder disableAutoFetching()
ExternalTaskClientBuilderExternalTaskClientBuilder.build() to bootstrap the client.
To start fetching ExternalTaskClient.start() must be called.disableAutoFetching in interface ExternalTaskClientBuilderpublic ExternalTaskClientBuilder backoffStrategy(BackoffStrategy backoffStrategy)
ExternalTaskClientBuilderExponentialBackoffStrategy is applied.backoffStrategy in interface ExternalTaskClientBuilderbackoffStrategy - which realizes a custom org.camunda.bpm.client.backoff strategypublic ExternalTaskClientBuilder disableBackoffStrategy()
ExternalTaskClientBuilderExternalTaskClientBuilder.backoffStrategy(org.camunda.bpm.client.backoff.BackoffStrategy) is ignored.
NOTE: Please bear in mind that disabling the client-side backoff can lead to heavy load situations on engine side.
To avoid this, please specify an appropriate ExternalTaskClientBuilder.asyncResponseTimeout(long).disableBackoffStrategy in interface ExternalTaskClientBuilderpublic ExternalTaskClientBuilder defaultSerializationFormat(String defaultSerializationFormat)
ExternalTaskClientBuilderdefaultSerializationFormat in interface ExternalTaskClientBuilderdefaultSerializationFormat - serialization format to be usedpublic ExternalTaskClientBuilder dateFormat(String dateFormat)
ExternalTaskClientBuilderdateFormat in interface ExternalTaskClientBuilderdateFormat - date format to be usedpublic ExternalTaskClient build()
ExternalTaskClientBuilderbuild in interface ExternalTaskClientBuilderprotected void initBaseUrl()
protected void initWorkerId()
protected void checkInterceptors()
protected void initObjectMapper()
protected void initVariableMappers()
protected void initEngineClient()
protected void initTopicSubscriptionManager()
protected Map<String,DataFormat> lookupDataFormats()
protected void lookupCustomDataFormats(Map<String,DataFormat> dataFormats)
protected void lookupProvider(Map<String,DataFormat> dataFormats, DataFormatProvider provider)
protected void applyConfigurators(Map<String,DataFormat> dataFormats)
protected void applyConfigurator(Map<String,DataFormat> dataFormats, DataFormatConfigurator configurator)
public String checkHostname()
public String getHostname() throws UnknownHostException
UnknownHostExceptionpublic String getBaseUrl()
protected String getWorkerId()
protected List<ClientRequestInterceptor> getInterceptors()
protected int getMaxTasks()
protected Long getAsyncResponseTimeout()
protected long getLockDuration()
protected boolean isAutoFetchingEnabled()
protected BackoffStrategy getBackoffStrategy()
public String getDefaultSerializationFormat()
public String getDateFormat()
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public ValueMappers getValueMappers()
public TypedValues getTypedValues()
public EngineClient getEngineClient()
Copyright © 2022. All rights reserved.