public class DefaultQueueFileHandlerImpl extends TimestampedStringQueueFileHandler
IStringQueueFileHandler to create
and delete cache files locally.
DefaultQueueFileHandlerImpl should be used when the queue
contains plain strings or, more in general, when the files of the queue
do not contain a header and a footer as it happens for example if the files
contain XML strings. In this last case, prefer DefaultXmlQueueFileHandler
DEFAULT_PREFIX, DEFAULT_SIZE, maxFilesSize, MAXSIZE_PROPERTY_NAME, prefix| Constructor and Description |
|---|
DefaultQueueFileHandlerImpl()
Build the handler with the default size and prefix.
|
DefaultQueueFileHandlerImpl(long maxFileSize)
Build the handler with the passed size for the files.
|
DefaultQueueFileHandlerImpl(long maxFileSize,
java.lang.String prefix)
Build the handler with the passed size and prefix.
|
DefaultQueueFileHandlerImpl(java.lang.String prefix)
Build the handler with the default size for the files
and the passed prefix
|
| Modifier and Type | Method and Description |
|---|---|
void |
fileProcessed(java.io.File filePointer,
java.lang.String minTime,
java.lang.String maxTime)
This method is invoked when all the strings in the passed file have been processed
by the queue i.e.
|
java.io.File |
getNewFile()
Attempts to create the file for the strings in several places
before giving up.
|
getMaxFileSize, getPrefixpublic DefaultQueueFileHandlerImpl()
StringQueueFileHandlerpublic DefaultQueueFileHandlerImpl(long maxFileSize)
maxFileSize - The max size of the files of the cache.StringQueueFileHandlerpublic DefaultQueueFileHandlerImpl(java.lang.String prefix)
prefix - The prefix of the name of the cache filesStringQueueFileHandlerpublic DefaultQueueFileHandlerImpl(long maxFileSize,
java.lang.String prefix)
maxFileSize - The max size of the files of the cache.prefix - The prefix of the name of the cache filesStringQueueFileHandlerpublic void fileProcessed(java.io.File filePointer,
java.lang.String minTime,
java.lang.String maxTime)
TimestampedStringQueueFileHandlerNote: implementors of this method shall ensure that the file is deleted.
The dates are represented as strings in ISO format.
fileProcessed in class TimestampedStringQueueFileHandlerfilePointer - The file to be releasedminTime - The min timestamp of the strings in cache
(null if the file is empty)maxTime - The max timestamp of the strings in cache
(null if the file is empty)alma.acs.util.stringqueue.IStringQueueFileHandler#fileProcessed(java.io.File, java.lang.String, java.lang.String)public java.io.File getNewFile()
throws java.io.IOException
getNewFile in class TimestampedStringQueueFileHandlerjava.io.IOException - In case of error creating the filealma.acs.util.stringqueue.IStringQueueFileHandler#getNewFile()