@ThreadSafe public class MFileCollectionManager extends CollectionManagerAbstract
CollectionManager.ChangeChecker, CollectionManager.Force, CollectionManager.TriggerEvent, CollectionManager.TriggerListener, CollectionManager.TriggerType| Modifier and Type | Field and Description |
|---|---|
static String |
CATALOG |
protected FeatureCollectionConfig |
config |
protected DateExtractor |
dateExtractor |
protected CalendarDate |
startPartition |
auxInfo, changeChecker, collectionName, logger, protoChoice, recheck| Modifier | Constructor and Description |
|---|---|
|
MFileCollectionManager(FeatureCollectionConfig config,
Formatter errlog,
org.slf4j.Logger logger) |
protected |
MFileCollectionManager(String name,
org.slf4j.Logger logger) |
|
MFileCollectionManager(String name,
MCollection mc,
CalendarDate startPartition,
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
|
CalendarDate |
extractRunDate(MFile mfile)
Use the date extractor to extract the date from the filename.
|
static MController |
getController() |
Iterable<MFile> |
getFiles()
Get the current collection of MFile.
|
long |
getLastScanned()
Get the last time scanned
|
long |
getOlderThanFilterInMSecs()
The "olderThan" amount in seconds.
|
String |
getRoot()
Get common root directory of all MFiles in the collection - may be null
|
CalendarDate |
getStartCollection()
The starting date of the collection.
|
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 olderThan,
Formatter errlog) |
static MFileCollectionManager |
openWithRecheck(String collectionName,
String recheckS) |
protected void |
reallyScan(Map<String,MFile> map) |
boolean |
scan(boolean sendEvent)
Scan the collection.
|
void |
scanDebug(Formatter f)
Do not use
|
boolean |
scanIfNeeded()
If isScanNeeded(), do a scan.
|
static void |
setController(MController _controller)
Set the MController used by scan.
|
void |
setDateExtractor(DateExtractor dateExtractor) |
void |
setFiles(Iterable<MFile> files)
dcm must be updated when index is read in
|
String |
toString() |
addEventListener, cleanName, close, createListenerManager, deleteOld, enableMetadataManager, getAuxInfo, getCollectionName, getFilenames, getLatestFile, getMetadata, getProtoIndex, getRecheck, isStatic, putAuxInfo, putMetadata, removeEventListener, resetProto, setChangeChecker, setStatic, updateNocheckpublic static final String CATALOG
protected DateExtractor dateExtractor
protected CalendarDate startPartition
protected 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, MCollection 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 olderThan, Formatter errlog) throws IOException
IOExceptionpublic static MFileCollectionManager openWithRecheck(String collectionName, String recheckS)
public CalendarDate getStartCollection()
CollectionManagerpublic void setDateExtractor(DateExtractor dateExtractor)
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 String getRoot()
CollectionManagerpublic long getOlderThanFilterInMSecs()
CollectionManagergetOlderThanFilterInMSecs in interface CollectionManagergetOlderThanFilterInMSecs in class CollectionManagerAbstractpublic long getLastScanned()
CollectionManagerpublic boolean scanIfNeeded()
throws IOException
CollectionManagerIOException - on io errorprotected boolean hasScans()
public boolean isScanNeeded()
public void scanDebug(Formatter f) throws IOException
IOExceptionpublic boolean scan(boolean sendEvent)
throws IOException
CollectionManagerIOException - on I/O errorpublic void setFiles(Iterable<MFile> files)
CollectionManagerpublic Iterable<MFile> getFiles()
CollectionManagerpublic CalendarDate extractRunDate(MFile mfile)
CollectionManagermfile - extract from herepublic boolean hasDateExtractor()
CollectionManagerprotected void reallyScan(Map<String,MFile> map) throws IOException
IOExceptionCopyright © 1999–2013 UCAR/Unidata. All rights reserved.