Query the correct set of jobs directly instead of filtering in Java

Description

While reviewing a PR, I've found some code in https://github.com/opencast/opencast/pull/28/commits/33fa480ef770912b83028869190749c0f2470c42 that seems highly inefficient:

for (Job job : serviceRegistry.getJobs(WorkflowService.JOB_TYPE, null)) {
if (WorkflowServiceImpl.Operation.START_WORKFLOW.toString().equals(job.getOperation())) {
jobs.add(job);
}
}

Maybe this could be improved by extending the service registry to directly retrieve the correct list of jobs assuming that this could be done by a database query directly.

Steps to reproduce

None

Status

Assignee

James Perrin

Reporter

Sven Stauber

Criticality

None

Tags (folksonomy)

None

Components

Fix versions

Affects versions

4.0

Priority

Major
Configure