Class CTSWorkerDeleteProcess
- java.lang.Object
-
- org.forgerock.openam.cts.worker.process.CTSWorkerBaseProcess
-
- org.forgerock.openam.cts.worker.process.CTSWorkerDeleteProcess
-
- All Implemented Interfaces:
CTSWorkerProcess
public class CTSWorkerDeleteProcess extends CTSWorkerBaseProcess
A process which defines the deletion of tokens returned from a CTS worker query, having applied the provided filter to them. This process is monitored, and will add reaper run information to the monitoring store as appropriate.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCTSWorkerDeleteProcess.TokenDeletionDeletes batches of Token IDs from the persistence layer.
-
Constructor Summary
Constructors Constructor Description CTSWorkerDeleteProcess(CTSWorkerDeleteProcess.TokenDeletion tokenDeletion, CTSReaperMonitoringStore monitoringStore, Debug debug)Generates a newCTSWorkerDeleteProcesswhich can be used across multipleCTSWorkerTask, with variousCTSWorkerQueryandCTSWorkerFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CountDownLatchhandleBatch(Collection<PartialToken> batch)Hook method allowing subclasses to define the actual work to be carried out by thisCTSWorkerProcess.protected voidhandleFailed(Exception exception)Hook method called whenCTSWorkerBaseProcess.handle(org.forgerock.openam.cts.impl.query.worker.CTSWorkerQuery, org.forgerock.openam.cts.worker.CTSWorkerFilter)fails to complete due to an error.protected voidhandleSucceeded(org.apache.commons.lang3.time.StopWatch queryStopWatch, org.apache.commons.lang3.time.StopWatch waitingStopWatch, long total)Hook method called whenCTSWorkerBaseProcess.handle(org.forgerock.openam.cts.impl.query.worker.CTSWorkerQuery, org.forgerock.openam.cts.worker.CTSWorkerFilter)completes successfully.-
Methods inherited from class org.forgerock.openam.cts.worker.process.CTSWorkerBaseProcess
handle, toString
-
-
-
-
Constructor Detail
-
CTSWorkerDeleteProcess
@Inject public CTSWorkerDeleteProcess(CTSWorkerDeleteProcess.TokenDeletion tokenDeletion, CTSReaperMonitoringStore monitoringStore, @Named("amCoreTokenService") Debug debug)
Generates a newCTSWorkerDeleteProcesswhich can be used across multipleCTSWorkerTask, with variousCTSWorkerQueryandCTSWorkerFilter.- Parameters:
tokenDeletion- Batch deletion of tokens utility.monitoringStore- Utility to record monitoring information.debug- Debug output.
-
-
Method Detail
-
handleBatch
protected CountDownLatch handleBatch(Collection<PartialToken> batch) throws CoreTokenException
Description copied from class:CTSWorkerBaseProcessHook method allowing subclasses to define the actual work to be carried out by thisCTSWorkerProcess.- Specified by:
handleBatchin classCTSWorkerBaseProcess- Parameters:
batch- the filtered page of query results to be processed.- Returns:
- CountDownLatch which will open once the
batchhas been processed. - Throws:
CoreTokenException- if an exception occurs while handling the batch.
-
handleSucceeded
protected void handleSucceeded(org.apache.commons.lang3.time.StopWatch queryStopWatch, org.apache.commons.lang3.time.StopWatch waitingStopWatch, long total)Description copied from class:CTSWorkerBaseProcessHook method called whenCTSWorkerBaseProcess.handle(org.forgerock.openam.cts.impl.query.worker.CTSWorkerQuery, org.forgerock.openam.cts.worker.CTSWorkerFilter)completes successfully.This method can be overridden by subclasses for monitoring or debug logging.
- Specified by:
handleSucceededin classCTSWorkerBaseProcess- Parameters:
queryStopWatch- timing of the query and task spawning step.waitingStopWatch- timing of the task completion wait time.total- number of query results which matched the filter and were processed.
-
handleFailed
protected void handleFailed(Exception exception)
Description copied from class:CTSWorkerBaseProcessHook method called whenCTSWorkerBaseProcess.handle(org.forgerock.openam.cts.impl.query.worker.CTSWorkerQuery, org.forgerock.openam.cts.worker.CTSWorkerFilter)fails to complete due to an error.This method can be overridden by subclasses for debug logging.
- Specified by:
handleFailedin classCTSWorkerBaseProcess- Parameters:
exception- the exception which prevented the call toCTSWorkerBaseProcess.handle(org.forgerock.openam.cts.impl.query.worker.CTSWorkerQuery, org.forgerock.openam.cts.worker.CTSWorkerFilter)from completing successfully.
-
-