Class BackgroundJobCleaner
java.lang.Object
com.atlassian.confluence.impl.backgroundjob.BackgroundJobCleaner
- All Implemented Interfaces:
BackgroundJobProcessor
Removes non-active background jobs older than 7 days.
- Since:
- 8.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionBackgroundJobCleaner(BackgroundJobDAO backgroundJobDAO, BackgroundJobService backgroundJobService, org.springframework.transaction.PlatformTransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhen it returns true, the background job service will create a record with a job if does not exist.This method does the actual background operations.
-
Constructor Details
-
BackgroundJobCleaner
public BackgroundJobCleaner(BackgroundJobDAO backgroundJobDAO, BackgroundJobService backgroundJobService, org.springframework.transaction.PlatformTransactionManager transactionManager)
-
-
Method Details
-
process
public BackgroundJobResponse process(Long jobId, Map<String, Object> parameters, long recommendedTimeout) Description copied from interface:BackgroundJobProcessorThis method does the actual background operations. Need to stop its execution after recommendedTimeout timeout. This method is not run inside a transaction, the implementation of this class should handle the transactions as required. 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).- Specified by:
processin interfaceBackgroundJobProcessor- Parameters:
jobId- background job idparameters- background job parametersrecommendedTimeout- timeout in milliseconds- Returns:
- response
-
isSingleton
public boolean isSingleton()Description copied from interface:BackgroundJobProcessorWhen 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.- Specified by:
isSingletonin interfaceBackgroundJobProcessor
-