Package org.quartz

Examples of org.quartz.CronExpression


    public void testValidFormat() {
        String test = "23asdf";
        boolean failed = false;
        try {
            CronExpression ce = new CronExpression(test);
        } catch (ParseException e) {
            failed = true;
        }
        assert failed;

        test = "0 0 3 * * ?";
        failed = false;
        try {
            CronExpression ce = new CronExpression(test);
        } catch (ParseException e) {
            failed = true;
        }

        assert !failed;
View Full Code Here


        entry.getMinuteAsString(),
        entry.getHourAsString(),
        dayOfMonth,
        entry.getMonthAsString(),
        dayOfWeek);
    CronExpression cronExpression;
    try {
      cronExpression = new CronExpression(rawCronExpresion);
    } catch (ParseException e) {
      throw Throwables.propagate(e);
    }
    cronExpression.setTimeZone(timeZone);
    return cronExpression;
  }
View Full Code Here

    this.timeZone = requireNonNull(timeZone);
  }

  @Override
  public Date predictNextRun(CrontabEntry schedule) {
    CronExpression cronExpression = Quartz.cronExpression(schedule, timeZone);
    return cronExpression.getNextValidTimeAfter(new Date(clock.nowMillis()));
  }
View Full Code Here

//    DateBuilder.
   
    try {
     
     
      CronExpression cronExpression = new CronExpression("0 15 10 L-2 * ? 2010");
     
      CronTriggerImpl trigger = new CronTriggerImpl();
      trigger.setCronExpression(cronExpression);
     
      JobDetail job = newJob(SimpleJob.class).withIdentity("job1", "group1").build();
View Full Code Here

    public boolean isValid(final Report object, final ConstraintValidatorContext context) {
        boolean isValid = true;

        if (object.getCronExpression() != null) {
            try {
                new CronExpression(object.getCronExpression());
            } catch (ParseException e) {
                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                isValid = false;

                context.disableDefaultConstraintViolation();
View Full Code Here

                    addNode("jobClassName").addConstraintViolation();
        }

        if (isValid && object.getCronExpression() != null) {
            try {
                new CronExpression(object.getCronExpression());
            } catch (ParseException e) {
                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                isValid = false;

                context.disableDefaultConstraintViolation();
View Full Code Here

        if (value == null) {
            return true;
        }

        try {
            new CronExpression((String) value);
        } catch (ParseException e) {
            return false;
        }

        return true;
View Full Code Here

        boolean isValid = true;

        if (object.getCronExpression() != null) {
            try {
                new CronExpression(object.getCronExpression());
            } catch (ParseException e) {
                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                isValid = false;

                context.disableDefaultConstraintViolation();
View Full Code Here

                    addNode("jobClassName").addConstraintViolation();
        }

        if (isValid && object.getCronExpression() != null) {
            try {
                new CronExpression(object.getCronExpression());
            } catch (ParseException e) {
                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                isValid = false;

                context.disableDefaultConstraintViolation();
View Full Code Here

        cronTriggerBean.setName(jobSchedulerConfiguration.getJobName() + TRIGGER_SUFFIX);
        cronTriggerBean.setGroup(jobSchedulerConfiguration.getJobGroup()
                + TRIGGER_SUFFIX);

        try {
            cronTriggerBean.setCronExpression(new CronExpression(
                    jobSchedulerConfiguration.getCronExpression()));
            cronTriggerBean.setJobName(jobSchedulerConfiguration.getJobName());
            cronTriggerBean
                    .setJobGroup(jobSchedulerConfiguration.getJobGroup());
            return cronTriggerBean;
View Full Code Here

TOP

Related Classes of org.quartz.CronExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.