public interface CronJobService
| Modifier and Type | Method and Description |
|---|---|
CronJobModel |
getCronJob(java.lang.String code)
Gets the cronjob identified unique by given code.
|
<C extends CronJobModel,J extends JobModel> |
getCronJobFactory(ServicelayerJobModel slayerJobModel)
Returns
CronJobFactory bean instance for a ServicelayerJobModel see
org.springframework.context.ApplicationContext#getBean(String) . |
JobModel |
getJob(java.lang.String code)
Gets the job identified unique by given code.
|
java.lang.String |
getLogsAsText(CronJobModel cronjob)
Returns text representation of top 500
CronJobModel.getLogs() entries for a given CronJobModel, as
concatenated and decorated content of its JobLogModel.getMessage(). |
java.lang.String |
getLogsAsText(CronJobModel cronjob,
int count)
Returns text representation of top given
count CronJobModel.getLogs() entries for a given
CronJobModel, as concatenated and decorated content of its JobLogModel.getMessage(). |
JobPerformable<? extends CronJobModel> |
getPerformable(ServicelayerJobModel slayerJobModel)
Returns
JobPerformable bean instance for a ServicelayerJobModel see
org.springframework.context.ApplicationContext#getBean(String) . |
java.util.List<CronJobModel> |
getRunningOrRestartedCronJobs()
Returns list of
CronJobModel instances running on the platform regardless the cluster node. |
boolean |
isAbortable(CronJobModel cronJob)
Checks if the cronjob model is abortable.
|
boolean |
isError(CronJobModel cronJob)
Checks whether the cronjob was executed not successfully.
|
boolean |
isFinished(CronJobModel cronJob)
Checks whether the cronjob has finished execution and is not running or paused anymore.
|
boolean |
isPaused(CronJobModel cronJob)
Checks whether the cronjob is paused.
|
boolean |
isPerformable(CronJobModel cronJob)
Checks if the cronjob model is performable.
|
boolean |
isRunning(CronJobModel cronJob)
Checks whether the cronjob has not finished or paused execution yet and is still running regardless if has it been
restarted or not.
|
boolean |
isSuccessful(CronJobModel cronJob)
Checks whether the cronjob was executed successfully.
|
void |
performCronJob(CronJobModel model)
Performs given
Cronjob by starting its Job on the cluster node. |
void |
performCronJob(CronJobModel model,
boolean synchronous)
Performs given
Cronjob by starting its Job. |
void |
requestAbortCronJob(CronJobModel model)
This method applies only to CronJobModel instance with status as
CronJobStatus.RUNNING OR
CronJobStatus.RUNNINGRESTART Sets the request abort attribute CronJobModel.REQUESTABORTto true for
a given Cronjob. |
void performCronJob(CronJobModel model, boolean synchronous)
Cronjob by starting its Job. If synchronous is true, the
Job will be performed synchronous, which means that this method will return the control to its caller
as recently as this Job is performed. Synchronous execution is especially useful for short Jobs or
testing purpose (JUnit tests for example). If synchronous is false, the Job will be
performed asynchronous by executing the Job in a separate Thread. This method ignores a
nodeId CronJobModel.getNodeID() and does not start a Job on the cluster node.model - which will be usedsynchronous - true if the Job should be performed synchronously, false if the
Job should be performed asynchronouslyvoid performCronJob(CronJobModel model)
Cronjob by starting its Job on the cluster node. The node is given by
JobModel.getNodeID(), the Job will be performed asynchronous, which means that this method
will return the control to its caller as recently as this Job is performed. Call for a
CronJobModel with nodeId CronJobModel.getNodeID() equal to current nodeId
ClusterService.getClusterId() is the same as call
performCronJob(CronJobModel, boolean) with synchronous equal falsemodel - which will be usedvoid requestAbortCronJob(CronJobModel model)
CronJobStatus.RUNNING OR
CronJobStatus.RUNNINGRESTART Sets the request abort attribute CronJobModel.REQUESTABORTto true for
a given Cronjob. The logic in CronJob itself has to finish and set result from cronjob execution
CronJobModel.getStatus() as different than CronJobStatus.RUNNING AND
CronJobStatus.RUNNINGRESTART. Method throws IllegalStateException if the given CronJob is not performable.model - which will be usedCronJobModel getCronJob(java.lang.String code)
code - code for which a cronjob is neededUnknownIdentifierException - in case no cronjob is foundAmbiguousIdentifierException - in case more than one cronjob is foundJobModel getJob(java.lang.String code)
code - code for which a job is neededUnknownIdentifierException - in case no job is foundAmbiguousIdentifierException - in case more than one job is foundboolean isSuccessful(CronJobModel cronJob)
isFinished(CronJobModel) returns true).cronJob - cronjob to check forjava.lang.IllegalStateException - in case cronjob is still runningboolean isError(CronJobModel cronJob)
isFinished(CronJobModel) returns true).cronJob - cronjob to check forjava.lang.IllegalStateException - in case cronjob is still runningboolean isPaused(CronJobModel cronJob)
cronJob - cronjob to check forboolean isRunning(CronJobModel cronJob)
cronJob - cronjob to check forboolean isFinished(CronJobModel cronJob)
cronJob - cronjob to check forjava.util.List<CronJobModel> getRunningOrRestartedCronJobs()
CronJobModel instances running on the platform regardless the cluster node.boolean isPerformable(CronJobModel cronJob)
cronJob - which will be usedboolean isAbortable(CronJobModel cronJob)
cronJob - which will be usedJobPerformable<? extends CronJobModel> getPerformable(ServicelayerJobModel slayerJobModel)
JobPerformable bean instance for a ServicelayerJobModel see
org.springframework.context.ApplicationContext#getBean(String) .<C extends CronJobModel,J extends JobModel> CronJobFactory<C,J> getCronJobFactory(ServicelayerJobModel slayerJobModel)
CronJobFactory bean instance for a ServicelayerJobModel see
org.springframework.context.ApplicationContext#getBean(String) .java.lang.String getLogsAsText(CronJobModel cronjob)
CronJobModel.getLogs() entries for a given CronJobModel, as
concatenated and decorated content of its JobLogModel.getMessage().java.lang.String getLogsAsText(CronJobModel cronjob, int count)
count CronJobModel.getLogs() entries for a given
CronJobModel, as concatenated and decorated content of its JobLogModel.getMessage().Copyright © 2018 SAP SE. All Rights Reserved.