2 * ============LICENSE_START========================================================================
\r
3 * ONAP : tr-069-adapter
\r
4 * =================================================================================================
\r
5 * Copyright (C) 2020 CommScope Inc Intellectual Property.
\r
6 * =================================================================================================
\r
7 * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
\r
8 * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
\r
9 * may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
\r
14 * either express or implied. See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
16 * ===============LICENSE_END=======================================================================
\r
20 package org.commscope.tr069adapter.common.scheduler;
\r
22 import java.util.List;
\r
23 import java.util.Map;
\r
24 import java.util.Set;
\r
26 public interface SchedulerManager {
\r
29 * Add the given job to the scheduler along with trigger details provided. This method is used to
\r
30 * run the job repeatedly at a given time interval. It throws an scheduler exception in case any
\r
31 * problem with the given data or some unexpected exception occurred while adding the job to the
\r
34 * @param jobName - String object representing the job name. which can be used later to query the
\r
36 * @param triggerInfo - object contains the information about the trigger of this particular job.
\r
37 * @param jobContext - jobContext information which can be passed at the time of scheduling the
\r
38 * job. Note that it is strictly recommended to put only primitive types in this map.
\r
39 * Putting objects are not recommended.
\r
41 * @throws SchedulerException - An object representing the error details which caused the problem
\r
42 * while scheduling the job.
\r
44 public void scheduleJob(String jobName, TriggerInfo triggerInfo, ExecutionContext jobContext)
\r
45 throws SchedulerException;
\r
48 * Add the given job to the scheduler along with trigger details provided. This method is used to
\r
49 * run the job repeatedly at a given time interval. It throws an scheduler exception in case any
\r
50 * problem with the given data or some unexpected exception occurred while adding the job to the
\r
53 * @param jobName - String object representing the job name. which can be used later to query the
\r
55 * @param jobGroup - String object representing the job group. which can be used later to query
\r
57 * @param triggerInfo - object contains the information about the trigger of this particular job.
\r
58 * @param jobContext - jobContext information which can be passed at the time of scheduling the
\r
59 * job. Note that it is strictly recommended to put only primitive types in this map.
\r
60 * Putting objects are not recommended.
\r
62 * @throws SchedulerException - An object representing the error details which caused the problem
\r
63 * while scheduling the job.
\r
65 public void scheduleJob(String jobName, String jobGroup, TriggerInfo triggerInfo,
\r
66 ExecutionContext jobContext) throws SchedulerException;
\r
69 * Add the given job to the scheduler along with trigger details provided. This method is used to
\r
70 * run the job repeatedly at a given time interval. It throws an scheduler exception in case any
\r
71 * problem with the given data or some unexpected exception occurred while adding the job to the
\r
74 * @param jobName - String object representing the job name. which can be used later to query the
\r
76 * @param triggerInfo - object contains the information about the trigger of this particular job.
\r
77 * @param expiredTriggerInfo - object contains the information about the trigger of this
\r
78 * particular job which will mark it to expire after end time.
\r
79 * @param jobContext - jobContext information which can be passed at the time of scheduling the
\r
80 * job. Note that it is strictly recommended to put only primitive types in this map.
\r
81 * Putting objects are not recommended.
\r
82 * @param expiredExecutionContext - expiredExecutionContext information which can be passed at the
\r
83 * time of scheduling the job. Note that it is strictly recommended to put only primitive
\r
84 * types in this map. Putting objects are not recommended.
\r
86 * @throws SchedulerException - An object representing the error details which caused the problem
\r
87 * while scheduling the job.
\r
89 public void scheduleJob(String jobName, String jobGroup, TriggerInfo triggerInfo,
\r
90 ExecutionContext jobContext, TriggerInfo expiredTriggerInfo,
\r
91 ExecutionContext expiredExecutionContext) throws SchedulerException;
\r
94 * Modifies the existing scheduled job which causes the changes in the job execution times as per
\r
97 * @param jobName - String object representing the job name. which can be used later to query the
\r
99 * @param triggerInfo - object contains the information about the trigger of this particular job.
\r
100 * @throws SchedulerException - An object representing the error details which caused the problem
\r
101 * while scheduling the job.
\r
103 public void modifySchedule(String jobName, TriggerInfo triggerInfo) throws SchedulerException;
\r
106 * Modifies the existing scheduled job which causes the changes in the job execution times as per
\r
109 * @param jobName - String object representing the job name. which can be used later to query the
\r
111 * @param jobGroup - String object representing the job group. which can be used later to query
\r
113 * @param triggerInfo - object contains the information about the trigger of this particular job.
\r
114 * @throws SchedulerException - An object representing the error details which caused the problem
\r
115 * while scheduling the job.
\r
117 public void modifySchedule(String jobName, String jobGroup, TriggerInfo triggerInfo)
\r
118 throws SchedulerException;
\r
120 public void modifySchedule(String jobName, String jobGroup, TriggerInfo triggerInfo,
\r
121 TriggerInfo expiredTriggerInfo, ExecutionContext expiredExecutionContext)
\r
122 throws SchedulerException;
\r
125 * Returns the list of scheduled jobs along with the job details such as the job status
\r
126 * (enabled/disabled) etc..
\r
130 public List<JobInfo> getJobList();
\r
133 * Returns the job details for a given job name such as the job status (enabled/disabled) etc..
\r
137 public JobInfo getJobInfo(String jobId);
\r
140 * Removes the given job from the schedule. Throws an exceptions in case the job does not exist.
\r
142 * @param jobName - String object representing the job name. which can be used later to query the
\r
145 * @throws SchedulerException - An object representing the error details which caused the problem
\r
146 * while scheduling the job.
\r
148 public void deleteSchedule(String jobName) throws SchedulerException;
\r
151 * Removes the given job from the schedule. Throws an exceptions in case the job does not exist.
\r
153 * @param jobName - String object representing the job name. which can be used later to query the
\r
155 * @param jobGroup - String object representing the job group. which can be used later to query
\r
157 * @throws SchedulerException - An object representing the error details which caused the problem
\r
158 * while scheduling the job.
\r
160 public void deleteSchedule(String jobName, String jobGroup) throws SchedulerException;
\r
163 * Checks if the given job is enabled or not.
\r
165 * @param jobName - String object representing the job name. which can be used later to query the
\r
167 * @return - returns true if job is enabled. False otherwise.
\r
169 public boolean isJobEnabled(String jobName);
\r
172 * Checks if the given job is enabled or not.
\r
174 * @param jobName - String object representing the job name. which can be used later to query the
\r
176 * @param jobGroup - String object representing the job group. which can be used later to query
\r
178 * @return - returns true if job is enabled. False otherwise.
\r
180 public boolean isJobEnabled(String jobName, String jobGroup);
\r
183 * Enables the given job. Throws an exception in case job does not exist.
\r
185 * @param jobName - String object representing the job name. which can be used later to query the
\r
188 * @throws SchedulerException
\r
190 public void enableJob(String jobName) throws SchedulerException;
\r
193 * Enables the given job. Throws an exception in case job does not exist.
\r
195 * @param jobName - String object representing the job name. which can be used later to query the
\r
197 * @param jobGroup - String object representing the job group. which can be used later to query
\r
200 * @throws SchedulerException
\r
202 public void enableJob(String jobName, String jobGroup) throws SchedulerException;
\r
205 * Disables the given job. throws an exception in case the job does not exist.
\r
207 * @param jobName - String object representing the job name. which can be used later to query the
\r
210 * @throws SchedulerException
\r
212 public void disableJob(String jobName) throws SchedulerException;
\r
215 * Disables the given job. throws an exception in case the job does not exist.
\r
217 * @param jobName - String object representing the job name. which can be used later to query the
\r
219 * @param jobGroup - String object representing the job group. which can be used later to query
\r
221 * @throws SchedulerException
\r
223 public void disableJob(String jobName, String jobGroup) throws SchedulerException;
\r
226 * Checks if the job is present already in the system or not.
\r
228 * @param jobName - String object representing the job name. which can be used later to query the
\r
230 * @return - returns false if job is not present in the system.
\r
231 * @throws SchedulerException
\r
233 public boolean isJobExist(String jobName) throws SchedulerException;
\r
236 * Checks if the job is present already in the system or not.
\r
238 * @param jobName - String object representing the job name. which can be used later to query the
\r
240 * @param jobGroup - String object representing the job group. which can be used later to query
\r
242 * @return - returns false if job is not present in the system.
\r
243 * @throws SchedulerException
\r
245 public boolean isJobExist(String jobName, String jobGroup) throws SchedulerException;
\r
247 public JobInfo getJobInfo(String jobId, String string);
\r
250 * Checks if the job schedule exists in the system or not.
\r
252 * @param jobName - String object representing the job name. which can be used later to query the
\r
254 * @return - returns false if job is not present in the system.
\r
255 * @throws SchedulerException
\r
257 public boolean isJobScheduleExist(String jobName, String jobGroup) throws SchedulerException;
\r
259 public void updateJobData(String jobName, String jobGroup, Map<String, Object> jobData)
\r
260 throws SchedulerException;
\r
262 public Map<String, Object> getJobData(String jobName, String jobGroup) throws SchedulerException;
\r
264 public void deleteJobData(String jobName, String jobGroup, Set<String> keys)
\r
265 throws SchedulerException;
\r
267 public boolean resumeQuartzSchedulars() throws SchedulerException;
\r
269 public boolean stopQuartzSchedulars() throws SchedulerException;
\r
271 public void switchToStandby() throws SchedulerException;
\r
273 public void switchToActive() throws SchedulerException;
\r
275 public boolean isQuartzRunninginActiveMode();
\r
277 void deleteSchedule(String startJobName, String endJobName, String monitorJobName,
\r
278 String jobGroup) throws SchedulerException;
\r