Class SpringTopicSubscriptionImpl
- java.lang.Object
-
- org.camunda.bpm.client.spring.impl.subscription.SpringTopicSubscriptionImpl
-
- All Implemented Interfaces:
SpringTopicSubscription
,TopicSubscription
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
PropertiesAwareSpringTopicSubscription
public class SpringTopicSubscriptionImpl extends java.lang.Object implements SpringTopicSubscription, org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.context.ApplicationEventPublisher
applicationEventPublisher
protected ExternalTaskClient
client
protected ExternalTaskHandler
externalTaskHandler
protected static SubscriptionLoggerUtil
LOG
protected SubscriptionConfiguration
subscriptionConfiguration
protected TopicSubscription
topicSubscription
protected TopicSubscriptionBuilder
topicSubscriptionBuilder
-
Constructor Summary
Constructors Constructor Description SpringTopicSubscriptionImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
close()
Delegates toTopicSubscription.close()
.void
closeInternally()
java.lang.String
getBusinessKey()
ExternalTaskHandler
getExternalTaskHandler()
java.lang.Long
getLockDuration()
java.lang.String
getProcessDefinitionId()
java.util.List<java.lang.String>
getProcessDefinitionIdIn()
java.lang.String
getProcessDefinitionKey()
java.util.List<java.lang.String>
getProcessDefinitionKeyIn()
java.lang.String
getProcessDefinitionVersionTag()
java.util.Map<java.lang.String,java.lang.Object>
getProcessVariables()
SubscriptionConfiguration
getSubscriptionConfiguration()
java.util.List<java.lang.String>
getTenantIdIn()
java.lang.String
getTopicName()
java.util.List<java.lang.String>
getVariableNames()
void
initialize()
boolean
isAutoOpen()
protected java.util.function.Predicate<org.springframework.context.ApplicationEvent>
isEventThatCanStartSubscription()
boolean
isIncludeExtensionProperties()
boolean
isLocalVariables()
boolean
isOpen()
boolean
isWithoutTenantId()
void
open()
Releases the topic subscription for asynchronous execution whenSpringTopicSubscription.isAutoOpen()
isfalse
protected void
publishInitializedEvent(java.lang.String topicName)
void
setExternalTaskHandler(ExternalTaskHandler externalTaskHandler)
void
setSubscriptionConfiguration(SubscriptionConfiguration subscriptionConfiguration)
void
start(org.springframework.context.ApplicationEvent event)
protected java.lang.String[]
toArray(java.util.List<java.lang.String> list)
-
-
-
Field Detail
-
LOG
protected static final SubscriptionLoggerUtil LOG
-
subscriptionConfiguration
protected SubscriptionConfiguration subscriptionConfiguration
-
externalTaskHandler
protected ExternalTaskHandler externalTaskHandler
-
topicSubscriptionBuilder
protected TopicSubscriptionBuilder topicSubscriptionBuilder
-
topicSubscription
protected TopicSubscription topicSubscription
-
client
@Autowired protected ExternalTaskClient client
-
applicationEventPublisher
@Autowired protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher
-
-
Method Detail
-
isEventThatCanStartSubscription
protected java.util.function.Predicate<org.springframework.context.ApplicationEvent> isEventThatCanStartSubscription()
-
start
@EventListener public void start(org.springframework.context.ApplicationEvent event)
-
initialize
public void initialize()
-
publishInitializedEvent
protected void publishInitializedEvent(java.lang.String topicName)
-
open
public void open()
Description copied from interface:SpringTopicSubscription
Releases the topic subscription for asynchronous execution whenSpringTopicSubscription.isAutoOpen()
isfalse
- Specified by:
open
in interfaceSpringTopicSubscription
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfaceSpringTopicSubscription
- Returns:
true
when the topic subscription is already released for executionfalse
when the topic subscription is not already released for execution; callSpringTopicSubscription.open()
to release the topic for execution
-
closeInternally
public void closeInternally()
-
close
public void close()
Description copied from interface:SpringTopicSubscription
Delegates toTopicSubscription.close()
.- Specified by:
close
in interfaceSpringTopicSubscription
- Specified by:
close
in interfaceTopicSubscription
- See Also:
TopicSubscription.close()
-
isAutoOpen
public boolean isAutoOpen()
- Specified by:
isAutoOpen
in interfaceSpringTopicSubscription
- Returns:
true
when the topic subscription is automatically released for executionfalse
when you need to callSpringTopicSubscription.open()
to release the topic for execution
-
setExternalTaskHandler
public void setExternalTaskHandler(ExternalTaskHandler externalTaskHandler)
-
getSubscriptionConfiguration
public SubscriptionConfiguration getSubscriptionConfiguration()
-
setSubscriptionConfiguration
public void setSubscriptionConfiguration(SubscriptionConfiguration subscriptionConfiguration)
-
getTopicName
public java.lang.String getTopicName()
- Specified by:
getTopicName
in interfaceTopicSubscription
- Returns:
- the topic name of the subscription
-
getLockDuration
public java.lang.Long getLockDuration()
- Specified by:
getLockDuration
in interfaceTopicSubscription
- Returns:
- the duration of the lock applied to the topic
- if
null
, the client or the default lock duration is applied
-
getExternalTaskHandler
public ExternalTaskHandler getExternalTaskHandler()
- Specified by:
getExternalTaskHandler
in interfaceTopicSubscription
- Returns:
- the external task handler of the topic
-
getVariableNames
public java.util.List<java.lang.String> getVariableNames()
- Specified by:
getVariableNames
in interfaceTopicSubscription
- Returns:
- a list of variable names which are supposed to be retrieved
-
isLocalVariables
public boolean isLocalVariables()
- Specified by:
isLocalVariables
in interfaceTopicSubscription
- Returns:
- whether or not variables from greater scopes than the external task
are 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.
-
getBusinessKey
public java.lang.String getBusinessKey()
- Specified by:
getBusinessKey
in interfaceTopicSubscription
- Returns:
- the business key associated with the external tasks which are supposed to be fetched and locked
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
- Specified by:
getProcessDefinitionId
in interfaceTopicSubscription
- Returns:
- the process definition id associated with the external tasks which are supposed to be fetched and locked
-
getProcessDefinitionIdIn
public java.util.List<java.lang.String> getProcessDefinitionIdIn()
- Specified by:
getProcessDefinitionIdIn
in interfaceTopicSubscription
- Returns:
- the process definition ids associated with the external tasks which are supposed to be fetched and locked
-
getProcessDefinitionKey
public java.lang.String getProcessDefinitionKey()
- Specified by:
getProcessDefinitionKey
in interfaceTopicSubscription
- Returns:
- the process definition key associated with the external tasks which are supposed to be fetched and locked
-
getProcessDefinitionKeyIn
public java.util.List<java.lang.String> getProcessDefinitionKeyIn()
- Specified by:
getProcessDefinitionKeyIn
in interfaceTopicSubscription
- Returns:
- the process definition keys associated with the external tasks which are supposed to be fetched and locked
-
getProcessDefinitionVersionTag
public java.lang.String getProcessDefinitionVersionTag()
- Specified by:
getProcessDefinitionVersionTag
in interfaceTopicSubscription
- Returns:
- the process definition version tag associated with the external task which are supposed to be fetched and locked
-
getProcessVariables
public java.util.Map<java.lang.String,java.lang.Object> getProcessVariables()
- Specified by:
getProcessVariables
in interfaceTopicSubscription
- Returns:
- the process variables associated with the external task which are supposed to be fetched and locked
-
isWithoutTenantId
public boolean isWithoutTenantId()
- Specified by:
isWithoutTenantId
in interfaceTopicSubscription
- Returns:
- the tenant id presence for the external tasks which are supposed to be fetched and locked
-
getTenantIdIn
public java.util.List<java.lang.String> getTenantIdIn()
- Specified by:
getTenantIdIn
in interfaceTopicSubscription
- Returns:
- the tenant ids associated with the external tasks which are supposed to be fetched and locked
-
isIncludeExtensionProperties
public boolean isIncludeExtensionProperties()
- Specified by:
isIncludeExtensionProperties
in interfaceTopicSubscription
- Returns:
- whether or not custom extension properties defined in the external
task activity are included. The default is
false
, which means that no extension properties will be available within the external-task-client.true
means that all defined extension properties are fetched and provided.
-
toArray
protected java.lang.String[] toArray(java.util.List<java.lang.String> list)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
-