1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.provisioning.java.job;
20
21 import org.apache.syncope.core.persistence.api.dao.BatchDAO;
22 import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
23 import org.quartz.JobExecutionContext;
24 import org.quartz.JobExecutionException;
25 import org.springframework.beans.factory.annotation.Autowired;
26
27 public class ExpiredBatchCleanup extends AbstractSchedTaskJobDelegate<SchedTask> {
28
29 @Autowired
30 private BatchDAO batchDAO;
31
32 @Override
33 protected String doExecute(final boolean dryRun, final String executor, final JobExecutionContext context)
34 throws JobExecutionException {
35
36 if (!dryRun) {
37 int deleted = batchDAO.deleteExpired();
38 LOG.debug("Successfully deleted {} expired batch requests", deleted);
39 }
40
41 return "SUCCESS";
42 }
43 }