org.apache.oodt.cas.filemgr.catalog
Interface Catalog

All Superinterfaces:
Pagination
All Known Implementing Classes:
DataSourceCatalog, LuceneCatalog, MappedDataSourceCatalog, ScienceDataCatalog

public interface Catalog
extends Pagination

Version:
$Revision: 13181 $

A Catalog is the front end object interface for a back end peristance layer for storing product references and metadata. Classes implementing this interface implement methods to retrieve and store product references and metadata from a particular backend repository.

Author:
mattmann, bfoster

Field Summary
static String X_POINT_ID
           
 
Method Summary
 void addMetadata(org.apache.oodt.cas.metadata.Metadata m, Product product)
           Ingests Metadata into the metadata store, and associates it with the given productId.
 void addProduct(Product product)
           Adds a Product to the Catalog.
 void addProductReferences(Product product)
           Adds the specified List of References to the Catalog, and associates them with this Product specified by its productId.
 org.apache.oodt.cas.metadata.Metadata getMetadata(Product product)
           Gets the Metadata for a given Product.
 int getNumProducts(ProductType type)
           
 Product getProductById(String productId)
           Gets a Product, with the specified productId.
 Product getProductByName(String productName)
           Gets a Product with the specified productName.
 List<Reference> getProductReferences(Product product)
           Gets the References associated with this Product.
 List<Product> getProducts()
           Gets all the Products in the Catalog.
 List<Product> getProductsByProductType(ProductType type)
           Gets the Products associated with the specified ProductType in the Catalog.
 org.apache.oodt.cas.metadata.Metadata getReducedMetadata(Product product, List<String> elements)
           Gets a reduced set of metadata for a give Product.
 List<Product> getTopNProducts(int n)
           Gets the top N most recent products that have been cataloged.
 List<Product> getTopNProducts(int n, ProductType type)
           Gets the top N most recent products that have been cataloged for the given ProductType.
 ValidationLayer getValidationLayer()
           
 void modifyProduct(Product product)
           Modifies an existing Product within the Catalog.
 ProductPage pagedQuery(Query query, ProductType type, int pageNum)
           Performs a query against the underlying Catalog, and then properly formulates a page of results to send back to the user.
 List<String> query(Query query, ProductType type)
           Queries the Catalog with the specified Query
 void removeMetadata(org.apache.oodt.cas.metadata.Metadata m, Product product)
           Removes Metadata from the metadata store, and disassociates it from the given productId.
 void removeProduct(Product product)
           Removes a Product from the Catalog.
 void setProductTransferStatus(Product product)
           Persists the transferStatus attribute of the given Product to the Catalog.
 
Methods inherited from interface org.apache.oodt.cas.filemgr.util.Pagination
getFirstPage, getLastProductPage, getNextPage, getPrevPage
 

Field Detail

X_POINT_ID

static final String X_POINT_ID
Method Detail

addMetadata

void addMetadata(org.apache.oodt.cas.metadata.Metadata m,
                 Product product)
                 throws CatalogException

Ingests Metadata into the metadata store, and associates it with the given productId.

Parameters:
m - The Metadata to ingest.
product - The product to add the metadata for.
Throws:
CatalogException - If any general error occurs.

removeMetadata

void removeMetadata(org.apache.oodt.cas.metadata.Metadata m,
                    Product product)
                    throws CatalogException

Removes Metadata from the metadata store, and disassociates it from the given productId.

Parameters:
m - The Metadata to remove.
product - The product for which the metadata is to be removed.
Throws:
CatalogException - If any general error occurs.

addProduct

void addProduct(Product product)
                throws CatalogException

Adds a Product to the Catalog.

Parameters:
product - The Product to add.
Throws:
CatalogException - If any error occurs during the add.

modifyProduct

void modifyProduct(Product product)
                   throws CatalogException

Modifies an existing Product within the Catalog.

Parameters:
product - The new Product information to modify the existing Product with.
Throws:
CatalogException - If any error occurs.

removeProduct

void removeProduct(Product product)
                   throws CatalogException

Removes a Product from the Catalog.

Parameters:
product - The product to remove.
Throws:
CatalogException - If any error occurs.

setProductTransferStatus

void setProductTransferStatus(Product product)
                              throws CatalogException

Persists the transferStatus attribute of the given Product to the Catalog.

Parameters:
product - The Product whose transfer status will be persisted. The caller should make sure that the product ID field is set.
Throws:
CatalogException

addProductReferences

void addProductReferences(Product product)
                          throws CatalogException

