Package org.pentaho.platform.api.scheduler2

Examples of org.pentaho.platform.api.scheduler2.Job


            }
          }
        }
      }
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException(
          Messages.getInstance().getString( "QuartzScheduler.ERROR_0004_FAILED_TO_LIST_JOBS" ), e ); //$NON-NLS-1$
    }
    return jobs;
  }
View Full Code Here


  /** {@inheritDoc} */
  public void pause() throws SchedulerException {
    try {
      getQuartzScheduler().standby();
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( e );
    }
  }
View Full Code Here

  public void pauseJob( String jobId ) throws SchedulerException {
    try {
      Scheduler scheduler = getQuartzScheduler();
      scheduler.pauseJob( jobId, QuartzJobKey.parse( jobId ).getUserName() );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance()
          .getString( "QuartzScheduler.ERROR_0005_FAILED_TO_PAUSE_JOBS" ), e ); //$NON-NLS-1$
    }
  }
View Full Code Here

  public void removeJob( String jobId ) throws SchedulerException {
    try {
      Scheduler scheduler = getQuartzScheduler();
      scheduler.deleteJob( jobId, QuartzJobKey.parse( jobId ).getUserName() );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance()
          .getString( "QuartzScheduler.ERROR_0005_FAILED_TO_PAUSE_JOBS" ), e ); //$NON-NLS-1$
    }
  }
View Full Code Here

  /** {@inheritDoc} */
  public void start() throws SchedulerException {
    try {
      getQuartzScheduler().start();
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( e );
    }
  }
View Full Code Here

  public void resumeJob( String jobId ) throws SchedulerException {
    try {
      Scheduler scheduler = getQuartzScheduler();
      scheduler.resumeJob( jobId, QuartzJobKey.parse( jobId ).getUserName() );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance().getString(
          "QuartzScheduler.ERROR_0005_FAILED_TO_RESUME_JOBS" ), e ); //$NON-NLS-1$
    }
  }
View Full Code Here

        schedulerStatus = SchedulerStatus.PAUSED;
      } else if ( getQuartzScheduler().isStarted() ) {
        schedulerStatus = SchedulerStatus.RUNNING;
      }
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance().getString(
          "QuartzScheduler.ERROR_0006_FAILED_TO_GET_SCHEDULER_STATUS" ), e ); //$NON-NLS-1$
    }
    return schedulerStatus;
  }
View Full Code Here

  public void shutdown() throws SchedulerException {
    try {
      boolean waitForJobsToComplete = true;
      getQuartzScheduler().shutdown( waitForJobsToComplete );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( e );
    }
  }
View Full Code Here

        scheduleRequest.getSimpleJobTrigger() == null && scheduleRequest.getComplexJobTrigger() == null
            && scheduleRequest.getCronJobTrigger() == null;

    // add 10 seconds to the RIB to ensure execution (see PPP-3264)
    IJobTrigger jobTrigger =
        runInBackground ? new SimpleJobTrigger( new Date( System.currentTimeMillis() + 10000 ), null, 0, 0 ) : scheduleRequest.getSimpleJobTrigger();

    if ( scheduleRequest.getSimpleJobTrigger() != null ) {
      SimpleJobTrigger simpleJobTrigger = scheduleRequest.getSimpleJobTrigger();

      if ( simpleJobTrigger.getStartTime() == null ) {
        simpleJobTrigger.setStartTime( new Date() );
      }

      jobTrigger = simpleJobTrigger;

    } else if ( scheduleRequest.getComplexJobTrigger() != null ) {
View Full Code Here

  }

  private void scheduleJob( int intervalInSeconds ) throws Exception {

    IScheduler scheduler = PentahoSystem.get( IScheduler.class, "IScheduler2", null ); //$NON-NLS-1$
    JobTrigger trigger = new SimpleJobTrigger( new Date(), null, -1, intervalInSeconds );

    jobMap.put( "transFileName", getTransFileName() );
    scheduler.createJob( GatherStatsListener.JOB_NAME, GatherStatsAction.class, jobMap, trigger );
    logger.info( "Statistics gathering jop has been scheduled." );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.scheduler2.Job

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.