public abstract class CollectionManagerAbstract extends CollectionAbstract implements CollectionManager
CollectionAbstract.DateSorter, CollectionAbstract.MyStreamFilterCollectionManager.ChangeChecker, CollectionManager.TriggerEvent, CollectionManager.TriggerListenerauxInfo, CATALOG, collectionName, dateExtractor, DIR, FILE, GLOB, lastModified, LIST, logger, protoChoice, root, sfilter, startCollection| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(CollectionManager.TriggerListener l)
Register to get Trigger events
|
void |
close()
Close and release any resources.
|
CloseableIterator<MFile> |
getFileIterator()
Get the current collection of MFile, no guaranteed order.
|
TimeDuration |
getRecheck()
Get how often to rescan
|
boolean |
isStatic()
static means doesnt need to be monitored for changes; can be externally triggered, or read in at startup.
|
static CollectionManager |
open(String collectionName,
String collectionSpec,
String olderThan,
Formatter errlog) |
void |
removeEventListener(CollectionManager.TriggerListener l) |
boolean |
scanIfNeeded()
If isScanNeeded(), do a scan.
|
void |
setStatic(boolean aStatic) |
cleanName, extractDate, getAuxInfo, getCollectionName, getFilenames, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, getRoot, hasDateExtractor, makeFileListSorted, parseOlderThanString, putAuxInfo, setDateExtractor, setRoot, setStreamFilterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLastChanged, getLastScanned, isScanNeeded, scanextractDate, getAuxInfo, getCollectionName, getFilenames, getFilesSorted, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, getRoot, hasDateExtractor, putAuxInfopublic static CollectionManager open(String collectionName, String collectionSpec, String olderThan, Formatter errlog) throws IOException
IOExceptionpublic boolean isStatic()
CollectionManagerisStatic in interface CollectionManagerpublic void setStatic(boolean aStatic)
public TimeDuration getRecheck()
CollectionManagergetRecheck in interface CollectionManagerpublic CloseableIterator<MFile> getFileIterator() throws IOException
MCollection
try (CloseableIterator iter = getFileIterator()) {
while (iter.hasNext()) {
MFile file = iter.next();
}
}
getFileIterator in interface MCollectionIOExceptionpublic void close()
MCollectionclose in interface Closeableclose in interface AutoCloseableclose in interface MCollectionpublic boolean scanIfNeeded()
throws IOException
CollectionManagerscanIfNeeded in interface CollectionManagerIOException - on io errorpublic void addEventListener(CollectionManager.TriggerListener l)
CollectionManageraddEventListener in interface CollectionManagerl - listenerpublic void removeEventListener(CollectionManager.TriggerListener l)
removeEventListener in interface CollectionManager