public class ExternalTaskQueryTopicBuilderImpl extends Object implements ExternalTaskQueryTopicBuilder
Modifier and Type | Field and Description |
---|---|
protected CommandExecutor |
commandExecutor |
protected TopicFetchInstruction |
currentInstruction |
protected Map<String,TopicFetchInstruction> |
instructions |
protected int |
maxTasks |
protected String |
workerId |
Constructor and Description |
---|
ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor,
String workerId,
int maxTasks) |
Modifier and Type | Method and Description |
---|---|
List<LockedExternalTask> |
execute()
Performs the fetching.
|
protected void |
submitCurrentInstruction() |
ExternalTaskQueryTopicBuilder |
topic(String topicName,
long lockDuration)
Specifies that tasks of a topic should be fetched and locked for
a certain amount of time
|
ExternalTaskQueryTopicBuilder |
variables(List<String> variables)
Define variables to fetch with all tasks for the current topic.
|
ExternalTaskQueryTopicBuilder |
variables(String... variables)
Define variables to fetch with all tasks for the current topic.
|
protected CommandExecutor commandExecutor
protected String workerId
protected int maxTasks
protected Map<String,TopicFetchInstruction> instructions
protected TopicFetchInstruction currentInstruction
public ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks)
public List<LockedExternalTask> execute()
ExternalTaskQueryBuilder
execute
in interface ExternalTaskQueryBuilder
public ExternalTaskQueryTopicBuilder topic(String topicName, long lockDuration)
ExternalTaskQueryBuilder
topic
in interface ExternalTaskQueryBuilder
topicName
- the name of the topiclockDuration
- the duration in milliseconds for which tasks should be locked;
begins at the time of fetchingpublic ExternalTaskQueryTopicBuilder variables(String... variables)
ExternalTaskQueryTopicBuilder
variables
in interface ExternalTaskQueryTopicBuilder
variables
- the variable names to fetchpublic ExternalTaskQueryTopicBuilder variables(List<String> variables)
ExternalTaskQueryTopicBuilder
variables
in interface ExternalTaskQueryTopicBuilder
variables
- the variable names to fetchprotected void submitCurrentInstruction()
Copyright © 2018. All rights reserved.