Class JobServiceImpl
java.lang.Object
org.bonitasoft.engine.scheduler.impl.JobServiceImpl
- All Implemented Interfaces:
JobService
- Author:
- Celine Souchet, Matthieu Chaffotte
-
Field Summary
Fields inherited from interface org.bonitasoft.engine.scheduler.JobService
JOB_DESCRIPTOR, JOB_LOG, JOB_PARAMETER -
Constructor Summary
ConstructorsConstructorDescriptionJobServiceImpl(EventService eventService, Recorder recorder, ReadPersistenceService readPersistenceService) -
Method Summary
Modifier and TypeMethodDescriptioncreateJobDescriptor(SJobDescriptor sJobDescriptor) Create a new job descriptorvoidcreateJobLog(Throwable jobException, Long jobDescriptorId) createJobLog(SJobLog sJobLog) Create a new job logcreateJobParameter(SJobParameter sJobParameter, long jobDescriptorId) Create a new job parametercreateJobParameters(List<SJobParameter> sJobParameters, long jobDescriptorId) Create new job parametersvoidDelete all job descriptorsprotected voiddeleteAllJobParameters(long jobDescriptorId) voiddeleteJobDescriptor(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
-
Constructor Details
-
JobServiceImpl
public JobServiceImpl(EventService eventService, Recorder recorder, ReadPersistenceService readPersistenceService)
-
-
Method Details
-
createJobDescriptor
public SJobDescriptor createJobDescriptor(SJobDescriptor sJobDescriptor) throws SJobDescriptorCreationException Description copied from interface:JobServiceCreate a new job descriptor- Specified by:
createJobDescriptorin interfaceJobService- Parameters:
sJobDescriptor- JobDescriptor to create- Returns:
- The created jobDescriptor
- Throws:
SJobDescriptorCreationException
-
deleteJobDescriptor
public void deleteJobDescriptor(long id) throws SJobDescriptorReadException, SJobDescriptorDeletionException Description copied from interface:JobServiceDelete the specified job descriptor- Specified by:
deleteJobDescriptorin interfaceJobService- Parameters:
id- Identifier of job descriptor to delete- Throws:
SJobDescriptorReadExceptionSJobDescriptorDeletionException
-
deleteJobDescriptor
public void deleteJobDescriptor(SJobDescriptor sJobDescriptor) throws SJobDescriptorDeletionException Description copied from interface:JobServiceDelete the specified job descriptor- Specified by:
deleteJobDescriptorin interfaceJobService- Parameters:
sJobDescriptor- JobDescriptor to delete- Throws:
SJobDescriptorDeletionException
-
getJobDescriptor
Description copied from interface:JobServiceGet a specific job descriptor- Specified by:
getJobDescriptorin interfaceJobService- Parameters:
id- Identifier of job descriptor- Returns:
- Null if the job descriptor doesn't exist, else the
SJobDescriptorcorresponding to the identifier - Throws:
SJobDescriptorReadException
-
getNumberOfJobDescriptors
Description copied from interface:JobServiceGet total number of job descriptors- Specified by:
getNumberOfJobDescriptorsin interfaceJobService- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- total number of job logs
- Throws:
SBonitaReadException
-
searchJobDescriptors
public List<SJobDescriptor> searchJobDescriptors(QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:JobServiceSearch all job descriptors according to specific criteria- Specified by:
searchJobDescriptorsin interfaceJobService- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- A list of SJobParameter objects
- Throws:
SBonitaReadException
-
createJobParameters
public List<SJobParameter> createJobParameters(List<SJobParameter> sJobParameters, long jobDescriptorId) throws SJobParameterCreationException Description copied from interface:JobServiceCreate new job parameters- Specified by:
createJobParametersin interfaceJobService- Parameters:
sJobParameters- JobParameters to createjobDescriptorId- Identifier of job descriptor- Returns:
- Throws:
SJobParameterCreationException
-
setJobParameters
public List<SJobParameter> setJobParameters(long jobDescriptorId, List<SJobParameter> parameters) throws SJobParameterCreationException Description copied from interface:JobServiceDelete jobs parameters corresponding to the job descriptor, if exist. After, create new job parameters- Specified by:
setJobParametersin interfaceJobService- Returns:
- A list of new SJobParameter objects
- Throws:
SJobParameterCreationException
-
deleteAllJobParameters
- Throws:
SJobParameterCreationException
-
createJobParameter
public SJobParameter createJobParameter(SJobParameter sJobParameter, long jobDescriptorId) throws SJobParameterCreationException Description copied from interface:JobServiceCreate a new job parameter- Specified by:
createJobParameterin interfaceJobService- Parameters:
sJobParameter- JobParameter to createjobDescriptorId- Identifier of job descriptor- Returns:
- Throws:
SJobParameterCreationException
-
deleteJobParameter
public void deleteJobParameter(long id) throws SJobParameterNotFoundException, SJobParameterReadException, SJobParameterDeletionException Description copied from interface:JobServiceDelete the specified job parameter- Specified by:
deleteJobParameterin interfaceJobService- Parameters:
id- Identifier of job parameter to delete- Throws:
SJobParameterNotFoundExceptionSJobParameterReadExceptionSJobParameterDeletionException
-
deleteJobParameter
Description copied from interface:JobServiceDelete the specified job parameter- Specified by:
deleteJobParameterin interfaceJobService- Parameters:
sJobParameter- JobParameter to delete- Throws:
SJobParameterDeletionException
-
getJobParameter
public SJobParameter getJobParameter(long id) throws SJobParameterNotFoundException, SJobParameterReadException Description copied from interface:JobServiceGet a specific job parameter- Specified by:
getJobParameterin interfaceJobService- Parameters:
id- Identifier of job parameter- Returns:
- Throws:
SJobParameterNotFoundExceptionSJobParameterReadException
-
getJobParameters
Description copied from interface:JobServiceget parameters of a job- Specified by:
getJobParametersin interfaceJobService- Throws:
SBonitaReadException
-
createJobLog
Description copied from interface:JobServiceCreate a new job log- Specified by:
createJobLogin interfaceJobService- Parameters:
sJobLog- JobLog to create- Returns:
- Throws:
SJobLogCreationException
-
deleteJobLog
Description copied from interface:JobServiceDelete the specified job log- Specified by:
deleteJobLogin interfaceJobService- Parameters:
id- Identifier of job log to delete- Throws:
SJobLogDeletionExceptionSBonitaReadException
-
deleteJobLog
Description copied from interface:JobServiceDelete the specified job log- Specified by:
deleteJobLogin interfaceJobService- Parameters:
sJobLog- JobLog to delete- Throws:
SJobLogDeletionException
-
deleteJobLogs
public void deleteJobLogs(long jobDescriptorId) throws SJobLogDeletionException, SBonitaReadException Description copied from interface:JobServiceDelete allSJobLogof a specificSJobDescriptor- Specified by:
deleteJobLogsin interfaceJobService- Parameters:
jobDescriptorId- The identifier of theSJobDescriptor- Throws:
SJobLogDeletionExceptionSBonitaReadException
-
getJobLogs
public List<SJobLog> getJobLogs(long jobDescriptorId, int fromIndex, int maxResults) throws SBonitaReadException Description copied from interface:JobServiceGet allSJobLogof a specificSJobDescriptor- Specified by:
getJobLogsin interfaceJobService- 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
-
getJobLog
Description copied from interface:JobServiceGet a specific job log- Specified by:
getJobLogin interfaceJobService- Parameters:
id- Identifier of job log- Returns:
- Throws:
SBonitaReadException
-
getNumberOfJobLogs
Description copied from interface:JobServiceGet total number of job logs- Specified by:
getNumberOfJobLogsin interfaceJobService- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- total number of job logs
- Throws:
SBonitaReadException
-
searchJobLogs
Description copied from interface:JobServiceSearch all job logs according to specific criteria- Specified by:
searchJobLogsin interfaceJobService- Parameters:
queryOptions- a map of specific parameters of a query- Returns:
- A list of SJobLog objects
- Throws:
SBonitaReadException
-
getFailedJobs
public List<SFailedJob> getFailedJobs(int startIndex, int maxResults) throws SFailedJobReadException Description copied from interface:JobServiceGet list of failed jobs- Specified by:
getFailedJobsin interfaceJobService- Returns:
- A list of SFailedJob objects
- Throws:
SFailedJobReadException
-
deleteJobDescriptorByJobName
Description copied from interface:JobServiceDelete a job descriptor corresponding to the given job name- Specified by:
deleteJobDescriptorByJobNamein interfaceJobService- Parameters:
jobName- name of job we want the jobDsecriptor to be deleted- Throws:
SJobDescriptorDeletionException
-
deleteAllJobDescriptors
Description copied from interface:JobServiceDelete all job descriptors- Specified by:
deleteAllJobDescriptorsin interfaceJobService- Throws:
SJobDescriptorDeletionException
-
updateJobLog
public void updateJobLog(SJobLog jobLog, EntityUpdateDescriptor descriptor) throws SJobLogUpdatingException Description copied from interface:JobServiceUpdate aSJobLog- Specified by:
updateJobLogin interfaceJobService- Parameters:
jobLog- The log to update- Throws:
SJobLogUpdatingException
-
logJobError
public void logJobError(Throwable jobException, Long jobDescriptorId) throws SBonitaReadException, SJobLogUpdatingException, SJobLogCreationException, SJobDescriptorReadException Description copied from interface:JobServicelog an error on a job- Specified by:
logJobErrorin interfaceJobService- Parameters:
jobException- the exceptionjobDescriptorId- the id of the job- Throws:
SBonitaReadExceptionSJobLogUpdatingExceptionSJobLogCreationExceptionSJobDescriptorReadException
-
createJobLog
public void createJobLog(Throwable jobException, Long jobDescriptorId) throws SJobLogCreationException, SJobDescriptorReadException
-