public Trigger getSimpleTrigger ( TimeUnit timeUnit , int timeInterval ) { SimpleScheduleBuilder simpleScheduleBuilder = null ; simpleScheduleBuilder = SimpleScheduleBuilder . simpleSchedule ( ) ; switch ( timeUnit ) { case MILLISECONDS : simpleScheduleBuilder . withIntervalInMilliseconds ( timeInterval ) . repeatForever ( ) ; break ; case SECONDS : simpleScheduleBuilder . withIntervalInSeconds ( timeInterval ) . repeatForever ( ) ; break ; case MINUTES : simpleScheduleBuilder . withIntervalInMinutes ( timeInterval ) . repeatForever ( ) ; break ; case HOURS : simpleScheduleBuilder . withIntervalInHours ( timeInterval ) . repeatForever ( ) ; break ; case DAYS : simpleScheduleBuilder . withIntervalInHours ( timeInterval * 24 ) . repeatForever ( ) ; break ; default : simpleScheduleBuilder . withIntervalInSeconds ( 1 ) . repeatForever ( ) ; //default 1 sec } Trigger simpleTrigger = TriggerBuilder . newTrigger ( ) . withSchedule ( simpleScheduleBuilder ) . build ( ) ; return simpleTrigger ; }
Gets the simple trigger .