Class ClosedDataspaceRolloverScheduledTask
java.lang.Object
com.orchestranetworks.scheduler.ScheduledTask
com.apgar.common.lib.scheduledtask.ClosedDataspaceRolloverScheduledTask
public class ClosedDataspaceRolloverScheduledTask
extends com.orchestranetworks.scheduler.ScheduledTask
This task deletes closed dataspaces that have been closed n days before.
To utilize this functionality, create a task in the Tasks table of the Task Scheduler under the Administration tab with the following specifications:
- Module: The module that contains this JAR file.
- Class Name: com.apgar.common.lib.scheduledtask.ClosedDataspaceRolloverScheduledTask
- Parameters:
- threshold: Specifies the number of days after which closed data spaces will be deleted.
The execution report will include the type and label of each closed dataspace that is deleted. If no threshold is set, the task will not execute any deletions, and the execution report will generate a warning indicating that a threshold greater than zero is required.
- Author:
- APGAR Consulting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(com.orchestranetworks.scheduler.ScheduledExecutionContext context) Collects all the dataspaces that were closed threshold days before and deletes them.intRetrieves the threshold for closed dataspace deletion.voidsetThreshold(int threshold) Sets the threshold for closed dataspace deletion.Methods inherited from class com.orchestranetworks.scheduler.ScheduledTask
handleBeforeInterrupting, handleBeforePausing, handleBeforeResuming, isInterruptable, isPausable, validate, zza, zza, zza, zzb, zzb, zzc, zzd
-
Constructor Details
-
ClosedDataspaceRolloverScheduledTask
public ClosedDataspaceRolloverScheduledTask()
-
-
Method Details
-
execute
public void execute(com.orchestranetworks.scheduler.ScheduledExecutionContext context) throws com.orchestranetworks.service.OperationException, com.orchestranetworks.scheduler.ScheduledTaskInterruption Collects all the dataspaces that were closed threshold days before and deletes them.- Specified by:
executein classcom.orchestranetworks.scheduler.ScheduledTask- Parameters:
context- context of the scheduled task execution- Throws:
com.orchestranetworks.service.OperationException- if an error occurs during deletioncom.orchestranetworks.scheduler.ScheduledTaskInterruption- if the scheduled task is interrupted
-
getThreshold
public int getThreshold()Retrieves the threshold for closed dataspace deletion.This threshold indicates the number of days; any closed dataspace that has been closed for more than this number of days will be deleted.
- Returns:
- the threshold in days
-
setThreshold
public void setThreshold(int threshold) Sets the threshold for closed dataspace deletion.This threshold specifies the number of days; any closed dataspace that has been closed for more than this number of days will be deleted.
- Parameters:
threshold- the new threshold in days
-