Skip to content

Commit

Permalink
Remove source object class check for SelectedItemsNone
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Flores <[email protected]>
  • Loading branch information
SugaryLump committed Oct 25, 2024
1 parent 938b5d3 commit c423075
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import org.roda.core.data.v2.generics.LongResponse;
import org.roda.core.data.v2.generics.StringResponse;
import org.roda.core.data.v2.generics.select.SelectedItemsListRequest;
import org.roda.core.data.v2.generics.select.SelectedItemsNoneRequest;
import org.roda.core.data.v2.generics.select.SelectedItemsRequest;
import org.roda.core.data.v2.index.CountRequest;
import org.roda.core.data.v2.index.FindRequest;
import org.roda.core.data.v2.index.IndexResult;
import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.index.SuggestRequest;
import org.roda.core.data.v2.index.select.SelectedItems;
import org.roda.core.data.v2.jobs.CreateJobRequest;
Expand Down Expand Up @@ -93,8 +95,11 @@ public Job createJob(@RequestBody CreateJobRequest jobRequest) {
LogEntryState state = LogEntryState.SUCCESS;

try {
SelectedItems<?> sourceObjects = CommonServicesUtils.convertSelectedItems(jobRequest.getSourceObjects(),
SelectedItemsUtils.parseClass(jobRequest.getSourceObjectsClass()));
Class<? extends IsIndexed> sourceObjectsClass = null;
if (!(jobRequest.getSourceObjects() instanceof SelectedItemsNoneRequest)) {
sourceObjectsClass = SelectedItemsUtils.parseClass(jobRequest.getSourceObjectsClass());
}
SelectedItems<?> sourceObjects = CommonServicesUtils.convertSelectedItems(jobRequest.getSourceObjects(), sourceObjectsClass);
Job job = JobUtils.createJob(jobRequest.getName(), JobPriority.valueOf(jobRequest.getPriority()),
JobParallelism.valueOf(jobRequest.getParallelism()), sourceObjects, jobRequest.getPlugin(),
jobRequest.getPluginParameters());
Expand Down

0 comments on commit c423075

Please sign in to comment.