
org.bonitasoft.engine.scheduler.SchedulerService Maven / Gradle / Ivy
/**
* Copyright (C) 2011-2013 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.bonitasoft.engine.scheduler;
import java.util.List;
import org.bonitasoft.engine.events.model.FireEventException;
/**
* @author Matthieu Chaffotte
* @since 6.0
*/
public interface SchedulerService {
String JOB_DESCRIPTOR = "JOB_DESCRIPTOR";
String JOB_PARAMETER = "JOB_PARAMETER";
/**
* This service will fire the following events :
*
* - SCHEDULER_STARTED = "SCHEDULER_STARTED"
* - SCHEDULER_STOPPED = "SCHEDULER_STOPPED"
* - JOB_FAILED = "JOB_FAILED"
*
*/
String SCHEDULER_STARTED = "SCHEDULER_STARTED";
String SCHEDULER_STOPPED = "SCHEDULER_STOPPED";
String JOB_FAILED = "JOB_FAILED";
/**
* Checks whether the service is started.
*
* @return true if the service is started; false otherwise.
* @throws SSchedulerException
* if an exception occurs.
*/
boolean isStarted() throws SSchedulerException;
/**
* Checks whether the service is shutdown.
*
* @return true if the service is shutdown; false otherwise.
* @throws SSchedulerException
*/
boolean isShutdown() throws SSchedulerException;
/**
* Starts the scheduler service.
*
* @throws SSchedulerException
* if an exception occurs.
* @throws FireEventException
*/
void start() throws SSchedulerException, FireEventException;
/**
* Shutdowns the scheduler service.
*
* @throws SSchedulerException
* if an exception occurs.
* @throws FireEventException
*/
void shutdown() throws SSchedulerException, FireEventException;
/**
* Schedules a job.
*
* @param jobDescriptor
* @param trigger
* @throws SSchedulerException
* if an exception occurs.
* @throws FireEventException
*/
void schedule(SJobDescriptor jobDescriptor, Trigger trigger) throws SSchedulerException, FireEventException;
/**
* Schedules a job.
*
* @param jobDescriptor
* @param jobParameters
* @param trigger
* @throws SSchedulerException
* if an exception occurs.
* @throws FireEventException
*/
void schedule(SJobDescriptor jobDescriptor, List parameters, Trigger trigger) throws SSchedulerException, FireEventException;
/**
* execute a job.
*
* @param jobDescriptor
* @param jobParameters
* @throws SSchedulerException
* if an exception occurs.
* @throws FireEventException
*/
void executeNow(SJobDescriptor jobDescriptor, List parameters) throws SSchedulerException, FireEventException;
/**
* Deletes a job according to its name.
*
* @param jobName
* the job name
* @return true if delete a job, otherwise return false.
* @throws SSchedulerException
* if an exception occurs.
*/
boolean delete(String jobName) throws SSchedulerException;
/**
* Deletes all jobs in a group.
*
* @throws SSchedulerException
* if an exception occurs.
*/
void deleteJobs() throws SSchedulerException;
/**
* Get all jobs on the current tenant
*
* @return all jobs on the current tenant
* @throws SSchedulerException
* if an exception occurs.
*/
List getJobs() throws SSchedulerException;
/**
* Get the builder of job description
*
* @return job descriptor builder
*/
JobDescriptorBuilder getJobDescriptorBuilder();
/**
* Get the builder of job parameter
*
* @return job parameter builder
*/
JobParameterBuilder getJobParameterBuilder();
/**
* Get all jobs on all tenants
* \/!\Must be replaced by a platform scheduler/!\
*
* @return all jobs on the current tenant
* @throws SSchedulerException
* if an exception occurs.
*/
List getAllJobs() throws SSchedulerException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy