Package org.forgerock.audit.retention
Class TimeStampFileNamingPolicy
java.lang.Object
org.forgerock.audit.retention.TimeStampFileNamingPolicy
- All Implemented Interfaces:
 FileNamingPolicy
Creates a time stamp based file naming policy. Rotated files are renamed with a given prefix and a timestamp suffix.
- 
Constructor Summary
ConstructorsConstructorDescriptionTimeStampFileNamingPolicy(File initialFile, String timeStampFormat, String prefix) Constructs a TimeStampFileNaming policy with a given initial file, a timestamp format, and a prefix string. - 
Method Summary
Modifier and TypeMethodDescriptionGets the initial file.Gets the next name for thisFileNamingPolicy.List the files in the initial file directory that match the prefix, name and suffix format. 
- 
Constructor Details
- 
TimeStampFileNamingPolicy
Constructs a TimeStampFileNaming policy with a given initial file, a timestamp format, and a prefix string.- Parameters:
 initialFile- The initial file that will be archived.timeStampFormat- The timestamp format to append to the archived files. Should be a format that is understood byDateTimeFormatter.prefix- The prefix to prefix to the archived files.
 
 - 
 - 
Method Details
- 
getInitialName
Gets the initial file.- Specified by:
 getInitialNamein interfaceFileNamingPolicy- Returns:
 - The initial file.
 
 - 
getNextName
Gets the next name for thisFileNamingPolicy. The next name will be formatted with prefix first, then the initial filename and finally the timestamp will be appended.- Specified by:
 getNextNamein interfaceFileNamingPolicy- Returns:
 - The next archived file according to this 
FileNamingPolicy. 
 - 
listFiles
List the files in the initial file directory that match the prefix, name and suffix format. Lists all the archived files, from oldest to newest.- Specified by:
 listFilesin interfaceFileNamingPolicy- Returns:
 - Not-null, All the archived files.
 
 
 -