@ Nonnull public static TriggerKey schedule ( @ Nonnull final IScheduleBuilder < ? extends ITrigger > aScheduleBuilder , @ Nonnegative final long nThresholdBytes ) { ValueEnforcer . notNull ( aScheduleBuilder , "ScheduleBuilder" ) ; ValueEnforcer . isGE0 ( nThresholdBytes , "ThresholdBytes" ) ; final ICommonsMap < String , Object > aJobDataMap = new CommonsHashMap <> ( ) ; aJobDataMap . put ( JOB_DATA_ATTR_THRESHOLD_BYTES , Long . valueOf ( nThresholdBytes ) ) ; return GlobalQuartzScheduler . getInstance ( ) . scheduleJob ( CheckDiskUsableSpaceJob . class . getName ( ) , JDK8TriggerBuilder . newTrigger ( ) . startNow ( ) . withSchedule ( aScheduleBuilder ) , CheckDiskUsableSpaceJob . class , aJobDataMap ) ; }
Call this method to schedule the check disk usage job to run .