Adds the specified List of References to the Catalog, and associates them with this Product specified by its productId.

Parameters:
product - The product to add references for. The references are read from the Products list of References.
Throws:
CatalogException - If anything goes wrong.

getProductById

Product getProductById(String productId)
                       throws CatalogException

Gets a Product, with the specified productId.

Parameters:
productId - The unique ID of the Product to retrieve.
Returns:
A Product, with the given ID. The implementer of this method should ensure that the product References are populated as well.
Throws:
CatalogException - If any error occurs.

getProductByName

Product getProductByName(String productName)
                         throws CatalogException

Gets a Product with the specified productName.

Parameters:
productName - The name of the Product to retrieve.
Returns:
A Product with the given name. The implementer of this method should ensure that the product References are populated as well.
Throws:
CatalogException

getProductReferences

List<Reference> getProductReferences(Product product)
                                     throws CatalogException

Gets the References associated with this Product.

Parameters:
product - The Product to obtain the References for.
Returns:
A List of References, associated with the specified Product.
Throws:
CatalogException

getProducts

List<Product> getProducts()
                          throws CatalogException

Gets all the Products in the Catalog.

Returns:
A List of Products in the Catalog.
Throws:
CatalogException - If any error occurs.

getProductsByProductType

List<Product> getProductsByProductType(ProductType type)
                                       throws CatalogException

Gets the Products associated with the specified ProductType in the Catalog.

Parameters:
type - The ProductType to obtain the Products for.
Returns:
A List of Products that are associated with the specified productType in the Catalog.
Throws:
CatalogException - If any error occurs.

getMetadata

org.apache.oodt.cas.metadata.Metadata getMetadata(Product product)
                                                  throws CatalogException

Gets the Metadata for a given Product.

Parameters:
product - The Product to obtain the Metadata for.
Returns:
The Metadata for the given productId.

Throws:
CatalogException - If any error occurs.

getReducedMetadata

org.apache.oodt.cas.metadata.Metadata getReducedMetadata(Product product,
                                                         List<String> elements)
                                                         throws CatalogException

Gets a reduced set of metadata for a give Product.

Parameters:
product - The Product to obtain the Metadata for.
elements - The set of metadata elements of interest.
Returns:
The reduced Metadata for the given productId.
Throws:
CatalogException - If any error occurs.

query

List<String> query(Query query,
                   ProductType type)
                   throws CatalogException

Queries the Catalog with the specified Query

.

Parameters:
query - The set of criteria by which to query the Catalog.
type - The ProductType that should be queried.
Returns:
A List of String product IDs that can be used to retrieve products that match the query.
Throws:
CatalogException - If any error occurs.

pagedQuery

ProductPage pagedQuery(Query query,
                       ProductType type,
                       int pageNum)
                       throws CatalogException

Performs a query against the underlying Catalog, and then properly formulates a page of results to send back to the user. This method is useful when you would like to conserve memory and not send back the entire list of results, nor load them into memory. Of course, this method assumes that queries are deterministic, i.e., the same query issued 2x within a paginating session will produce the same set of results to paginate.

Parameters:
query - The query to perform against the underlying Catalog.
type - The ProductType that you are querying for.
pageNum - The number of the ProductPage to return back to the user.
Returns:
The requested ProductPage of results.
Throws:
CatalogException - If any error occurs.

getTopNProducts

List<Product> getTopNProducts(int n)
                              throws CatalogException

Gets the top N most recent products that have been cataloged.

Parameters:
n - The amount of recent products to return.
Returns:
A List of Products that have been cataloged recently.
Throws:
CatalogException - If any error occurs.

getTopNProducts

List<Product> getTopNProducts(int n,
                              ProductType type)
                              throws CatalogException

Gets the top N most recent products that have been cataloged for the given ProductType.

Parameters:
n - The amount of recent products to return.
type - The ProductType to limit the query to.
Returns:
A List of Products that have been cataloged recently.
Throws:
CatalogException - If any error occurs.

getValidationLayer

ValidationLayer getValidationLayer()
                                   throws CatalogException
Returns:
The ValidationLayer that is used by this Catalog.
Throws:
CatalogException - If any error occurs (e.g., the layer isn't initialized).

getNumProducts

int getNumProducts(ProductType type)
                   throws CatalogException
Parameters:
type - The ProductType to count the number of products for.
Returns:
An integer count of the number of Products for the specified ProductType.
Throws:
CatalogException - If any error occurs.


Copyright © 1999-2011 Apache OODT. All Rights Reserved.