Package org.camunda.bpm.engine.impl
Class JobQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.AbstractQuery<JobQuery,Job>
-
- org.camunda.bpm.engine.impl.JobQueryImpl
-
- All Implemented Interfaces:
java.io.Serializable,Command<java.lang.Object>,Query<JobQuery,Job>,JobQuery
public class JobQueryImpl extends AbstractQuery<JobQuery,Job> implements JobQuery, java.io.Serializable
- Author:
- Joram Barrez, Tom Baeyens, Falko Menge
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringactivityIdprotected java.util.DatecreatedAfterprotected java.util.DatecreatedBeforeprotected java.util.DateduedateHigherThanprotected java.util.DateduedateHigherThanOrEqualprotected java.util.DateduedateLowerThanprotected java.util.DateduedateLowerThanOrEqualprotected java.lang.StringexceptionMessageprotected booleanexecutableprotected java.lang.StringexecutionIdprotected java.lang.StringfailedActivityIdprotected java.lang.Stringidprotected java.util.Set<java.lang.String>idsprotected booleanincludeJobsWithoutTenantIdprotected booleanisTenantIdSetprotected java.lang.StringjobDefinitionIdprotected booleannoRetriesLeftprotected booleanonlyMessagesprotected booleanonlyTimersprotected java.lang.LongpriorityHigherThanOrEqualprotected java.lang.LongpriorityLowerThanOrEqualprotected java.lang.StringprocessDefinitionIdprotected java.lang.StringprocessDefinitionKeyprotected java.lang.StringprocessInstanceIdprotected java.util.Set<java.lang.String>processInstanceIdsprotected booleanretriesLeftprotected SuspensionStatesuspensionStateprotected java.lang.String[]tenantIdsprotected booleanwithException-
Fields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandExecutor, expressions, maxResultsLimitEnabled, resultType, SORTORDER_ASC, SORTORDER_DESC, validators
-
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
-
-
Constructor Summary
Constructors Constructor Description JobQueryImpl()JobQueryImpl(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobQueryactive()Only select jobs that are not suspended.JobQueryactivityId(java.lang.String activityId)Only select jobs which are defined on an activity with the given id.JobQuerycreatedAfter(java.util.Date date)Only select jobs created after the given date.JobQuerycreatedBefore(java.util.Date date)Only select jobs created before the given date.JobQueryduedateHigherThan(java.util.Date date)Only select jobs where the duedate is higher then the given date.JobQueryduedateHigherThen(java.util.Date date)Only select jobs where the duedate is higher then the given date.JobQueryduedateHigherThenOrEquals(java.util.Date date)Only select jobs where the duedate is higher then or equals the given date.JobQueryduedateLowerThan(java.util.Date date)Only select jobs where the duedate is lower than the given date.JobQueryduedateLowerThen(java.util.Date date)Only select jobs where the duedate is lower then the given date.JobQueryduedateLowerThenOrEquals(java.util.Date date)Only select jobs where the duedate is lower then or equals the given date.JobQueryexceptionMessage(java.lang.String exceptionMessage)Only select jobs that failed due to an exception with the given message.JobQueryexecutable()Only select jobs which are executable, ie.longexecuteCount(CommandContext commandContext)java.util.List<ImmutablePair<java.lang.String,java.lang.String>>executeDeploymentIdMappingsList(CommandContext commandContext)java.util.List<Job>executeList(CommandContext commandContext, Page page)Executes the actual query to retrieve the list of results.JobQueryImplexecutionId(java.lang.String executionId)Only select jobs which exist for the given executionJobQueryfailedActivityId(java.lang.String activityId)Only select jobs that failed due to an exception at an activity with the given id.java.lang.StringgetExceptionMessage()booleangetExecutable()java.lang.StringgetExecutionId()java.util.Set<java.lang.String>getIds()java.util.DategetNow()java.lang.StringgetProcessInstanceId()java.util.Set<java.lang.String>getProcessInstanceIds()booleangetRetriesLeft()protected booleanhasExcludingConditions()Whether or not the query has excluding conditions.JobQueryincludeJobsWithoutTenantId()Select jobs which have no tenant id.booleanisWithException()JobQueryjobDefinitionId(java.lang.String jobDefinitionId)Only select jobs which exist for the given job definition id.JobQueryjobId(java.lang.String jobId)Only select jobs with the given idJobQueryjobIds(java.util.Set<java.lang.String> ids)Only select jobs whose id is in the given set of idsJobQuerymessages()Only select jobs that are messages.JobQuerynoRetriesLeft()Only select jobs which have no retries leftJobQueryorderByExecutionId()Order by execution id (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByJobDuedate()Order by duedate (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByJobId()Order by job id (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByJobPriority()Order by priority for execution (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByJobRetries()Order by retries (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByProcessDefinitionId()Order by process definition id (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByProcessDefinitionKey()Order by process definition key (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByProcessInstanceId()Order by process instance id (needs to be followed byQuery.asc()orQuery.desc()).JobQueryorderByTenantId()Order by tenant id (needs to be followed byQuery.asc()orQuery.desc()).JobQuerypriorityHigherThanOrEquals(long priority)Only select jobs with a priority that is higher than or equal to the given priority.JobQuerypriorityLowerThanOrEquals(long priority)Only select jobs with a priority that is lower than or equal to the given priority.JobQueryprocessDefinitionId(java.lang.String processDefinitionId)Only select jobs which exist for the given process definition id.JobQueryprocessDefinitionKey(java.lang.String processDefinitionKey)Only select jobs which exist for the given process definition key.JobQueryImplprocessInstanceId(java.lang.String processInstanceId)Only select jobs which exist for the given process instance.JobQueryprocessInstanceIds(java.util.Set<java.lang.String> processInstanceIds)Only select jobs which exist for any of the given process instance idsJobQuerysuspended()Only select jobs that are suspended.JobQuerytenantIdIn(java.lang.String... tenantIds)Only select jobs that belong to one of the given tenant ids.JobQuerytimers()Only select jobs that are timers.JobQuerywithException()Only select jobs that failed due to an exception.JobQuerywithoutTenantId()Only select jobs which have no tenant id.JobQuerywithRetriesLeft()Only select jobs which have retries left-
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, addValidator, asc, checkMaxResultsLimit, checkQueryOk, count, desc, direction, disableMaxResultsLimit, enableMaxResultsLimit, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteDeploymentIdMappingsList, evaluateExpressionsAndExecuteIdsList, evaluateExpressionsAndExecuteList, execute, executeIdsList, executeResult, executeSingleResult, extend, getExpressions, getMethod, list, listDeploymentIdMappings, listIds, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, removeValidator, setCommandExecutor, setExpressions, singleResult, unlimitedList, validate, validate
-
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderingProperties, setParameter, setTenantCheck
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.interceptor.Command
isRetryable
-
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult, unlimitedList
-
-
-
-
Field Detail
-
activityId
protected java.lang.String activityId
-
id
protected java.lang.String id
-
ids
protected java.util.Set<java.lang.String> ids
-
jobDefinitionId
protected java.lang.String jobDefinitionId
-
processInstanceId
protected java.lang.String processInstanceId
-
processInstanceIds
protected java.util.Set<java.lang.String> processInstanceIds
-
executionId
protected java.lang.String executionId
-
processDefinitionId
protected java.lang.String processDefinitionId
-
processDefinitionKey
protected java.lang.String processDefinitionKey
-
retriesLeft
protected boolean retriesLeft
-
executable
protected boolean executable
-
onlyTimers
protected boolean onlyTimers
-
onlyMessages
protected boolean onlyMessages
-
duedateHigherThan
protected java.util.Date duedateHigherThan
-
duedateLowerThan
protected java.util.Date duedateLowerThan
-
duedateHigherThanOrEqual
protected java.util.Date duedateHigherThanOrEqual
-
duedateLowerThanOrEqual
protected java.util.Date duedateLowerThanOrEqual
-
createdBefore
protected java.util.Date createdBefore
-
createdAfter
protected java.util.Date createdAfter
-
priorityHigherThanOrEqual
protected java.lang.Long priorityHigherThanOrEqual
-
priorityLowerThanOrEqual
protected java.lang.Long priorityLowerThanOrEqual
-
withException
protected boolean withException
-
exceptionMessage
protected java.lang.String exceptionMessage
-
failedActivityId
protected java.lang.String failedActivityId
-
noRetriesLeft
protected boolean noRetriesLeft
-
suspensionState
protected SuspensionState suspensionState
-
isTenantIdSet
protected boolean isTenantIdSet
-
tenantIds
protected java.lang.String[] tenantIds
-
includeJobsWithoutTenantId
protected boolean includeJobsWithoutTenantId
-
-
Constructor Detail
-
JobQueryImpl
public JobQueryImpl()
-
JobQueryImpl
public JobQueryImpl(CommandExecutor commandExecutor)
-
-
Method Detail
-
jobId
public JobQuery jobId(java.lang.String jobId)
Description copied from interface:JobQueryOnly select jobs with the given id
-
jobIds
public JobQuery jobIds(java.util.Set<java.lang.String> ids)
Description copied from interface:JobQueryOnly select jobs whose id is in the given set of ids
-
jobDefinitionId
public JobQuery jobDefinitionId(java.lang.String jobDefinitionId)
Description copied from interface:JobQueryOnly select jobs which exist for the given job definition id.- Specified by:
jobDefinitionIdin interfaceJobQuery
-
processInstanceId
public JobQueryImpl processInstanceId(java.lang.String processInstanceId)
Description copied from interface:JobQueryOnly select jobs which exist for the given process instance.- Specified by:
processInstanceIdin interfaceJobQuery
-
processInstanceIds
public JobQuery processInstanceIds(java.util.Set<java.lang.String> processInstanceIds)
Description copied from interface:JobQueryOnly select jobs which exist for any of the given process instance ids- Specified by:
processInstanceIdsin interfaceJobQuery
-
executionId
public JobQueryImpl executionId(java.lang.String executionId)
Description copied from interface:JobQueryOnly select jobs which exist for the given execution- Specified by:
executionIdin interfaceJobQuery
-
processDefinitionId
public JobQuery processDefinitionId(java.lang.String processDefinitionId)
Description copied from interface:JobQueryOnly select jobs which exist for the given process definition id.- Specified by:
processDefinitionIdin interfaceJobQuery
-
processDefinitionKey
public JobQuery processDefinitionKey(java.lang.String processDefinitionKey)
Description copied from interface:JobQueryOnly select jobs which exist for the given process definition key.- Specified by:
processDefinitionKeyin interfaceJobQuery
-
activityId
public JobQuery activityId(java.lang.String activityId)
Description copied from interface:JobQueryOnly select jobs which are defined on an activity with the given id.- Specified by:
activityIdin interfaceJobQuery
-
withRetriesLeft
public JobQuery withRetriesLeft()
Description copied from interface:JobQueryOnly select jobs which have retries left- Specified by:
withRetriesLeftin interfaceJobQuery
-
executable
public JobQuery executable()
Description copied from interface:JobQueryOnly select jobs which are executable, ie. retries > 0 and duedate is null or duedate is in the past- Specified by:
executablein interfaceJobQuery
-
timers
public JobQuery timers()
Description copied from interface:JobQueryOnly select jobs that are timers. Cannot be used together withJobQuery.messages()
-
messages
public JobQuery messages()
Description copied from interface:JobQueryOnly select jobs that are messages. Cannot be used together withJobQuery.timers()
-
duedateHigherThan
public JobQuery duedateHigherThan(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs where the duedate is higher then the given date.- Specified by:
duedateHigherThanin interfaceJobQuery
-
duedateLowerThan
public JobQuery duedateLowerThan(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs where the duedate is lower than the given date.- Specified by:
duedateLowerThanin interfaceJobQuery
-
duedateHigherThen
public JobQuery duedateHigherThen(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs where the duedate is higher then the given date.- Specified by:
duedateHigherThenin interfaceJobQuery
-
duedateHigherThenOrEquals
public JobQuery duedateHigherThenOrEquals(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs where the duedate is higher then or equals the given date.- Specified by:
duedateHigherThenOrEqualsin interfaceJobQuery
-
duedateLowerThen
public JobQuery duedateLowerThen(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs where the duedate is lower then the given date.- Specified by:
duedateLowerThenin interfaceJobQuery
-
duedateLowerThenOrEquals
public JobQuery duedateLowerThenOrEquals(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs where the duedate is lower then or equals the given date.- Specified by:
duedateLowerThenOrEqualsin interfaceJobQuery
-
createdBefore
public JobQuery createdBefore(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs created before the given date.- Specified by:
createdBeforein interfaceJobQuery
-
createdAfter
public JobQuery createdAfter(java.util.Date date)
Description copied from interface:JobQueryOnly select jobs created after the given date.- Specified by:
createdAfterin interfaceJobQuery
-
priorityHigherThanOrEquals
public JobQuery priorityHigherThanOrEquals(long priority)
Description copied from interface:JobQueryOnly select jobs with a priority that is higher than or equal to the given priority.- Specified by:
priorityHigherThanOrEqualsin interfaceJobQuery
-
priorityLowerThanOrEquals
public JobQuery priorityLowerThanOrEquals(long priority)
Description copied from interface:JobQueryOnly select jobs with a priority that is lower than or equal to the given priority.- Specified by:
priorityLowerThanOrEqualsin interfaceJobQuery
-
withException
public JobQuery withException()
Description copied from interface:JobQueryOnly select jobs that failed due to an exception.- Specified by:
withExceptionin interfaceJobQuery
-
exceptionMessage
public JobQuery exceptionMessage(java.lang.String exceptionMessage)
Description copied from interface:JobQueryOnly select jobs that failed due to an exception with the given message.- Specified by:
exceptionMessagein interfaceJobQuery
-
failedActivityId
public JobQuery failedActivityId(java.lang.String activityId)
Description copied from interface:JobQueryOnly select jobs that failed due to an exception at an activity with the given id.- Specified by:
failedActivityIdin interfaceJobQuery
-
noRetriesLeft
public JobQuery noRetriesLeft()
Description copied from interface:JobQueryOnly select jobs which have no retries left- Specified by:
noRetriesLeftin interfaceJobQuery
-
active
public JobQuery active()
Description copied from interface:JobQueryOnly select jobs that are not suspended.
-
suspended
public JobQuery suspended()
Description copied from interface:JobQueryOnly select jobs that are suspended.
-
hasExcludingConditions
protected boolean hasExcludingConditions()
Description copied from class:AbstractQueryWhether or not the query has excluding conditions. If the query has excluding conditions, (e.g. task due date before and after are excluding), the SQL query is avoided and a default result is returned. The returned result is the same as if the SQL was executed and there were no entries.- Overrides:
hasExcludingConditionsin classAbstractQuery<JobQuery,Job>- Returns:
trueif the query does have excluding conditions,falseotherwise
-
tenantIdIn
public JobQuery tenantIdIn(java.lang.String... tenantIds)
Description copied from interface:JobQueryOnly select jobs that belong to one of the given tenant ids.- Specified by:
tenantIdInin interfaceJobQuery
-
withoutTenantId
public JobQuery withoutTenantId()
Description copied from interface:JobQueryOnly select jobs which have no tenant id.- Specified by:
withoutTenantIdin interfaceJobQuery
-
includeJobsWithoutTenantId
public JobQuery includeJobsWithoutTenantId()
Description copied from interface:JobQuerySelect jobs which have no tenant id. Can be used in combination withJobQuery.tenantIdIn(String...).- Specified by:
includeJobsWithoutTenantIdin interfaceJobQuery
-
orderByJobDuedate
public JobQuery orderByJobDuedate()
Description copied from interface:JobQueryOrder by duedate (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByJobDuedatein interfaceJobQuery
-
orderByExecutionId
public JobQuery orderByExecutionId()
Description copied from interface:JobQueryOrder by execution id (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByExecutionIdin interfaceJobQuery
-
orderByJobId
public JobQuery orderByJobId()
Description copied from interface:JobQueryOrder by job id (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByJobIdin interfaceJobQuery
-
orderByProcessInstanceId
public JobQuery orderByProcessInstanceId()
Description copied from interface:JobQueryOrder by process instance id (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByProcessInstanceIdin interfaceJobQuery
-
orderByProcessDefinitionId
public JobQuery orderByProcessDefinitionId()
Description copied from interface:JobQueryOrder by process definition id (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByProcessDefinitionIdin interfaceJobQuery
-
orderByProcessDefinitionKey
public JobQuery orderByProcessDefinitionKey()
Description copied from interface:JobQueryOrder by process definition key (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByProcessDefinitionKeyin interfaceJobQuery
-
orderByJobRetries
public JobQuery orderByJobRetries()
Description copied from interface:JobQueryOrder by retries (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByJobRetriesin interfaceJobQuery
-
orderByJobPriority
public JobQuery orderByJobPriority()
Description copied from interface:JobQueryOrder by priority for execution (needs to be followed byQuery.asc()orQuery.desc()).- Specified by:
orderByJobPriorityin interfaceJobQuery
-
orderByTenantId
public JobQuery orderByTenantId()
Description copied from interface:JobQueryOrder by tenant id (needs to be followed byQuery.asc()orQuery.desc()). Note that the ordering of job without tenant id is database-specific.- Specified by:
orderByTenantIdin interfaceJobQuery
-
executeCount
public long executeCount(CommandContext commandContext)
- Specified by:
executeCountin classAbstractQuery<JobQuery,Job>
-
executeList
public java.util.List<Job> executeList(CommandContext commandContext, Page page)
Description copied from class:AbstractQueryExecutes the actual query to retrieve the list of results.- Specified by:
executeListin classAbstractQuery<JobQuery,Job>page- used if the results must be paged. If null, no paging will be applied.
-
executeDeploymentIdMappingsList
public java.util.List<ImmutablePair<java.lang.String,java.lang.String>> executeDeploymentIdMappingsList(CommandContext commandContext)
- Overrides:
executeDeploymentIdMappingsListin classAbstractQuery<JobQuery,Job>
-
getIds
public java.util.Set<java.lang.String> getIds()
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
-
getProcessInstanceIds
public java.util.Set<java.lang.String> getProcessInstanceIds()
-
getExecutionId
public java.lang.String getExecutionId()
-
getRetriesLeft
public boolean getRetriesLeft()
-
getExecutable
public boolean getExecutable()
-
getNow
public java.util.Date getNow()
-
isWithException
public boolean isWithException()
-
getExceptionMessage
public java.lang.String getExceptionMessage()
-
-