Interface BackgroundJobProcessor
-
- All Known Implementing Classes:
BackgroundJobCleaner
,ContentTreePermissionReindexEventBackgroundSender
public interface BackgroundJobProcessor
An interface for any background job.- Since:
- 8.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
isSingleton()
When it returns true, the background job service will create a record with a job if does not exist.BackgroundJobResponse
process(Long jobId, Map<String,Object> parameters, long recommendedTimeout)
This method does the actual background operations.
-
-
-
Method Detail
-
process
BackgroundJobResponse process(Long jobId, Map<String,Object> parameters, long recommendedTimeout)
This method does the actual background operations. Need to stop its execution after recommendedTimeout timeout. This method is run inside a RW transaction. If something goes wrong, the method has to simply throw a runtime exception, it will be properly handled by the scheduler (logged, re-scheduled next run etc).- Parameters:
jobId
- background job idparameters
- background job parametersrecommendedTimeout
- timeout in milliseconds- Returns:
- response
-
isSingleton
default boolean isSingleton()
When it returns true, the background job service will create a record with a job if does not exist. Useful for tasks that have to be run periodically.
-
-