Package fr.becpg.repo.batch
Class BatchQueueServiceImpl
java.lang.Object
fr.becpg.repo.batch.BatchQueueServiceImpl
- All Implemented Interfaces:
BatchQueueService,EventListener,org.springframework.context.ApplicationListener<org.alfresco.repo.batch.BatchMonitorEvent>
@Service("batchQueueService")
public class BatchQueueServiceImpl
extends Object
implements BatchQueueService, org.springframework.context.ApplicationListener<org.alfresco.repo.batch.BatchMonitorEvent>
BatchQueueServiceImpl class.
- Version:
- $Id: $Id
- Author:
- matthieu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.springframework.context.ApplicationEventPublisherprivate ReentrantLockprivate BeCPGAuditServiceprivate BeCPGCacheServiceprivate BeCPGMailServiceprivate static final Stringprivate org.alfresco.repo.batch.BatchMonitorprivate static final org.apache.commons.logging.Logprivate org.alfresco.service.cmr.repository.NodeServiceprivate Deque<BatchQueueServiceImpl.BatchCommand<?>>private static final Stringprivate List<BatchQueueServiceImpl.BatchCommand<?>>private static final Stringprivate static final Stringprivate org.alfresco.repo.tenant.TenantAdminServiceprivate Map<String,ThreadPoolExecutor> private org.alfresco.service.transaction.TransactionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.json.JSONObjectbuildJsonBatchInfo(BatchInfo batchInfo) booleancancelBatch(String batchId) cancelBatch.BatchStep<org.alfresco.service.cmr.repository.NodeRef>createBatchStepWithErrorHandling(BatchInfo batchInfo, List<org.alfresco.service.cmr.repository.NodeRef> list, org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker<org.alfresco.service.cmr.repository.NodeRef> processor) private BatchQueueServiceImpl.BatchCommand<?>findCommandInQueue(String batchId) getBatchesInQueue.org.alfresco.repo.batch.BatchMonitorgetLastRunningBatch.getRunningBatchInfo.private BatchQueueServiceImpl.BatchCommand<?>booleanisBatchInQueue(BatchInfo batchInfo) isBatchInQueue.voidonApplicationEvent(org.alfresco.repo.batch.BatchMonitorEvent event) private voidprocessBatchErrors(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, Map<String, Set<org.alfresco.service.cmr.repository.NodeRef>> batchNodesMap) <T> BooleanqueueBatch(BatchInfo batchInfo, List<BatchStep<T>> batchSteps) queueBatch.<T> BooleanqueueBatch(BatchInfo batchInfo, List<BatchStep<T>> batchSteps, BatchClosingHook closingHook) queueBatch.<T> BooleanqueueBatch(BatchInfo batchInfo, org.alfresco.repo.batch.BatchProcessWorkProvider<T> workProvider, org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker<T> processWorker, BatchErrorCallback errorCallback) queueBatch.private BatchInforemoveBatchErrors(String batchId, List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs) booleanremoveBatchFromQueue(String batchId) removeBatchFromQueue.retryBatchInError(String batchId) viewErrors(String batchId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger -
transactionService
@Autowired private org.alfresco.service.transaction.TransactionService transactionService -
applicationEventPublisher
@Autowired private org.springframework.context.ApplicationEventPublisher applicationEventPublisher -
beCPGMailService
-
threadExecutorMap
@Autowired @Qualifier("batchThreadPoolExecutorMap") private Map<String,ThreadPoolExecutor> threadExecutorMap -
tenantAdminService
@Autowired private org.alfresco.repo.tenant.TenantAdminService tenantAdminService -
beCPGAuditService
-
beCPGCacheService
-
nodeService
@Autowired private org.alfresco.service.cmr.repository.NodeService nodeService -
lastRunningBatch
private org.alfresco.repo.batch.BatchMonitor lastRunningBatch -
runningCommands
-
cancelledBatches
-
pausedCommands
-
batchQueueLock
-
CANCELLED
- See Also:
-
PERCENT_COMPLETED
- See Also:
-
STEPS_MAX
- See Also:
-
STEP_COUNT
- See Also:
-
-
Constructor Details
-
BatchQueueServiceImpl
public BatchQueueServiceImpl()
-
-
Method Details
-
queueBatch
public <T> Boolean queueBatch(@NonNull BatchInfo batchInfo, @NonNull org.alfresco.repo.batch.BatchProcessWorkProvider<T> workProvider, @NonNull org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker<T> processWorker, @Nullable BatchErrorCallback errorCallback) queueBatch.
- Specified by:
queueBatchin interfaceBatchQueueService- Type Parameters:
T- a T class- Parameters:
batchInfo- aBatchInfoobjectworkProvider- aBatchProcessWorkProviderobjectprocessWorker- aBatchProcessor.BatchProcessWorkerobjecterrorCallback- aBatchErrorCallbackobject- Returns:
- a
Booleanobject
-
queueBatch
queueBatch.
- Specified by:
queueBatchin interfaceBatchQueueService- Type Parameters:
T- a T class- Parameters:
batchInfo- aBatchInfoobjectbatchSteps- aListobject- Returns:
- a
Booleanobject
-
queueBatch
public <T> Boolean queueBatch(@NonNull BatchInfo batchInfo, @NonNull List<BatchStep<T>> batchSteps, BatchClosingHook closingHook) queueBatch.
- Specified by:
queueBatchin interfaceBatchQueueService- Type Parameters:
T- a T class- Parameters:
batchInfo- aBatchInfoobjectbatchSteps- aListobjectclosingHook- aBatchClosingHookobject- Returns:
- a
Booleanobject
-
isBatchInQueue
isBatchInQueue.
- Specified by:
isBatchInQueuein interfaceBatchQueueService- Parameters:
batchInfo- aBatchInfoobject- Returns:
- a boolean
-
getRunningBatchInfo
getRunningBatchInfo.
- Specified by:
getRunningBatchInfoin interfaceBatchQueueService- Returns:
- a
Stringobject
-
buildJsonBatchInfo
- Throws:
org.json.JSONException
-
getLastRunningBatch
public org.alfresco.repo.batch.BatchMonitor getLastRunningBatch()getLastRunningBatch.
- Specified by:
getLastRunningBatchin interfaceBatchQueueService- Returns:
- a
BatchMonitorobject
-
getRunningCommand
-
getBatchesInQueue
getBatchesInQueue.
- Specified by:
getBatchesInQueuein interfaceBatchQueueService- Returns:
- a
Listobject
-
removeBatchFromQueue
removeBatchFromQueue.
- Specified by:
removeBatchFromQueuein interfaceBatchQueueService- Parameters:
batchId- aStringobject- Returns:
- a boolean
-
findCommandInQueue
-
cancelBatch
cancelBatch.
- Specified by:
cancelBatchin interfaceBatchQueueService- Parameters:
batchId- aStringobject- Returns:
- a boolean
-
getBatchesInError
- Specified by:
getBatchesInErrorin interfaceBatchQueueService
-
getBatchErrorsMap
-
processBatchErrors
-
retryBatchInError
- Specified by:
retryBatchInErrorin interfaceBatchQueueService
-
removeBatchErrors
-
createBatchStepWithErrorHandling
public BatchStep<org.alfresco.service.cmr.repository.NodeRef> createBatchStepWithErrorHandling(BatchInfo batchInfo, List<org.alfresco.service.cmr.repository.NodeRef> list, org.alfresco.repo.batch.BatchProcessor.BatchProcessWorker<org.alfresco.service.cmr.repository.NodeRef> processor) - Specified by:
createBatchStepWithErrorHandlingin interfaceBatchQueueService
-
viewErrors
- Specified by:
viewErrorsin interfaceBatchQueueService
-
onApplicationEvent
public void onApplicationEvent(org.alfresco.repo.batch.BatchMonitorEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.alfresco.repo.batch.BatchMonitorEvent>
-