org.apache.oodt.cas.filemgr.ingest
Class StdIngester
java.lang.Object
org.apache.oodt.cas.filemgr.ingest.StdIngester
- All Implemented Interfaces:
- Ingester, CoreMetKeys
- Direct Known Subclasses:
- CachedIngester, CmdLineIngester
public class StdIngester
- extends Object
- implements Ingester, CoreMetKeys
- Version:
- $Revision: 11462 $
An implementation of the Ingster
interface that uses the following
pieces of Metadata
information to determine how to ingest a
Product
:
- Filename - The name of the Product file to ingest.
- ProductType - The type of the Product to ingest.
- FileLocation - A full path pointer to directory containing the Product
file to ingest.
The Ingester
supports overriding certain Product
properties,
including:
- Specification of
ProductStructure
parameter that will
tell the Ingester
whether or not the Product
is a directory
or a regular file.
- Specification of
ProductName
parameter that will tell the
Ingester
a name for the Product
to use (default is using the
specified Metadata
field, Filename
.
.
- Author:
- mattmann, bfoster
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. |
String |
ingest(URL fmUrl,
File prodFile,
org.apache.oodt.cas.metadata.Metadata met)
Ingests a Product to the file manager service object identified
by the given URL parameter. |
String |
ingest(URL fmUrl,
File prodFile,
org.apache.oodt.cas.metadata.MetExtractor extractor,
File metConfFile)
Ingests a Product to the file manager service object identified
by the given URL parameter. |
void |
ingest(URL fmUrl,
List<String> prodFiles,
org.apache.oodt.cas.metadata.MetExtractor extractor,
File metConfFile)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StdIngester
public StdIngester(String transferService)
ingest
public String ingest(URL fmUrl,
File prodFile,
org.apache.oodt.cas.metadata.MetExtractor extractor,
File metConfFile)
throws IngestException
- Description copied from interface:
Ingester
- Ingests a
Product
to the file manager service object identified
by the given URL
parameter. The product Metadata
is
extracted dynamically using the provided MetExtractor
interface.
- Specified by:
ingest
in interface Ingester
- Parameters:
fmUrl
- The URL
pointer to the file manager service.prodFile
- The File
pointer to the product file.extractor
- The given MetExtractor
to use to extract
Metadata
from the Product
.metConfFile
- A ConfigFile
for the MetExtractor
.
- Returns:
- The ID returned by the file manager for the newly ingested
product.
- Throws:
IngestException
- If there is an error ingesting the Product
ingest
public void ingest(URL fmUrl,
List<String> prodFiles,
org.apache.oodt.cas.metadata.MetExtractor extractor,
File metConfFile)
throws IngestException
- Specified by:
ingest
in interface Ingester
- Parameters:
fmUrl
- The URL
pointer to the file manager service.prodFiles
- A List
of String
filePaths pointing to
Product
files to ingest.extractor
- The given MetExtractor
to use to extract
Metadata
from the Product
s.metConfFile
- A ConfigFile
for the MetExtractor
.
- Throws:
IngestException
- If there is an error ingesting the Product
s.
ingest
public String ingest(URL fmUrl,
File prodFile,
org.apache.oodt.cas.metadata.Metadata met)
throws IngestException
- Description copied from interface:
Ingester
- Ingests a
Product
to the file manager service object identified
by the given URL
parameter. The product Metadata
is
provided a priori.
- Specified by:
ingest
in interface Ingester
- Parameters:
fmUrl
- The URL
pointer to the file manager service.prodFile
- The File
pointer to the product file.met
- The given Metadata
object already extracted from the
Product
.
- Returns:
- The ID returned by the file manager for the newly ingested
product.
- Throws:
IngestException
- If there is an error ingesting the Product
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
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
- 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
Copyright © 1999-2011 Apache OODT. All Rights Reserved.