Class TopicSubscriptionBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.client.topic.impl.TopicSubscriptionBuilderImpl
-
- All Implemented Interfaces:
TopicSubscriptionBuilder
public class TopicSubscriptionBuilderImpl extends java.lang.Object implements TopicSubscriptionBuilder
- Author:
- Tassilo Weidner
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
businessKey
protected ExternalTaskHandler
externalTaskHandler
protected boolean
includeExtensionProperties
protected boolean
localVariables
protected java.lang.Long
lockDuration
protected static ExternalTaskClientLogger
LOG
protected java.lang.String
processDefinitionId
protected java.util.List<java.lang.String>
processDefinitionIds
protected java.lang.String
processDefinitionKey
protected java.util.List<java.lang.String>
processDefinitionKeys
protected java.lang.String
processDefinitionVersionTag
protected java.util.Map<java.lang.String,java.lang.Object>
processVariables
protected java.util.List<java.lang.String>
tenantIds
protected java.lang.String
topicName
protected TopicSubscriptionManager
topicSubscriptionManager
protected java.util.List<java.lang.String>
variableNames
protected boolean
withoutTenantId
-
Constructor Summary
Constructors Constructor Description TopicSubscriptionBuilderImpl(java.lang.String topicName, TopicSubscriptionManager topicSubscriptionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopicSubscriptionBuilder
businessKey(java.lang.String businessKey)
protected void
ensureNotNull(java.lang.Object tenantIds, java.lang.String parameterName)
TopicSubscriptionBuilder
handler(ExternalTaskHandler externalTaskHandler)
TopicSubscriptionBuilder
includeExtensionProperties(boolean includeExtensionProperties)
TopicSubscriptionBuilder
localVariables(boolean localVariables)
TopicSubscriptionBuilder
lockDuration(long lockDuration)
TopicSubscription
open()
Release the topic subscription for being executed asynchronouslyTopicSubscriptionBuilder
processDefinitionId(java.lang.String processDefinitionId)
TopicSubscriptionBuilder
processDefinitionIdIn(java.lang.String... processDefinitionIds)
TopicSubscriptionBuilder
processDefinitionKey(java.lang.String processDefinitionKey)
TopicSubscriptionBuilder
processDefinitionKeyIn(java.lang.String... processDefinitionKeys)
TopicSubscriptionBuilder
processDefinitionVersionTag(java.lang.String processDefinitionVersionTag)
TopicSubscriptionBuilder
processVariableEquals(java.lang.String name, java.lang.Object value)
TopicSubscriptionBuilder
processVariablesEqualsIn(java.util.Map<java.lang.String,java.lang.Object> processVariables)
TopicSubscriptionBuilder
tenantIdIn(java.lang.String... tenantIds)
TopicSubscriptionBuilder
variables(java.lang.String... variableNames)
TopicSubscriptionBuilder
withoutTenantId()
Filter for external tasks without tenant
-
-
-
Field Detail
-
LOG
protected static final ExternalTaskClientLogger LOG
-
topicName
protected java.lang.String topicName
-
lockDuration
protected java.lang.Long lockDuration
-
variableNames
protected java.util.List<java.lang.String> variableNames
-
localVariables
protected boolean localVariables
-
businessKey
protected java.lang.String businessKey
-
processDefinitionId
protected java.lang.String processDefinitionId
-
processDefinitionIds
protected java.util.List<java.lang.String> processDefinitionIds
-
processDefinitionKey
protected java.lang.String processDefinitionKey
-
processDefinitionKeys
protected java.util.List<java.lang.String> processDefinitionKeys
-
processDefinitionVersionTag
protected java.lang.String processDefinitionVersionTag
-
processVariables
protected java.util.Map<java.lang.String,java.lang.Object> processVariables
-
withoutTenantId
protected boolean withoutTenantId
-
tenantIds
protected java.util.List<java.lang.String> tenantIds
-
externalTaskHandler
protected ExternalTaskHandler externalTaskHandler
-
topicSubscriptionManager
protected TopicSubscriptionManager topicSubscriptionManager
-
includeExtensionProperties
protected boolean includeExtensionProperties
-
-
Constructor Detail
-
TopicSubscriptionBuilderImpl
public TopicSubscriptionBuilderImpl(java.lang.String topicName, TopicSubscriptionManager topicSubscriptionManager)
-
-
Method Detail
-
lockDuration
public TopicSubscriptionBuilder lockDuration(long lockDuration)
- Specified by:
lockDuration
in interfaceTopicSubscriptionBuilder
- Parameters:
lockDuration
-- in milliseconds to lock the external tasks
- must be greater than zero
- the default lock duration is 20 seconds (20,000 milliseconds)
- overrides the lock duration configured on bootstrapping the client
- Returns:
- the builder
-
handler
public TopicSubscriptionBuilder handler(ExternalTaskHandler externalTaskHandler)
- Specified by:
handler
in interfaceTopicSubscriptionBuilder
- Parameters:
externalTaskHandler
- which will be executed for the external task- Returns:
- the builder
-
variables
public TopicSubscriptionBuilder variables(java.lang.String... variableNames)
- Specified by:
variables
in interfaceTopicSubscriptionBuilder
- Parameters:
variableNames
- of variables which are supposed to be retrieved- Returns:
- the builder
-
localVariables
public TopicSubscriptionBuilder localVariables(boolean localVariables)
- Specified by:
localVariables
in interfaceTopicSubscriptionBuilder
- Parameters:
localVariables
- whether or not variables from greater scope than the external task should be fetched.false
means all variables visible in the scope of the external task will be fetched,true
means only local variables (to the scope of the external task) will be fetched- Returns:
- the builder
-
businessKey
public TopicSubscriptionBuilder businessKey(java.lang.String businessKey)
- Specified by:
businessKey
in interfaceTopicSubscriptionBuilder
- Parameters:
businessKey
- to filter for external tasks that are supposed to be fetched and locked- Returns:
- the builder
-
processDefinitionId
public TopicSubscriptionBuilder processDefinitionId(java.lang.String processDefinitionId)
- Specified by:
processDefinitionId
in interfaceTopicSubscriptionBuilder
- Parameters:
processDefinitionId
- to filter for external tasks that are supposed to be fetched and locked- Returns:
- the builder
-
processDefinitionIdIn
public TopicSubscriptionBuilder processDefinitionIdIn(java.lang.String... processDefinitionIds)
- Specified by:
processDefinitionIdIn
in interfaceTopicSubscriptionBuilder
- Parameters:
processDefinitionIds
- to filter for external tasks that are supposed to be fetched and locked- Returns:
- the builder
-
processDefinitionKey
public TopicSubscriptionBuilder processDefinitionKey(java.lang.String processDefinitionKey)
- Specified by:
processDefinitionKey
in interfaceTopicSubscriptionBuilder
- Parameters:
processDefinitionKey
- to filter for external tasks that are supposed to be fetched and locked- Returns:
- the builder
-
processDefinitionKeyIn
public TopicSubscriptionBuilder processDefinitionKeyIn(java.lang.String... processDefinitionKeys)
- Specified by:
processDefinitionKeyIn
in interfaceTopicSubscriptionBuilder
- Parameters:
processDefinitionKeys
- to filter for external tasks that are supposed to be fetched and locked- Returns:
- the builder
-
processDefinitionVersionTag
public TopicSubscriptionBuilder processDefinitionVersionTag(java.lang.String processDefinitionVersionTag)
- Specified by:
processDefinitionVersionTag
in interfaceTopicSubscriptionBuilder
- Returns:
- the builder
-
processVariablesEqualsIn
public TopicSubscriptionBuilder processVariablesEqualsIn(java.util.Map<java.lang.String,java.lang.Object> processVariables)
- Specified by:
processVariablesEqualsIn
in interfaceTopicSubscriptionBuilder
- Parameters:
processVariables
- of which the external tasks to be retrieved are related to- Returns:
- the builder
-
processVariableEquals
public TopicSubscriptionBuilder processVariableEquals(java.lang.String name, java.lang.Object value)
- Specified by:
processVariableEquals
in interfaceTopicSubscriptionBuilder
- Returns:
- the builder
-
withoutTenantId
public TopicSubscriptionBuilder withoutTenantId()
Description copied from interface:TopicSubscriptionBuilder
Filter for external tasks without tenant- Specified by:
withoutTenantId
in interfaceTopicSubscriptionBuilder
- Returns:
- the builder
-
tenantIdIn
public TopicSubscriptionBuilder tenantIdIn(java.lang.String... tenantIds)
- Specified by:
tenantIdIn
in interfaceTopicSubscriptionBuilder
- Parameters:
tenantIds
- to filter for external tasks that are supposed to be fetched and locked- Returns:
- the builder
-
includeExtensionProperties
public TopicSubscriptionBuilder includeExtensionProperties(boolean includeExtensionProperties)
- Specified by:
includeExtensionProperties
in interfaceTopicSubscriptionBuilder
- Parameters:
includeExtensionProperties
- whether or not to include custom extension properties for fetched external tasks.true
means all extensionProperties defined in the external task activity will be provided.false
means custom extension properties are not available within the external-task-client. The default isfalse
.- Returns:
- the builder
-
open
public TopicSubscription open()
Description copied from interface:TopicSubscriptionBuilder
Release the topic subscription for being executed asynchronously- Specified by:
open
in interfaceTopicSubscriptionBuilder
- Returns:
- the builder
-
ensureNotNull
protected void ensureNotNull(java.lang.Object tenantIds, java.lang.String parameterName)
-
-