Class SmartExecutorScheduler
- java.lang.Object
-
- org.gcube.vremanagement.executor.scheduler.SmartExecutorScheduler
-
public class SmartExecutorScheduler extends Object
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<UUID>scheduledJobsprotected org.quartz.Schedulerscheduler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.quartz.TriggerBuilder<? extends org.quartz.Trigger>createTriggerBuilder(UUID uuid, org.quartz.ScheduleBuilder<? extends org.quartz.Trigger> sb)protected List<org.quartz.JobExecutionContext>getCurrentlyExecutingJobs(org.quartz.Scheduler scheduler)org.gcube.vremanagement.executor.api.types.LaunchParametergetLaunchParameter(org.quartz.JobKey jobKey)protected org.quartz.TriggerBuilder<? extends org.quartz.Trigger>getTriggerBuilderWithScheduling(UUID uuid, org.gcube.vremanagement.executor.api.types.Scheduling scheduling)protected voidreallySchedule(UUID uuid, org.gcube.vremanagement.executor.api.types.LaunchParameter parameter)Create the Scheduler using the strategy provided by LaunchParameterUUIDschedule(org.gcube.vremanagement.executor.api.types.LaunchParameter parameter, UUID uuid)Schedule a task executionvoidstop(UUID uuid, boolean remove)Stop the execution of the Task identified by UUIDvoidstopAll()protected voidstopTask(UUID uuid)
-
-
-
Method Detail
-
createTriggerBuilder
protected org.quartz.TriggerBuilder<? extends org.quartz.Trigger> createTriggerBuilder(UUID uuid, org.quartz.ScheduleBuilder<? extends org.quartz.Trigger> sb)
-
getTriggerBuilderWithScheduling
protected org.quartz.TriggerBuilder<? extends org.quartz.Trigger> getTriggerBuilderWithScheduling(UUID uuid, org.gcube.vremanagement.executor.api.types.Scheduling scheduling) throws org.gcube.vremanagement.executor.exception.LaunchException
- Throws:
org.gcube.vremanagement.executor.exception.LaunchException
-
reallySchedule
protected void reallySchedule(UUID uuid, org.gcube.vremanagement.executor.api.types.LaunchParameter parameter) throws org.gcube.vremanagement.executor.exception.LaunchException, org.quartz.SchedulerException
Create the Scheduler using the strategy provided by LaunchParameter- Parameters:
uuid- the UUID will be used to identify the taskparameter- LaunchParameter requested in service invocation- Throws:
org.gcube.vremanagement.executor.exception.LaunchException- if the LaunchParameter does not contains a valid scheduling strategyorg.quartz.SchedulerException- if the scheduler cannot be created by the scheduler factory
-
schedule
public UUID schedule(org.gcube.vremanagement.executor.api.types.LaunchParameter parameter, UUID uuid) throws org.gcube.vremanagement.executor.exception.InputsNullException, org.gcube.vremanagement.executor.exception.PluginNotFoundException, org.gcube.vremanagement.executor.exception.LaunchException
Schedule a task execution- Parameters:
parameter- LaunchParameter requested in service invocation- Returns:
- the UUID which will identify the task
- Throws:
org.gcube.vremanagement.executor.exception.LaunchException- if the LaunchParameter does not contains a valid scheduling strategyorg.gcube.vremanagement.executor.exception.InputsNullException- if provided input map is nullorg.gcube.vremanagement.executor.exception.PluginNotFoundException- if the request plugin is not available on this smart executor instance
-
stopTask
protected void stopTask(UUID uuid) throws org.gcube.vremanagement.executor.exception.UnableToInterruptTaskException
- Throws:
org.gcube.vremanagement.executor.exception.UnableToInterruptTaskException
-
getCurrentlyExecutingJobs
protected List<org.quartz.JobExecutionContext> getCurrentlyExecutingJobs(org.quartz.Scheduler scheduler) throws org.quartz.SchedulerException
- Throws:
org.quartz.SchedulerException
-
getLaunchParameter
public org.gcube.vremanagement.executor.api.types.LaunchParameter getLaunchParameter(org.quartz.JobKey jobKey) throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
stop
public void stop(UUID uuid, boolean remove) throws Exception
Stop the execution of the Task identified by UUID- Parameters:
uuid- which identify the Taskremove- : when the Task is a Scheduled one indicate if the Task has to be released or to be removed (the argument is set to true when an explicit request arrive to remove the scheduled task)- Throws:
ExceptionSchedulerNotFoundException
-
stopAll
public void stopAll() throws org.quartz.SchedulerException- Throws:
org.quartz.SchedulerException
-
-