com.evolveum.midpoint.task.impl
Class ScheduleEvaluator

java.lang.Object
  extended by com.evolveum.midpoint.task.impl.ScheduleEvaluator

public class ScheduleEvaluator
extends java.lang.Object

Evaluates schedules.

Author:
Radovan Semancik

Constructor Summary
ScheduleEvaluator()
           
 
Method Summary
static long determineNextRunStartTime(Task task)
          Determines the time when a task should run (for recurrent tasks).
static long determineNextRunStartTime(TaskType taskType)
           
static long determineSleepTime(Task task)
          Determines how long to sleep until next run of this (cyclic) tasks.
static long determineSleepTime(TaskType taskType)
          Determines how long to sleep until next run of this (cyclic) tasks.
static boolean missedScheduledStart(TaskType taskType)
          Determines whether this task has missed its scheduled start.
static boolean shouldRun(TaskType taskType)
          Determines whether the task should be started now (used by the task scanner).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduleEvaluator

public ScheduleEvaluator()
Method Detail

shouldRun

public static boolean shouldRun(TaskType taskType)
Determines whether the task should be started now (used by the task scanner). For recurring tasks it uses determineSleepTime (that uses pre-computed nextRunStartTime). For single-run tasks it signals immediate run.

Parameters:
taskType -
Returns:

missedScheduledStart

public static boolean missedScheduledStart(TaskType taskType)
Determines whether this task has missed its scheduled start. It can occur for tasks scheduled to a fixed moment (currently using cron-like specification).

Parameters:
taskType -
Returns:

determineSleepTime

public static long determineSleepTime(Task task)
Determines how long to sleep until next run of this (cyclic) tasks. Uses pre-computed nextRunStartTime.

Parameters:
task -
Returns:
0 when nextRunStartTime is not defined

determineSleepTime

public static long determineSleepTime(TaskType taskType)
Determines how long to sleep until next run of this (cyclic) tasks. Uses pre-computed nextRunStartTime.

Parameters:
task -
Returns:
0 when nextRunStartTime is not defined

determineNextRunStartTime

public static long determineNextRunStartTime(Task task)
Determines the time when a task should run (for recurrent tasks). It is usually called after the previous run finishes.

Parameters:
taskImpl -
Returns:

determineNextRunStartTime

public static long determineNextRunStartTime(TaskType taskType)


Copyright © 2012 evolveum. All Rights Reserved.