Package org.bonitasoft.engine.scheduler
Interface JobService
- All Known Implementing Classes:
JobServiceImpl
public interface JobService
- Since:
- 6.1
- Author:
- Celine Souchet
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateJobDescriptor(SJobDescriptor sJobDescriptor) Create a new job descriptorcreateJobLog(SJobLog sJobLog) Create a new job logcreateJobParameter(SJobParameter sJobParameter, long jobDescriptorId) Create a new job parametercreateJobParameters(List<SJobParameter> parameters, long jobDescriptorId) Create new job parametersvoidDelete all job descriptorsvoiddeleteJobDescriptor(long id) Delete the specified job descriptorvoiddeleteJobDescriptor(SJobDescriptor sJobDescriptor) Delete the specified job descriptorvoiddeleteJobDescriptorByJobName(String jobName) Delete a job descriptor corresponding to the given job namevoiddeleteJobLog(long id) Delete the specified job logvoiddeleteJobLog(SJobLog sJobLog) Delete the specified job logvoiddeleteJobLogs(long jobDescriptorId) Delete allSJobLogof a specificSJobDescriptorvoiddeleteJobParameter(long id) Delete the specified job parametervoiddeleteJobParameter(SJobParameter sJobParameter) Delete the specified job parametergetFailedJobs(int startIndex, int maxResults) Get list of failed jobsgetJobDescriptor(long id) Get a specific job descriptorgetJobLog(long id) Get a specific job loggetJobLogs(long jobDescriptorId, int fromIndex, int maxResults) Get allSJobLogof a specificSJobDescriptorgetJobParameter(long id) Get a specific job parametergetJobParameters(Long jobDescriptorId) get parameters of a joblonggetNumberOfJobDescriptors(QueryOptions queryOptions) Get total number of job descriptorslonggetNumberOfJobLogs(QueryOptions queryOptions) Get total number of job logsvoidlogJobError(Throwable jobException, Long jobDescriptorId) log an error on a jobsearchJobDescriptors(QueryOptions queryOptions) Search all job descriptors according to specific criteriasearchJobLogs(QueryOptions queryOptions) Search all job logs according to specific criteriasetJobParameters(long jobDescriptorId, List<SJobParameter> parameters) Delete jobs parameters corresponding to the job descriptor, if exist.voidupdateJobLog(SJobLog jobLog, EntityUpdateDescriptor descriptor) Update aSJobLog
-
Field Details
-
JOB_DESCRIPTOR
- See Also:
-
JOB_PARAMETER
- See Also:
-
JOB_LOG
- See Also:
-
-
Method Details
-
createJobDescriptor
SJobDescriptor createJobDescriptor(SJobDescriptor sJobDescriptor) throws SJobDescriptorCreationException Create a new job descriptor- Parameters:
sJobDescriptor- JobDescriptor to create- Returns:
- The created jobDescriptor
- Throws:
SJobDescriptorCreationException- Since:
- 6.1
-
deleteJobDescriptor
void deleteJobDescriptor(long id) throws SJobDescriptorNotFoundException, SJobDescriptorReadException, SJobDescriptorDeletionException Delete the specified job descriptor- Parameters:
id- Identifier of job descriptor to delete- Throws:
SJobDescriptorReadExceptionSJobDescriptorNotFoundExceptionSJobDescriptorDeletionException- Since:
- 6.1
-
deleteJobDescriptor
Delete the specified job descriptor- Parameters:
sJobDescriptor- JobDescriptor to delete- Throws:
SJobDescriptorDeletionException- Since:
- 6.1
-
deleteAllJobDescriptors
Delete all job descriptors- Throws:
SJobDescriptorDeletionException- Since:
- 6.4
-
deleteJobDescriptorByJobName
Delete a job descriptor corresponding to the given job name- Parameters:
jobName- name of job we want the jobDsecriptor to be deleted- Throws:
SJobDescriptorDeletionException- Since:
- 6.3
-
getJobDescriptor
Get a specific job descriptor- Parameters:
id- Identifier of job descriptor- Returns:
- Null if the job descriptor doesn't exist, else the
SJobDescriptorcorresponding to the identifier - Throws:
SJobDescriptorReadException- Since:
- 6.1
-
getNumberOfJobDescriptors
Get total number of job descriptors- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- total number of job logs
- Throws:
SBonitaReadException
-
searchJobDescriptors
Search all job descriptors according to specific criteria- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- A list of SJobParameter objects
- Throws:
SBonitaReadException- Since:
- 6.1
-
createJobParameters
List<SJobParameter> createJobParameters(List<SJobParameter> parameters, long jobDescriptorId) throws SJobParameterCreationException Create new job parameters- Parameters:
parameters- JobParameters to createjobDescriptorId- Identifier of job descriptor- Returns:
- Throws:
SJobParameterCreationException- Since:
- 6.2
-
setJobParameters
List<SJobParameter> setJobParameters(long jobDescriptorId, List<SJobParameter> parameters) throws SJobParameterCreationException Delete jobs parameters corresponding to the job descriptor, if exist. After, create new job parameters- Parameters:
jobDescriptorId-parameters-- Returns:
- A list of new SJobParameter objects
- Throws:
SJobParameterCreationException- Since:
- 6.1
-
createJobParameter
SJobParameter createJobParameter(SJobParameter sJobParameter, long jobDescriptorId) throws SJobParameterCreationException Create a new job parameter- Parameters:
sJobParameter- JobParameter to createjobDescriptorId- Identifier of job descriptor- Returns:
- Throws:
SJobParameterCreationException- Since:
- 6.2
-
deleteJobParameter
void deleteJobParameter(long id) throws SJobParameterNotFoundException, SJobParameterReadException, SJobParameterDeletionException Delete the specified job parameter- Parameters:
id- Identifier of job parameter to delete- Throws:
SJobParameterReadExceptionSJobParameterNotFoundExceptionSJobParameterDeletionException- Since:
- 6.1
-
deleteJobParameter
Delete the specified job parameter- Parameters:
sJobParameter- JobParameter to delete- Throws:
SJobParameterDeletionException- Since:
- 6.1
-
getJobParameter
SJobParameter getJobParameter(long id) throws SJobParameterNotFoundException, SJobParameterReadException Get a specific job parameter- Parameters:
id- Identifier of job parameter- Returns:
- Throws:
SJobParameterReadExceptionSJobParameterNotFoundException- Since:
- 6.1
-
getJobParameters
get parameters of a job- Throws:
SBonitaReadException
-
createJobLog
Create a new job log- Parameters:
sJobLog- JobLog to create- Returns:
- Throws:
SJobLogCreationException- Since:
- 6.2
-
deleteJobLog
Delete the specified job log- Parameters:
id- Identifier of job log to delete- Throws:
SBonitaReadExceptionSJobLogDeletionException- Since:
- 6.1
-
deleteJobLog
Delete the specified job log- Parameters:
sJobLog- JobLog to delete- Throws:
SJobLogDeletionException- Since:
- 6.1
-
getJobLog
Get a specific job log- Parameters:
id- Identifier of job log- Returns:
- Throws:
SBonitaReadException- Since:
- 6.1
-
getNumberOfJobLogs
Get total number of job logs- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- total number of job logs
- Throws:
SBonitaReadException
-
searchJobLogs
Search all job logs according to specific criteria- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- A list of SJobLog objects
- Throws:
SBonitaReadException- Since:
- 6.1
-
getFailedJobs
Get list of failed jobs- Parameters:
startIndex-maxResults-- Returns:
- A list of SFailedJob objects
- Throws:
SFailedJobReadException- Since:
- 6.2
-
updateJobLog
void updateJobLog(SJobLog jobLog, EntityUpdateDescriptor descriptor) throws SJobLogUpdatingException Update aSJobLog- Parameters:
jobLog- The log to updatedescriptor-- Throws:
SJobLogUpdatingException- Since:
- 6.4.0
-
deleteJobLogs
Delete allSJobLogof a specificSJobDescriptor- Parameters:
jobDescriptorId- The identifier of theSJobDescriptor- Throws:
SBonitaReadExceptionSJobLogDeletionException- Since:
- 6.4.0
-
getJobLogs
List<SJobLog> getJobLogs(long jobDescriptorId, int fromIndex, int maxResults) throws SBonitaReadException Get allSJobLogof a specificSJobDescriptor- Parameters:
jobDescriptorId- The identifier of theSJobDescriptorfromIndex- The index of the first element of the listmaxResults- The nulber max of elements of the list- Returns:
- A list of
SJobLog - Throws:
SBonitaReadException- Since:
- 6.4.0
-
logJobError
void logJobError(Throwable jobException, Long jobDescriptorId) throws SBonitaReadException, SJobLogUpdatingException, SJobLogCreationException, SJobDescriptorReadException log an error on a job- Parameters:
jobException- the exceptionjobDescriptorId- the id of the job- Throws:
SBonitaReadExceptionSJobLogUpdatingExceptionSJobLogCreationExceptionSJobDescriptorReadException- Since:
- 7.2.0
-