View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.core.provisioning.api.job;
20  
21  import java.time.OffsetDateTime;
22  import java.util.Map;
23  import org.apache.syncope.core.persistence.api.entity.Report;
24  import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
25  import org.apache.syncope.core.persistence.api.entity.task.Task;
26  import org.quartz.JobKey;
27  import org.quartz.Scheduler;
28  import org.quartz.SchedulerException;
29  
30  @SuppressWarnings("squid:S1214")
31  public interface JobManager {
32  
33      String TASK_TYPE = "taskType";
34  
35      String TASK_KEY = "taskKey";
36  
37      String REPORT_KEY = "reportKey";
38  
39      String DOMAIN_KEY = "domain";
40  
41      String EXECUTOR_KEY = "executor";
42  
43      String DRY_RUN_JOBDETAIL_KEY = "dryRun";
44  
45      String DELEGATE_IMPLEMENTATION = "delegateImpl";
46  
47      JobKey NOTIFICATION_JOB = new JobKey("notificationJob", Scheduler.DEFAULT_GROUP);
48  
49      boolean isRunning(JobKey jobKey) throws SchedulerException;
50  
51      Map<String, Object> register(
52              SchedTask task,
53              OffsetDateTime startAt,
54              String executor) throws SchedulerException;
55  
56      Map<String, Object> register(
57              Report report,
58              OffsetDateTime startAt,
59              String executor) throws SchedulerException;
60  
61      void unregister(Task<?> task);
62  
63      void unregister(Report report);
64  }