@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, protoChoice, recheck| Modifier | Constructor and Description |
|---|---|
|
MFileCollectionManager(FeatureCollectionConfig config,
Formatter errlog) |
protected |
MFileCollectionManager(String name) |
|
MFileCollectionManager(String name,
MCollection mc,
CalendarDate startPartition) |
|
MFileCollectionManager(String name,
String spec,
Formatter errlog) |
| 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 scan is needed.
|
static MFileCollectionManager |
open(String collection,
String olderThan,
Formatter errlog) |
static MFileCollectionManager |
openWithRecheck(String recheckS) |
protected void |
reallyScan(Map<String,MFile> map) |
boolean |
scan(boolean sendEvent)
Scan the collection.
|
boolean |
scanIfNeeded()
If isScanNeeded(), do a scan.
|
static void |
setController(MController _controller)
Set the MController used by scan.
|
void |
setDateExtractor(DateExtractor dateExtractor) |
String |
toString() |
addEventListener, close, createListenerManager, deleteOld, enableMetadataManager, getAuxInfo, getCollectionName, 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)
protected MFileCollectionManager(String name)
public MFileCollectionManager(String name, MCollection mc, CalendarDate startPartition)
public static void setController(MController _controller)
_controller - use this MControllerpublic static MController getController()
public static MFileCollectionManager open(String collection, String olderThan, Formatter errlog) throws IOException
IOExceptionpublic static MFileCollectionManager openWithRecheck(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 boolean scan(boolean sendEvent)
throws IOException
CollectionManagerIOException - on I/O errorpublic 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-2012 UCAR/Unidata. All Rights Reserved.