public static boolean shouldRun ( String entry , Date atTime ) { entry = entry . trim ( ) . toUpperCase ( ) ; if ( ANNUALLY . equals ( entry ) || ( YEARLY . equals ( entry ) ) ) { entry = "0 0 1 1 *" ; } else if ( MONTHLY . equals ( entry ) ) { entry = "0 0 1 * *" ; } else if ( WEEKLY . equals ( entry ) ) { entry = "0 0 * * 0" ; } else if ( DAILY . equals ( entry ) || ( MIDNIGHT . equals ( entry ) ) ) { entry = "0 0 * * *" ; } else if ( HOURLY . equals ( entry ) ) { entry = "0 * * * *" ; } return new CronTabEntry ( entry ) . isRunnable ( atTime ) ; }
Determines if the given CRON entry is runnable at this current moment in time . This mimics the original implementation of the CRON table .