org.apache.oodt.cas.filemgr.ingest
Class CachedIngester
java.lang.Object
org.apache.oodt.cas.filemgr.ingest.StdIngester
org.apache.oodt.cas.filemgr.ingest.CachedIngester
- All Implemented Interfaces:
- Ingester, CoreMetKeys
public class CachedIngester
- extends StdIngester
- Version:
- $Revision: 12226 $
An extension of the StdIngester
that uses a Cache
to keep
track of Product
ingestion status. If the existing Cache
used
is already sync'ed to the requested File Manager (specified by the
fmUrl
parameter in hasProduct(URL, File)
or
hasProduct(URL, String)
), then the Cache
will simply return
the value of Cache.contains(String)
. Otherwise the Cache
will be re-Cache.sync()
'ed to the given File Manager before the
contains method is invoked.
.
- Author:
- mattmann
Method Summary |
boolean |
hasProduct(URL fmUrl,
File prodFile)
Checks the file manager at the given URL to see whether or not it
knows about the provided Product File parameter. |
boolean |
hasProduct(URL fmUrl,
String productName)
Checks the file manager at the given URL to see whether or not it
knows about the provided Product with the given
productName parameter. |
void |
resynsc()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedIngester
public CachedIngester(String transferService,
String cacheServiceFactory,
String cachePropFile)
throws InstantiationException
- Parameters:
transferService
- The underlying data transfer service to use to ingest
Product
s.cacheServiceFactory
- The CacheFactory
to use to construct this
Ingester
's Cache
.cachePropFile
- The file path to the cache properties file to load to
configure the Cache
.
- Throws:
InstantiationException
CachedIngester
public CachedIngester(String transferService,
Cache cache)
throws InstantiationException
- Parameters:
transferService
- The underlying data transfer service to use to ingest
Product
s.cache
- The Cache
that this Ingester
will use.
- Throws:
InstantiationException
- If any error occurs.
hasProduct
public boolean hasProduct(URL fmUrl,
File prodFile)
throws CatalogException
- Description copied from interface:
Ingester
- Checks the file manager at the given
URL
to see whether or not it
knows about the provided Product
File
parameter. To do
this, it uses File.getName()
as the Metadata
key
Filename
.
- Specified by:
hasProduct
in interface Ingester
- Overrides:
hasProduct
in class StdIngester
prodFile
- The File
to check for existance of within the file
manager at given URL
.
- Returns:
-
- Throws:
CatalogException
hasProduct
public boolean hasProduct(URL fmUrl,
String productName)
throws CatalogException
- Description copied from interface:
Ingester
- Checks the file manager at the given
URL
to see whether or not it
knows about the provided Product
with the given
productName
parameter. To do this, it uses the provided
productName
key as the Metadata
key to search for
in the catalog.
- Specified by:
hasProduct
in interface Ingester
- Overrides:
hasProduct
in class StdIngester
- Parameters:
fmUrl
- The URL
pointer to the file manager service.productName
- The Product
to search for, identified by its (possibly
not unique) name.
- Returns:
- True if the file manager has the product, false otherwise.
- Throws:
CatalogException
resynsc
public void resynsc()
throws CacheException
- Throws:
CacheException
Copyright © 1999-2011 Apache OODT. All Rights Reserved.