Package org.bonitasoft.engine.scheduler
Interface JobService
-
- All Known Implementing Classes:
JobServiceImpl
public interface JobService- Since:
- 6.1
- Author:
- Celine Souchet
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJOB_DESCRIPTORstatic java.lang.StringJOB_LOGstatic java.lang.StringJOB_PARAMETER
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SJobDescriptorcreateJobDescriptor(SJobDescriptor sJobDescriptor, long tenantId)Create a new job descriptor for a specific tenantSJobLogcreateJobLog(SJobLog sJobLog)Create a new job log for a specific tenantSJobParametercreateJobParameter(SJobParameter sJobParameter, long tenantId, long jobDescriptorId)Create a new job parameter for a specific tenantjava.util.List<SJobParameter>createJobParameters(java.util.List<SJobParameter> parameters, long tenantId, long jobDescriptorId)Create new job parameters for a specific tenantvoiddeleteAllJobDescriptors()Delete all job descriptors for a specific tenantvoiddeleteJobDescriptor(long id)Delete the specified job descriptorvoiddeleteJobDescriptor(SJobDescriptor sJobDescriptor)Delete the specified job descriptorvoiddeleteJobDescriptorByJobName(java.lang.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 parameterjava.util.List<SFailedJob>getFailedJobs(int startIndex, int maxResults)Get list of failed jobsSJobDescriptorgetJobDescriptor(long id)Get a specific job descriptorSJobLoggetJobLog(long id)Get a specific job logjava.util.List<SJobLog>getJobLogs(long jobDescriptorId, int fromIndex, int maxResults)Get allSJobLogof a specificSJobDescriptorSJobParametergetJobParameter(long id)Get a specific job parameterjava.util.List<SJobParameter>getJobParameters(java.lang.Long jobDescriptorId)get parameters of a joblonggetNumberOfJobDescriptors(QueryOptions queryOptions)Get total number of job descriptorslonggetNumberOfJobLogs(QueryOptions queryOptions)Get total number of job logsvoidlogJobError(java.lang.Throwable jobException, java.lang.Long jobDescriptorId)log an error on a jobjava.util.List<SJobDescriptor>searchJobDescriptors(QueryOptions queryOptions)Search all job descriptors according to specific criteriajava.util.List<SJobLog>searchJobLogs(QueryOptions queryOptions)Search all job logs according to specific criteriajava.util.List<SJobParameter>setJobParameters(long tenantId, long jobDescriptorId, java.util.List<SJobParameter> parameters)Delete jobs parameters corresponding to tenant and job descriptor, if exist.voidupdateJobLog(SJobLog jobLog, EntityUpdateDescriptor descriptor)Update aSJobLog
-
-
-
Field Detail
-
JOB_DESCRIPTOR
static final java.lang.String JOB_DESCRIPTOR
- See Also:
- Constant Field Values
-
JOB_PARAMETER
static final java.lang.String JOB_PARAMETER
- See Also:
- Constant Field Values
-
JOB_LOG
static final java.lang.String JOB_LOG
- See Also:
- Constant Field Values
-
-
Method Detail
-
createJobDescriptor
SJobDescriptor createJobDescriptor(SJobDescriptor sJobDescriptor, long tenantId) throws SJobDescriptorCreationException
Create a new job descriptor for a specific tenant- Parameters:
sJobDescriptor- JobDescriptor to createtenantId- Identifier of tenant- Returns:
- The created jobDescriptor
- Throws:
SJobDescriptorCreationException- Since:
- 6.1
-
deleteJobDescriptor
void deleteJobDescriptor(long id) throws SJobDescriptorNotFoundException, SJobDescriptorReadException, SJobDescriptorDeletionExceptionDelete the specified job descriptor- Parameters:
id- Identifier of job descriptor to delete- Throws:
SJobDescriptorReadExceptionSJobDescriptorNotFoundExceptionSJobDescriptorDeletionException- Since:
- 6.1
-
deleteJobDescriptor
void deleteJobDescriptor(SJobDescriptor sJobDescriptor) throws SJobDescriptorDeletionException
Delete the specified job descriptor- Parameters:
sJobDescriptor- JobDescriptor to delete- Throws:
SJobDescriptorDeletionException- Since:
- 6.1
-
deleteAllJobDescriptors
void deleteAllJobDescriptors() throws SJobDescriptorDeletionExceptionDelete all job descriptors for a specific tenant- Throws:
SJobDescriptorDeletionException- Since:
- 6.4
-
deleteJobDescriptorByJobName
void deleteJobDescriptorByJobName(java.lang.String jobName) throws SJobDescriptorDeletionExceptionDelete 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
SJobDescriptor getJobDescriptor(long id) throws SJobDescriptorReadException
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
long getNumberOfJobDescriptors(QueryOptions queryOptions) throws SBonitaReadException
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
java.util.List<SJobDescriptor> searchJobDescriptors(QueryOptions queryOptions) throws SBonitaReadException
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
java.util.List<SJobParameter> createJobParameters(java.util.List<SJobParameter> parameters, long tenantId, long jobDescriptorId) throws SJobParameterCreationException
Create new job parameters for a specific tenant- Parameters:
parameters- JobParameters to createtenantId- Identifier of tenantjobDescriptorId- Identifier of job descriptor- Returns:
- Throws:
SJobParameterCreationException- Since:
- 6.2
-
setJobParameters
java.util.List<SJobParameter> setJobParameters(long tenantId, long jobDescriptorId, java.util.List<SJobParameter> parameters) throws SJobParameterCreationException
Delete jobs parameters corresponding to tenant and job descriptor, if exist. After, create new job parameters for a specific tenant- Parameters:
tenantId-jobDescriptorId-parameters-- Returns:
- A list of new SJobParameter objects
- Throws:
SJobParameterCreationException- Since:
- 6.1
-
createJobParameter
SJobParameter createJobParameter(SJobParameter sJobParameter, long tenantId, long jobDescriptorId) throws SJobParameterCreationException
Create a new job parameter for a specific tenant- Parameters:
sJobParameter- JobParameter to createtenantId- Identifier of tenantjobDescriptorId- Identifier of job descriptor- Returns:
- Throws:
SJobParameterCreationException- Since:
- 6.2
-
deleteJobParameter
void deleteJobParameter(long id) throws SJobParameterNotFoundException, SJobParameterReadException, SJobParameterDeletionExceptionDelete the specified job parameter- Parameters:
id- Identifier of job parameter to delete- Throws:
SJobParameterReadExceptionSJobParameterNotFoundExceptionSJobParameterDeletionException- Since:
- 6.1
-
deleteJobParameter
void deleteJobParameter(SJobParameter sJobParameter) throws SJobParameterDeletionException
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
java.util.List<SJobParameter> getJobParameters(java.lang.Long jobDescriptorId) throws SBonitaReadException
get parameters of a job- Throws:
SBonitaReadException
-
createJobLog
SJobLog createJobLog(SJobLog sJobLog) throws SJobLogCreationException
Create a new job log for a specific tenant- Parameters:
sJobLog- JobLog to create- Returns:
- Throws:
SJobLogCreationException- Since:
- 6.2
-
deleteJobLog
void deleteJobLog(long id) throws SJobLogDeletionException, SBonitaReadExceptionDelete the specified job log- Parameters:
id- Identifier of job log to delete- Throws:
SBonitaReadExceptionSJobLogDeletionException- Since:
- 6.1
-
deleteJobLog
void deleteJobLog(SJobLog sJobLog) throws SJobLogDeletionException
Delete the specified job log- Parameters:
sJobLog- JobLog to delete- Throws:
SJobLogDeletionException- Since:
- 6.1
-
getJobLog
SJobLog getJobLog(long id) throws SBonitaReadException
Get a specific job log- Parameters:
id- Identifier of job log- Returns:
- Throws:
SBonitaReadException- Since:
- 6.1
-
getNumberOfJobLogs
long getNumberOfJobLogs(QueryOptions queryOptions) throws SBonitaReadException
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
java.util.List<SJobLog> searchJobLogs(QueryOptions queryOptions) throws SBonitaReadException
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
java.util.List<SFailedJob> getFailedJobs(int startIndex, int maxResults) throws SFailedJobReadException
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
void deleteJobLogs(long jobDescriptorId) throws SJobLogDeletionException, SBonitaReadExceptionDelete allSJobLogof a specificSJobDescriptor- Parameters:
jobDescriptorId- The identifier of theSJobDescriptor- Throws:
SBonitaReadExceptionSJobLogDeletionException- Since:
- 6.4.0
-
getJobLogs
java.util.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(java.lang.Throwable jobException, java.lang.Long jobDescriptorId) throws SBonitaReadException, SJobLogUpdatingException, SJobLogCreationException, SJobDescriptorReadExceptionlog an error on a job- Parameters:
jobException- the exceptionjobDescriptorId- the id of the job- Throws:
SBonitaReadExceptionSJobLogUpdatingExceptionSJobLogCreationExceptionSJobDescriptorReadException- Since:
- 7.2.0
-
-