public class FlatDailyArchiveManager extends ExtendedArchiveManager
ExtendedArchiveManager.AbstractWorkerThread, ExtendedArchiveManager.ArchiveItemWorkerThread, ExtendedArchiveManager.PurgeWorkerThread
ArchiveManager.ProcessCallBack
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEF_DATE_FORMAT_STR
Default date-formatter pattern string ("yyyyMMdd").
|
static java.lang.String |
DEF_FNAME_DATE_SEPSTR
Default datecode separator string ("_").
|
archiveItemQueueVec, archiveItemWTObj, archiveItemWTSyncObj, purgeWTObj, purgeWTSyncObj, strictArchiveDateFlag
archiveAccessSyncObj, archiveClosedFlag, archivedClassConstructor, archivedFormPrefixStr, archivedItemDelimiter, archiveFileNameStr, archiveOutStm, archiveRootDirName, assumeNewlineFlag, dontPurgeLastFileFlag, filesForDateRangeVec, lastItemArchiveDate, leaveOutputStreamsOpenFlag, purgeIntoArchiveFlag, timeCheckOffsetMs
Constructor and Description |
---|
FlatDailyArchiveManager(java.lang.Class classObj,
java.lang.String baseFileNameStr)
Creates a new FlatDailyArchiveManager.
|
FlatDailyArchiveManager(java.lang.Class classObj,
java.lang.String archiveRootDirName,
java.lang.String baseFileNameStr)
Creates a new FlatDailyArchiveManager.
|
FlatDailyArchiveManager(java.lang.Class classObj,
java.lang.String archiveRootDirName,
java.lang.String baseFileNameStr,
boolean strictArchiveDateFlag)
Creates a new FlatDailyArchiveManager.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createDefaultDateFormatter()
Creates the default date formatter.
|
protected boolean |
doesNextArchiveFileExist(java.lang.String fNameStr)
Determines if the next file in the archive sequence exists.
|
protected java.lang.String |
getArchiveFileNameForDate(java.util.Date dateObj)
Returns the name of the archive file that would contain items with
the given date.
|
protected java.util.Vector |
getArchiveFilesForDateRange(java.util.Date startDate,
java.util.Date endDate)
Returns all of the archive file names that can potentially contain
items with an archive date between startDate and endDate (inclusive).
|
protected java.util.Date |
getDateForArchiveFileName(java.lang.String fNameStr)
Parses the given filename for a date code.
|
java.text.DateFormat |
getDateFormatObj()
Returns the 'DateFormat' object used to generate date codes inserted
into archive file names.
|
java.text.DateFormat |
getFileNameDateParserObj()
Returns a 'DateFormat' parser that may be used to parse a date value
from an archive file name.
|
java.lang.String |
getFNameDateSepStr()
Returns the separator string put in front of date codes inserted into
archive file names.
|
protected java.io.OutputStream |
getOutputStreamForItem(Archivable item)
Returns an output stream for the file that the item should be
archived to, with a name based on the archive date of item.
|
void |
setDateFormatObj(java.text.DateFormat dFormatObj)
Sets the 'DateFormat' object used to generate date codes inserted into
archive file names.
|
void |
setDateFormatTimeZone(java.util.TimeZone timeZoneObj)
Sets the time zone for the 'DateFormat' object used to generate date
codes inserted into archive file names.
|
void |
setFNameDateSepStr(java.lang.String sepStr)
Sets the separator string put in front of date codes inserted into
archive file names.
|
addToWorkerThread, archiveItem, archiveQueuedItem, closeArchive, getArchivePollTime, getArchivePurgeAge, isArchiveItemQueueEnabled, purgeArchive, removeFromWorkerThread, setArchiveItemQueueEnabled, setArchivePollTime, setArchivePurgeAge, signalWorkerThread, terminateWorkerThreads
archiveItem, checkItemArchiveDate, close, close, closeArchiveOutStms, convertStringToArchivable, deleteFile, flush, getArchiveAccessSyncObj, getArchivedFormPrefixStr, getArchivedItemDelimiter, getArchivedItems, getArchivedItems, getArchivedItemsVector, getArchivedItemsVector, getArchiveFileForName, getDontPurgeLastFileFlag, getLeaveOutputStreamsOpenFlag, getLogFile, getLogPrefixString, getNewestArchiveFile, getNewestItemInArchiveFile, getNewestItemInEntireArchive, getNextItemDataFromFile, getNextLineFromFile, getOldestArchiveFile, getOldestItemInArchiveFile, getOldestItemInEntireArchive, getPurgeIntoArchiveFlag, getTimeCheckOffsetMs, isArchiveClosed, processArchivedItems, processArchivedItems, purgeArchive, purgeArchive, renameTo, setArchivedFormPrefixStr, setArchivedItemDelimiter, setDontPurgeLastFileFlag, setLeaveOutputStreamsOpenFlag, setLogFile, setLogPrefixString, setPurgeIntoArchiveFlag, setTimeCheckOffsetMs, writeItemToFile
public static final java.lang.String DEF_DATE_FORMAT_STR
public static final java.lang.String DEF_FNAME_DATE_SEPSTR
public FlatDailyArchiveManager(java.lang.Class classObj, java.lang.String archiveRootDirName, java.lang.String baseFileNameStr, boolean strictArchiveDateFlag) throws java.lang.NoSuchMethodException
classObj
- class object representing the class to be archived.archiveRootDirName
- name of root directory in which to place
archive files (and possibly directories), or null to use the
current working directory.baseFileNameStr
- the "base" file name to used to generate
archive file names. A date code will be inserted before the
extension part of the file name.strictArchiveDateFlag
- true if items must be in ascending
date/time order; false if not.java.lang.NoSuchMethodException
- if a proper constructor does not exist
for the class.java.lang.NullPointerException
- If baseFileNameStr
is null
public FlatDailyArchiveManager(java.lang.Class classObj, java.lang.String archiveRootDirName, java.lang.String baseFileNameStr) throws java.lang.NoSuchMethodException
classObj
- class object representing the class to be archived.archiveRootDirName
- name of root directory in which to place
archive files (and possibly directories), or null to use the
current working directory.baseFileNameStr
- the "base" file name to used to generate
archive file names. A date code will be inserted before the
extension part of the file name.java.lang.NoSuchMethodException
- if a proper constructor does not exist
for the class.java.lang.NullPointerException
- If baseFileNameStr
is null
public FlatDailyArchiveManager(java.lang.Class classObj, java.lang.String baseFileNameStr) throws java.lang.NoSuchMethodException
classObj
- class object representing the class to be archived.baseFileNameStr
- the "base" file name to used to generate
archive file names. A date code will be inserted before the
extension part of the file name.java.lang.NoSuchMethodException
- if a proper constructor does not exist
for the class.java.lang.NullPointerException
- If baseFileNameStr
is null
public void setDateFormatObj(java.text.DateFormat dFormatObj)
dFormatObj
- the 'DateFormat' object to use, or null to
set the default 'DateFormat' object.public java.text.DateFormat getDateFormatObj()
public void setDateFormatTimeZone(java.util.TimeZone timeZoneObj)
timeZoneObj
- the time zone object to use.public void setFNameDateSepStr(java.lang.String sepStr)
sepStr
- the separator string to use, or null to set the
default separator string.public java.lang.String getFNameDateSepStr()
protected void createDefaultDateFormatter()
protected java.lang.String getArchiveFileNameForDate(java.util.Date dateObj)
getArchiveFileNameForDate
in class ArchiveManager
dateObj
- the date object to use.protected java.io.OutputStream getOutputStreamForItem(Archivable item) throws java.io.IOException
getOutputStreamForItem
in class ArchiveManager
item
- the item to be archived.java.io.IOException
- if the archive file cannot be opened.protected java.util.Vector getArchiveFilesForDateRange(java.util.Date startDate, java.util.Date endDate)
getArchiveFilesForDateRange
in class ArchiveManager
startDate
- the start of the time range, or null to indicate
the "beginning of time".endDate
- the end of the time range, or null to indicate
the "end of time".public java.text.DateFormat getFileNameDateParserObj()
protected java.util.Date getDateForArchiveFileName(java.lang.String fNameStr)
fNameStr
- name of archive file.protected boolean doesNextArchiveFileExist(java.lang.String fNameStr)
doesNextArchiveFileExist
in class ArchiveManager
fNameStr
- name of archive file.