org.apache.oodt.cas.filemgr.ingest
Class StdIngester

java.lang.Object
  extended by 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$

An implementation of the Ingster interface that uses the following pieces of Metadata information to determine how to ingest a Product:

The Ingester supports overriding certain Product properties, including: .
Author:
mattmann, bfoster

Field Summary
 
Fields inherited from interface org.apache.oodt.cas.filemgr.metadata.CoreMetKeys
FILE_LOCATION, FILE_SIZE, FILENAME, MIME_TYPE, PRODUCT_ID, PRODUCT_NAME, PRODUCT_RECEVIED_TIME, PRODUCT_STRUCTURE, PRODUCT_TYPE
 
Constructor Summary
StdIngester(String transferService)
           
 
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, Metadata met)
          Ingests a Product to the file manager service object identified by the given URL parameter.
 String ingest(URL fmUrl, File prodFile, 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, MetExtractor extractor, File metConfFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdIngester

public StdIngester(String transferService)
Method Detail

ingest

public String ingest(URL fmUrl,
                     File prodFile,
                     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,
                   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 Products.
metConfFile - A ConfigFile for the MetExtractor.
Throws:
IngestException - If there is an error ingesting the Products.

ingest

public String ingest(URL fmUrl,
                     File prodFile,
                     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-2013
Apache OODT. All Rights Reserved.