public class JobServiceImpl extends java.lang.Object implements JobService
JOB_DESCRIPTOR, JOB_LOG, JOB_PARAMETER| Constructor and Description |
|---|
JobServiceImpl(EventService eventService,
Recorder recorder,
ReadPersistenceService readPersistenceService,
TechnicalLoggerService logger) |
| Modifier and Type | Method and Description |
|---|---|
SJobDescriptor |
createJobDescriptor(SJobDescriptor sJobDescriptor,
long tenantId)
Create a new job descriptor for a specific tenant
|
SJobLog |
createJobLog(SJobLog sJobLog)
Create a new job log for a specific tenant
|
void |
createJobLog(java.lang.Throwable jobException,
java.lang.Long jobDescriptorId) |
SJobParameter |
createJobParameter(SJobParameter sJobParameter,
long tenantId,
long jobDescriptorId)
Create a new job parameter for a specific tenant
|
java.util.List<SJobParameter> |
createJobParameters(java.util.List<SJobParameter> sJobParameters,
long tenantId,
long jobDescriptorId)
Create new job parameters for a specific tenant
|
void |
deleteAllJobDescriptors()
Delete all job descriptors for a specific tenant
|
protected void |
deleteAllJobParameters(long jobDescriptorId) |
void |
deleteJobDescriptor(long id)
Delete the specified job descriptor
|
void |
deleteJobDescriptor(SJobDescriptor sJobDescriptor)
Delete the specified job descriptor
|
void |
deleteJobDescriptorByJobName(java.lang.String jobName)
Delete a job descriptor corresponding to the given job name
|
void |
deleteJobLog(long id)
Delete the specified job log
|
void |
deleteJobLog(SJobLog sJobLog)
Delete the specified job log
|
void |
deleteJobLogs(long jobDescriptorId)
Delete all
SJobLog of a specific SJobDescriptor |
void |
deleteJobParameter(long id)
Delete the specified job parameter
|
void |
deleteJobParameter(SJobParameter sJobParameter)
Delete the specified job parameter
|
java.util.List<SFailedJob> |
getFailedJobs(int startIndex,
int maxResults)
Get list of failed jobs
|
SJobDescriptor |
getJobDescriptor(long id)
Get a specific job descriptor
|
SJobLog |
getJobLog(long id)
Get a specific job log
|
java.util.List<SJobLog> |
getJobLogs(long jobDescriptorId,
int fromIndex,
int maxResults)
Get all
SJobLog of a specific SJobDescriptor |
SJobParameter |
getJobParameter(long id)
Get a specific job parameter
|
java.util.List<SJobParameter> |
getJobParameters(java.lang.Long jobDescriptorId)
get parameters of a job
|
long |
getNumberOfJobDescriptors(QueryOptions queryOptions)
Get total number of job descriptors
|
long |
getNumberOfJobLogs(QueryOptions queryOptions)
Get total number of job logs
|
void |
logJobError(java.lang.Throwable jobException,
java.lang.Long jobDescriptorId)
log an error on a job
|
java.util.List<SJobDescriptor> |
searchJobDescriptors(QueryOptions queryOptions)
Search all job descriptors according to specific criteria
|
java.util.List<SJobLog> |
searchJobLogs(QueryOptions queryOptions)
Search all job logs according to specific criteria
|
java.util.List<SJobParameter> |
setJobParameters(long tenantId,
long jobDescriptorId,
java.util.List<SJobParameter> parameters)
Delete jobs parameters corresponding to tenant and job descriptor, if exist.
|
void |
updateJobLog(SJobLog jobLog,
EntityUpdateDescriptor descriptor)
Update a
SJobLog |
public JobServiceImpl(EventService eventService, Recorder recorder, ReadPersistenceService readPersistenceService, TechnicalLoggerService logger)
public SJobDescriptor createJobDescriptor(SJobDescriptor sJobDescriptor, long tenantId) throws SJobDescriptorCreationException
JobServicecreateJobDescriptor in interface JobServicesJobDescriptor - JobDescriptor to createtenantId - Identifier of tenantSJobDescriptorCreationExceptionpublic void deleteJobDescriptor(long id)
throws SJobDescriptorReadException,
SJobDescriptorDeletionException
JobServicedeleteJobDescriptor in interface JobServiceid - Identifier of job descriptor to deleteSJobDescriptorReadExceptionSJobDescriptorDeletionExceptionpublic void deleteJobDescriptor(SJobDescriptor sJobDescriptor) throws SJobDescriptorDeletionException
JobServicedeleteJobDescriptor in interface JobServicesJobDescriptor - JobDescriptor to deleteSJobDescriptorDeletionExceptionpublic SJobDescriptor getJobDescriptor(long id) throws SJobDescriptorReadException
JobServicegetJobDescriptor in interface JobServiceid - Identifier of job descriptorSJobDescriptor corresponding to the identifierSJobDescriptorReadExceptionpublic long getNumberOfJobDescriptors(QueryOptions queryOptions) throws SBonitaReadException
JobServicegetNumberOfJobDescriptors in interface JobServicequeryOptions - a map of specific parameters of a querySBonitaReadExceptionpublic java.util.List<SJobDescriptor> searchJobDescriptors(QueryOptions queryOptions) throws SBonitaReadException
JobServicesearchJobDescriptors in interface JobServicequeryOptions - a map of specific parameters of a querySBonitaReadExceptionpublic java.util.List<SJobParameter> createJobParameters(java.util.List<SJobParameter> sJobParameters, long tenantId, long jobDescriptorId) throws SJobParameterCreationException
JobServicecreateJobParameters in interface JobServicesJobParameters - JobParameters to createtenantId - Identifier of tenantjobDescriptorId - Identifier of job descriptorSJobParameterCreationExceptionpublic java.util.List<SJobParameter> setJobParameters(long tenantId, long jobDescriptorId, java.util.List<SJobParameter> parameters) throws SJobParameterCreationException
JobServicesetJobParameters in interface JobServiceSJobParameterCreationExceptionprotected void deleteAllJobParameters(long jobDescriptorId)
throws SJobParameterCreationException
SJobParameterCreationExceptionpublic SJobParameter createJobParameter(SJobParameter sJobParameter, long tenantId, long jobDescriptorId) throws SJobParameterCreationException
JobServicecreateJobParameter in interface JobServicesJobParameter - JobParameter to createtenantId - Identifier of tenantjobDescriptorId - Identifier of job descriptorSJobParameterCreationExceptionpublic void deleteJobParameter(long id)
throws SJobParameterNotFoundException,
SJobParameterReadException,
SJobParameterDeletionException
JobServicedeleteJobParameter in interface JobServiceid - Identifier of job parameter to deleteSJobParameterNotFoundExceptionSJobParameterReadExceptionSJobParameterDeletionExceptionpublic void deleteJobParameter(SJobParameter sJobParameter) throws SJobParameterDeletionException
JobServicedeleteJobParameter in interface JobServicesJobParameter - JobParameter to deleteSJobParameterDeletionExceptionpublic SJobParameter getJobParameter(long id) throws SJobParameterNotFoundException, SJobParameterReadException
JobServicegetJobParameter in interface JobServiceid - Identifier of job parameterSJobParameterNotFoundExceptionSJobParameterReadExceptionpublic java.util.List<SJobParameter> getJobParameters(java.lang.Long jobDescriptorId) throws SBonitaReadException
JobServicegetJobParameters in interface JobServiceSBonitaReadExceptionpublic SJobLog createJobLog(SJobLog sJobLog) throws SJobLogCreationException
JobServicecreateJobLog in interface JobServicesJobLog - JobLog to createSJobLogCreationExceptionpublic void deleteJobLog(long id)
throws SJobLogDeletionException,
SBonitaReadException
JobServicedeleteJobLog in interface JobServiceid - Identifier of job log to deleteSJobLogDeletionExceptionSBonitaReadExceptionpublic void deleteJobLog(SJobLog sJobLog) throws SJobLogDeletionException
JobServicedeleteJobLog in interface JobServicesJobLog - JobLog to deleteSJobLogDeletionExceptionpublic void deleteJobLogs(long jobDescriptorId)
throws SJobLogDeletionException,
SBonitaReadException
JobServiceSJobLog of a specific SJobDescriptordeleteJobLogs in interface JobServicejobDescriptorId - The identifier of the SJobDescriptorSJobLogDeletionExceptionSBonitaReadExceptionpublic java.util.List<SJobLog> getJobLogs(long jobDescriptorId, int fromIndex, int maxResults) throws SBonitaReadException
JobServiceSJobLog of a specific SJobDescriptorgetJobLogs in interface JobServicejobDescriptorId - The identifier of the SJobDescriptorfromIndex - The index of the first element of the listmaxResults - The nulber max of elements of the listSJobLogSBonitaReadExceptionpublic SJobLog getJobLog(long id) throws SBonitaReadException
JobServicegetJobLog in interface JobServiceid - Identifier of job logSBonitaReadExceptionpublic long getNumberOfJobLogs(QueryOptions queryOptions) throws SBonitaReadException
JobServicegetNumberOfJobLogs in interface JobServicequeryOptions - a map of specific parameters of a querySBonitaReadExceptionpublic java.util.List<SJobLog> searchJobLogs(QueryOptions queryOptions) throws SBonitaReadException
JobServicesearchJobLogs in interface JobServicequeryOptions - a map of specific parameters of a querySBonitaReadExceptionpublic java.util.List<SFailedJob> getFailedJobs(int startIndex, int maxResults) throws SFailedJobReadException
JobServicegetFailedJobs in interface JobServiceSFailedJobReadExceptionpublic void deleteJobDescriptorByJobName(java.lang.String jobName)
throws SJobDescriptorDeletionException
JobServicedeleteJobDescriptorByJobName in interface JobServicejobName - name of job we want the jobDsecriptor to be deletedSJobDescriptorDeletionExceptionpublic void deleteAllJobDescriptors()
throws SJobDescriptorDeletionException
JobServicedeleteAllJobDescriptors in interface JobServiceSJobDescriptorDeletionExceptionpublic void updateJobLog(SJobLog jobLog, EntityUpdateDescriptor descriptor) throws SJobLogUpdatingException
JobServiceSJobLogupdateJobLog in interface JobServicejobLog - The log to updateSJobLogUpdatingExceptionpublic void logJobError(java.lang.Throwable jobException,
java.lang.Long jobDescriptorId)
throws SBonitaReadException,
SJobLogUpdatingException,
SJobLogCreationException,
SJobDescriptorReadException
JobServicelogJobError in interface JobServicejobException - the exceptionjobDescriptorId - the id of the jobSBonitaReadExceptionSJobLogUpdatingExceptionSJobLogCreationExceptionSJobDescriptorReadExceptionpublic void createJobLog(java.lang.Throwable jobException,
java.lang.Long jobDescriptorId)
throws SJobLogCreationException,
SJobDescriptorReadException