public interface CollectionManager extends MCollection, CollectionUpdateListener
NetcdfDataset.open(MFile.getPath, ...);should work.
A CollectionManager implements the A collection element defines the collection of datasets. wherecollection element
<collection spec="/data/ldm/pub/native/satellite/3.9/WEST-CONUS_4km/WEST-CONUS_4km_3.9_#yyyyMMdd_HHmm#.gini$"
name="WEST-CONUS_4km" olderThan="1 min" olderThan="15 min" />
The XML Schema:
<xsd:complexType name="collectionType">
1) <xsd:attribute name="spec" type="xsd:string" use="required"/>
2) <xsd:attribute name="name" type="xsd:token"/>
3) <xsd:attribute name="olderThan" type="xsd:string" />
5) <xsd:attribute name="dateFormatMark" type="xsd:string"/>
6) <xsd:attribute name="timePartition" type="xsd:string"/>
</xsd:complexType>
Modifier and Type | Interface and Description |
---|---|
static interface |
CollectionManager.ChangeChecker |
static class |
CollectionManager.TriggerEvent |
static interface |
CollectionManager.TriggerListener
A TriggerEvent.proto is sent if protoDataset.change = "cron" has been specified
A TriggerEvent.update is sent if a scan has happened and a change in the list of MFiles has occurred,
or an MFile has been updated
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(CollectionManager.TriggerListener l)
Register to get Trigger events
|
long |
getLastChanged()
Get the last time the collection changed
|
long |
getLastScanned()
Get the last time scanned
|
TimeDuration |
getRecheck()
Get how often to rescan
|
boolean |
isScanNeeded()
Compute whether rescan is needed, based on getRecheck(), and the LastScanned value.
|
boolean |
isStatic()
static means doesnt need to be monitored for changes; can be externally triggered, or read in at startup.
|
void |
removeEventListener(CollectionManager.TriggerListener l) |
boolean |
scan(boolean sendEvent)
Scan the collection.
|
boolean |
scanIfNeeded()
If isScanNeeded(), do a scan.
|
close, extractDate, getAuxInfo, getCollectionName, getFileIterator, getFilenames, getFilesSorted, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, getRoot, hasDateExtractor, putAuxInfo
getCollectionName, sendEvent
boolean isStatic()
long getLastScanned()
long getLastChanged()
TimeDuration getRecheck()
boolean isScanNeeded()
boolean scanIfNeeded() throws java.io.IOException
java.io.IOException
- on io errorboolean scan(boolean sendEvent) throws java.io.IOException
java.io.IOException
- on I/O errorvoid addEventListener(CollectionManager.TriggerListener l)
l
- listenervoid removeEventListener(CollectionManager.TriggerListener l)