1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.persistence.api.dao;
20
21 import java.time.OffsetDateTime;
22 import java.util.List;
23 import java.util.Optional;
24 import org.apache.syncope.common.lib.to.PropagationTaskTO;
25 import org.apache.syncope.common.lib.types.AnyTypeKind;
26 import org.apache.syncope.common.lib.types.ExecStatus;
27 import org.apache.syncope.common.lib.types.TaskType;
28 import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
29 import org.apache.syncope.core.persistence.api.entity.ExternalResource;
30 import org.apache.syncope.core.persistence.api.entity.Implementation;
31 import org.apache.syncope.core.persistence.api.entity.Notification;
32 import org.apache.syncope.core.persistence.api.entity.Realm;
33 import org.apache.syncope.core.persistence.api.entity.task.MacroTask;
34 import org.apache.syncope.core.persistence.api.entity.task.PullTask;
35 import org.apache.syncope.core.persistence.api.entity.task.PushTask;
36 import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
37 import org.apache.syncope.core.persistence.api.entity.task.Task;
38
39 public interface TaskDAO extends DAO<Task<?>> {
40
41 boolean exists(TaskType type, String key);
42
43 <T extends Task<T>> T find(TaskType type, String key);
44
45 <T extends SchedTask> Optional<T> findByName(TaskType type, String name);
46
47 Optional<Task<?>> find(String key);
48
49 List<SchedTask> findByDelegate(Implementation delegate);
50
51 List<PullTask> findByReconFilterBuilder(Implementation reconFilterBuilder);
52
53 List<PullTask> findByPullActions(Implementation pullActions);
54
55 List<PushTask> findByPushActions(Implementation pushActions);
56
57 List<MacroTask> findByCommand(Implementation delegate);
58
59 List<MacroTask> findByRealm(Realm realm);
60
61 <T extends Task<T>> List<T> findToExec(TaskType type);
62
63 <T extends Task<T>> List<T> findAll(TaskType type);
64
65 <T extends Task<T>> List<T> findAll(
66 TaskType type,
67 ExternalResource resource,
68 Notification notification,
69 AnyTypeKind anyTypeKind,
70 String entityKey,
71 int page,
72 int itemsPerPage,
73 List<OrderByClause> orderByClauses);
74
75 int count(
76 TaskType type,
77 ExternalResource resource,
78 Notification notification,
79 AnyTypeKind anyTypeKind,
80 String entityKey);
81
82 <T extends Task<T>> T save(T task);
83
84 void delete(TaskType type, String key);
85
86 void delete(Task<?> task);
87
88 void deleteAll(ExternalResource resource, TaskType type);
89
90 List<PropagationTaskTO> purgePropagations(
91 OffsetDateTime since,
92 List<ExecStatus> statuses,
93 List<ExternalResource> externalResources);
94 }