@ThreadSafe public class CollectionManagerCatalog extends CollectionManagerAbstract implements CatalogCrawler.Listener
CollectionAbstract.DateSorter, CollectionAbstract.MyStreamFilter
CollectionManager.ChangeChecker, CollectionManager.TriggerEvent, CollectionManager.TriggerListener
recheck
auxInfo, CATALOG, collectionName, dateExtractor, DIR, FILE, GLOB, lastModified, LIST, logger, NCX_SUFFIX, protoChoice, root, sfilter, startCollection
Constructor and Description |
---|
CollectionManagerCatalog(java.lang.String collectionName,
java.lang.String collectionSpec,
java.lang.String olderThan,
java.util.Formatter errlog) |
Modifier and Type | Method and Description |
---|---|
boolean |
getCatalogRef(CatalogRef dd,
java.lang.Object context)
Gets called for each catalogRef found
|
void |
getDataset(Dataset ds,
java.lang.Object context)
Gets called for each dataset found.
|
java.lang.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
|
java.lang.String |
getRoot()
Get common root directory of all MFiles in the collection - may be null
|
boolean |
isScanNeeded()
Compute whether rescan is needed, based on getRecheck(), and the LastScanned value.
|
boolean |
scan(boolean sendEvent)
Scan the collection.
|
addEventListener, close, createListenerManager, getFileIterator, getMetadata, getRecheck, isStatic, open, putMetadata, removeEventListener, scanIfNeeded, sendEvent, setMetadataStore, setStatic
cleanName, extractDate, getAuxInfo, getCollectionName, getFilenames, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, hasDateExtractor, makeFileListSorted, parseOlderThanString, putAuxInfo, setDateExtractor, setRoot, setStreamFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
extractDate, getAuxInfo, getCollectionName, getFilenames, getIndexFilename, getLastModified, getLatestFile, getPartitionDate, getProtoIndex, hasDateExtractor, putAuxInfo
getCollectionName
public CollectionManagerCatalog(java.lang.String collectionName, java.lang.String collectionSpec, java.lang.String olderThan, java.util.Formatter errlog)
public java.lang.String getRoot()
MCollection
getRoot
in interface MCollection
getRoot
in class CollectionAbstract
public long getLastScanned()
CollectionManager
getLastScanned
in interface CollectionManager
public long getLastChanged()
CollectionManager
getLastChanged
in interface CollectionManager
public boolean isScanNeeded()
CollectionManager
isScanNeeded
in interface CollectionManager
public boolean scan(boolean sendEvent) throws java.io.IOException
CollectionManager
scan
in interface CollectionManager
java.io.IOException
- on I/O errorpublic java.lang.Iterable<MFile> getFilesSorted()
MCollection
getFilesSorted
in interface MCollection
public void getDataset(Dataset ds, java.lang.Object context)
CatalogCrawler.Listener
getDataset
in interface CatalogCrawler.Listener
ds
- the datasetcontext
- caller can pass this object in (used for thread safety)public boolean getCatalogRef(CatalogRef dd, java.lang.Object context)
CatalogCrawler.Listener
getCatalogRef
in interface CatalogCrawler.Listener
dd
- the datasetcontext
- caller can pass this object in (used for thread safety)