public class FileRetentionThread
extends java.lang.Thread
Constructor and Description |
---|
FileRetentionThread(int retentionDays,
java.lang.String fileRetentionAction,
java.lang.String archiveFolder,
java.lang.String fileExtension,
java.lang.String dcOutputFolder,
LoggerIfc logger)
The constructor used initialize the parameters required for File Retention thread.
|
FileRetentionThread(int retentionDays,
java.lang.String fileRetentionAction,
java.lang.String archiveFolder,
java.lang.String fileExtension,
java.lang.String dcOutputFolder,
LoggerIfc logger,
java.lang.String prefix)
constructor with prefix parameter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doRetentionAction()
This method scans the directory containing the completed files and
deletes/moves them.
|
void |
run() |
void |
shutdown() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public FileRetentionThread(int retentionDays, java.lang.String fileRetentionAction, java.lang.String archiveFolder, java.lang.String fileExtension, java.lang.String dcOutputFolder, LoggerIfc logger, java.lang.String prefix) throws NodeStartException
retentionDays
- number of days the files to retain in the output folderfileRetentionAction
- what to do on the older files after retention daysarchiveFolder
- the folder to which the files will be moved if archive action is selectedfileExtension
- the file extension used filtering completed files.dcOutputFolder
- the folder from which the files need to be moved/deletedlogger
- exception will be logged in this loggerprefix
- the prefix of completed files.NodeStartException
- will be throws if archive folder doesn't exists and not creatable.public FileRetentionThread(int retentionDays, java.lang.String fileRetentionAction, java.lang.String archiveFolder, java.lang.String fileExtension, java.lang.String dcOutputFolder, LoggerIfc logger) throws NodeStartException
retentionDays
- number of days the files to retain in the output folderfileRetentionAction
- what to do on the older files after retention daysarchiveFolder
- the folder to which the files will be moved if archive action is selectedfileExtension
- the file extension used filtering completed files.dcOutputFolder
- the folder from which the files need to be moved/deletedlogger
- exception will be logged in this loggerNodeStartException
- will be throws if archive folder doesn't exists and not creatable.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void shutdown()
protected void doRetentionAction() throws java.lang.Exception
java.lang.Exception
- if an error occurs during scan of directory.