@ThreadSafe public class MFileCollectionManager extends CollectionManagerAbstract
CollectionAbstract.DateSorter, CollectionAbstract.MyGribFilterCollectionManager.ChangeChecker, CollectionManager.TriggerEvent, CollectionManager.TriggerListener| Modifier and Type | Field and Description |
|---|---|
protected FeatureCollectionConfig |
config |
changeChecker, recheckauxInfo, CATALOG, collectionName, dateExtractor, DIR, FILE, filter, GLOB, lastModified, LIST, logger, NCX_SUFFIX, protoChoice, root, sfilter, startCollection| Modifier | Constructor and Description |
|---|---|
|
MFileCollectionManager(FeatureCollectionConfig config,
Formatter errlog,
org.slf4j.Logger logger) |
|
MFileCollectionManager(String name,
CollectionConfig mc,
CalendarDate startPartition,
org.slf4j.Logger logger) |
protected |
MFileCollectionManager(String name,
org.slf4j.Logger logger) |
|
MFileCollectionManager(String name,
String spec,
Formatter errlog,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDirectoryScan(String dirName,
String suffix,
String regexpPatternString,
String subdirsS,
String olderS,
Object auxInfo)
Add a directory scan to the collection
|
static MController |
getController() |
Iterable<MFile> |
getFilesSorted()
Get the current collection of MFile.
|
long |
getLastChanged()
Get the last time the collection changed
|
long |
getLastScanned()
Get the last time scanned
|
long |
getOlderThanFilterInMSecs() |
boolean |
hasDateExtractor()
Does this CollectionManager have the ability to extract a date from the MFile ?
|
protected boolean |
hasScans() |
boolean |
isScanNeeded()
Compute if synchronous scan is needed.
|
static MFileCollectionManager |
open(String collectionName,
String collectionSpec,
String olderThan,
Formatter errlog) |
static MFileCollectionManager |
openWithRecheck(String collectionName,
String recheckS) |
protected void |
reallyScan(Map<String,MFile> map) |
boolean |
scan(boolean sendEvent)
Do not use
|
static void |
setController(MController _controller)
Set the MController used by scan.
|
void |
setFiles(Iterable<MFile> files) |
String |
toString() |
addEventListener, close, createListenerManager, getFileIterator, getMetadata, getRecheck, isStatic, putMetadata, removeEventListener, scanIfNeeded, sendEvent, setChangeChecker, setMetadataStore, setStaticcleanName, extractDate, getAuxInfo, getCollectionName, getFilenames, getIndexFilename, getLastModified, getLatestFile, getProtoIndex, getRoot, getStartCollection, isLeaf, makeFileListSorted, parseOlderThanString, putAuxInfo, setDateExtractor, setLeaf, setMFileFilter, setRoot, setStreamFilterclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitextractDate, getAuxInfo, getCollectionName, getFilenames, getIndexFilename, getLastModified, getLatestFile, getProtoIndex, getRoot, getStartCollection, isLeaf, putAuxInfogetCollectionNameprotected FeatureCollectionConfig config
public MFileCollectionManager(FeatureCollectionConfig config, Formatter errlog, org.slf4j.Logger logger)
protected MFileCollectionManager(String name, org.slf4j.Logger logger)
public MFileCollectionManager(String name, String spec, Formatter errlog, org.slf4j.Logger logger)
public MFileCollectionManager(String name, CollectionConfig mc, CalendarDate startPartition, org.slf4j.Logger logger)
public static void setController(MController _controller)
_controller - use this MControllerpublic static MController getController()
public static MFileCollectionManager open(String collectionName, String collectionSpec, String olderThan, Formatter errlog) throws IOException
IOExceptionpublic static MFileCollectionManager openWithRecheck(String collectionName, String recheckS)
public void addDirectoryScan(String dirName, String suffix, String regexpPatternString, String subdirsS, String olderS, Object auxInfo)
dirName - scan this directorysuffix - require this suffix (overriddden by regexp), may be nullregexpPatternString - if present, use this reqular expression to filter files , may be nullsubdirsS - if "true", descend into subdirectories, may be nullolderS - udunit time unit - files must be older than this amount of time (now - lastModified > olderTime), may be null
// * @param dateFormatString dateFormatMark string, may be nullauxInfo - attach this object to any MFile found by this scanpublic long getOlderThanFilterInMSecs()
public long getLastScanned()
CollectionManagerpublic long getLastChanged()
CollectionManagerprotected boolean hasScans()
public boolean isScanNeeded()
public boolean scan(boolean sendEvent)
throws IOException
IOException - public void scanDebug(Formatter f) throws IOException {
getController(); // make sure a controller is instantiated
// run through all scanners and collect MFile instances into the Map
for (CollectionConfig mc : scanList) {
// lOOK: are there any circumstances where we dont need to recheck against OS, ie always use cached values?
Iteratorpublic Iterable<MFile> getFilesSorted()
MCollectionpublic boolean hasDateExtractor()
MCollectionhasDateExtractor in interface MCollectionhasDateExtractor in class CollectionAbstractprotected void reallyScan(Map<String,MFile> map) throws IOException
IOExceptionCopyright © 1999–2015 UCAR/Unidata. All rights reserved.