public abstract class CollectionManagerAbstract extends CollectionAbstract implements CollectionManager
CollectionAbstract.DateSorter, CollectionAbstract.MyStreamFilter
CollectionManager.ChangeChecker, CollectionManager.TriggerEvent, CollectionManager.TriggerListener
auxInfo, 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(java.lang.String collectionName,
java.lang.String collectionSpec,
java.lang.String olderThan,
java.util.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, setStreamFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLastChanged, getLastScanned, isScanNeeded, scan
extractDate, getAuxInfo, getCollectionName, getFilenames, getFilesSorted, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, getRoot, hasDateExtractor, putAuxInfo
public static CollectionManager open(java.lang.String collectionName, java.lang.String collectionSpec, java.lang.String olderThan, java.util.Formatter errlog)
public boolean isStatic()
CollectionManager
isStatic
in interface CollectionManager
public void setStatic(boolean aStatic)
public TimeDuration getRecheck()
CollectionManager
getRecheck
in interface CollectionManager
public CloseableIterator<MFile> getFileIterator() throws java.io.IOException
MCollection
try (CloseableIteratoriter = getFileIterator()) { while (iter.hasNext()) { MFile file = iter.next(); } }
getFileIterator
in interface MCollection
java.io.IOException
public void close()
MCollection
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface MCollection
public boolean scanIfNeeded() throws java.io.IOException
CollectionManager
scanIfNeeded
in interface CollectionManager
java.io.IOException
- on io errorpublic void addEventListener(CollectionManager.TriggerListener l)
CollectionManager
addEventListener
in interface CollectionManager
l
- listenerpublic void removeEventListener(CollectionManager.TriggerListener l)
removeEventListener
in interface CollectionManager