public class ScienceDataCatalog extends Object implements Catalog
| Modifier and Type | Field and Description |
|---|---|
protected DataSource |
dataSource |
protected int |
pageSize |
protected ValidationLayer |
validationLayer |
X_POINT_ID| Constructor and Description |
|---|
ScienceDataCatalog(DataSource dataSource,
ValidationLayer validationLayer,
int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadata(Metadata m,
Product p)
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)
|
int |
commitQuery(StringBuffer query,
String maxQuery) |
int |
createGranule(int datasetId,
String filename) |
int |
createParameter(int datasetId,
String longName) |
ProductPage |
getFirstPage(ProductType type) |
ProductPage |
getLastProductPage(ProductType type) |
Metadata |
getMetadata(Product product)
Gets the Metadata for a given Product.
|
ProductPage |
getNextPage(ProductType type,
ProductPage currentPage) |
int |
getNumProducts(ProductType productType) |
ProductPage |
getPrevPage(ProductType type,
ProductPage currentPage) |
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()
|
List<Product> |
getProductsByProductType(ProductType productType)
|
Metadata |
getReducedMetadata(Product product,
List<String> metList)
Gets a reduced set of metadata for a give Product.
|
List<Product> |
getTopNProducts(int num)
Gets the top
N most recent products that have been
cataloged. |
List<Product> |
getTopNProducts(int num,
ProductType productType)
Gets the top
N most recent products that have been
cataloged for the given ProductType. |
ValidationLayer |
getValidationLayer() |
void |
modifyProduct(Product arg0)
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 arg0,
ProductType arg1)
Queries the Catalog with the specified
Query |
void |
removeMetadata(Metadata arg0,
Product arg1)
Removes
Metadata from the metadata store, and disassociates it
from the given productId. |
void |
removeProduct(Product arg0)
Removes a
Product from the Catalog. |
void |
setProductTransferStatus(Product arg0)
Persists the
transferStatus attribute of the given
Product to the Catalog. |
protected DataSource dataSource
protected ValidationLayer validationLayer
protected int pageSize
public ScienceDataCatalog(DataSource dataSource, ValidationLayer validationLayer, int pageSize)
public void addMetadata(Metadata m, Product p) throws CatalogException
Catalog
Ingests Metadata into the metadata store, and associates it with
the given productId.
addMetadata in interface Catalogm - The Metadata to ingest.p - The product to add the metadata for.CatalogException - If any general error occurs.public int createGranule(int datasetId,
String filename)
throws CatalogException,
SQLException
CatalogExceptionSQLExceptionpublic int createParameter(int datasetId,
String longName)
throws CatalogException,
SQLException
CatalogExceptionSQLExceptionpublic int commitQuery(StringBuffer query, String maxQuery) throws SQLException
SQLExceptionpublic void addProduct(Product product) throws CatalogException
CatalogAdds a Product to the Catalog.
addProduct in interface Catalogproduct - The Product to add.CatalogException - If any error occurs during the add.public void addProductReferences(Product product) throws CatalogException
Catalog
Adds the specified List of References to the
Catalog, and associates them with this Product specified
by its productId.
addProductReferences in interface Catalogproduct - The product to add references for. The references are read
from the Products list of References.CatalogException - If anything goes wrong.public Metadata getMetadata(Product product) throws CatalogException
CatalogGets the Metadata for a given Product.
getMetadata in interface Catalogproduct - The Product to obtain the Metadata for.Metadata for the given productId.
CatalogException - If any error occurs.public int getNumProducts(ProductType productType) throws CatalogException
getNumProducts in interface CatalogproductType - The ProductType to count the number of products for.Products for the
specified ProductType.CatalogException - If any error occurs.public Product getProductById(String productId) throws CatalogException
Catalog
Gets a Product, with the specified productId.
getProductById in interface CatalogproductId - The unique ID of the Product to retrieve.Product, with the given ID. The implementer of this
method should ensure that the product References are
populated as well.CatalogException - If any error occurs.public Product getProductByName(String productName) throws CatalogException
Catalog
Gets a Product with the specified productName.
getProductByName in interface CatalogproductName - The name of the Product to retrieve.Product with the given name. The implementer of this
method should ensure that the product References are
populated as well.CatalogExceptionpublic List<Reference> getProductReferences(Product product) throws CatalogException
Catalog
Gets the References associated with this Product.
getProductReferences in interface Catalogproduct - The Product to obtain the References for.List of References, associated with the
specified Product.CatalogExceptionpublic List<Product> getProducts() throws CatalogException
CataloggetProducts in interface CatalogList of Products in the Catalog.CatalogException - If any error occurs.public List<Product> getProductsByProductType(ProductType productType) throws CatalogException
CataloggetProductsByProductType in interface CatalogproductType - The ProductType to obtain the Products for.List of Products that are associated with the
specified productType in the Catalog.CatalogException - If any error occurs.public Metadata getReducedMetadata(Product product, List<String> metList) throws CatalogException
CatalogGets a reduced set of metadata for a give Product.
getReducedMetadata in interface Catalogproduct - The Product to obtain the Metadata for.metList - The set of metadata elements of interest.Metadata for the given productId.CatalogException - If any error occurs.public List<Product> getTopNProducts(int num) throws CatalogException
Catalog
Gets the top N most recent products that have been
cataloged.
getTopNProducts in interface Catalognum - The amount of recent products to return.List of Products that have been cataloged
recently.CatalogException - If any error occurs.public List<Product> getTopNProducts(int num, ProductType productType) throws CatalogException
Catalog
Gets the top N most recent products that have been
cataloged for the given ProductType.
getTopNProducts in interface Catalognum - The amount of recent products to return.productType - The ProductType to limit the query to.List of Products that have been cataloged
recently.CatalogException - If any error occurs.public ValidationLayer getValidationLayer()
getValidationLayer in interface CatalogValidationLayer that is used by this Catalog.public void modifyProduct(Product arg0) throws CatalogException
CatalogModifies an existing Product within the Catalog.
modifyProduct in interface Catalogarg0 - The new Product information to modify the existing
Product with.CatalogException - If any error occurs.public List<String> query(Query arg0, ProductType arg1) throws CatalogException
Catalog
Queries the Catalog with the specified Query
query in interface Catalogarg0 - The set of criteria by which to query the Catalog.arg1 - The ProductType that should be queried.List of String product IDs that can be used to retrieve
products that match the query.CatalogException - If any error occurs.public void removeMetadata(Metadata arg0, Product arg1) throws CatalogException
Catalog
Removes Metadata from the metadata store, and disassociates it
from the given productId.
removeMetadata in interface Catalogarg0 - The Metadata to remove.arg1 - The product for which the metadata is to be removed.CatalogException - If any general error occurs.public void removeProduct(Product arg0) throws CatalogException
Catalog
Removes a Product from the Catalog.
removeProduct in interface Catalogarg0 - The product to remove.CatalogException - If any error occurs.public void setProductTransferStatus(Product arg0) throws CatalogException
Catalog
Persists the transferStatus attribute of the given
Product to the Catalog.
setProductTransferStatus in interface Catalogarg0 - The Product whose transfer status will be persisted. The
caller should make sure that the product ID field is set.CatalogExceptionpublic ProductPage getFirstPage(ProductType type)
getFirstPage in interface Paginationtype - The ProductType to obtain the first ProductPage for.ProductType.public ProductPage getLastProductPage(ProductType type)
getLastProductPage in interface Paginationtype - The ProductType to obtain the last ProductPage for.ProductType.public ProductPage getNextPage(ProductType type, ProductPage currentPage)
getNextPage in interface Paginationtype - The ProductType to obtain the next page for, given the
currentPage.currentPage - The current page that tells the function what the next page to
obtain is.public ProductPage getPrevPage(ProductType type, ProductPage currentPage)
getPrevPage in interface Paginationtype - The ProductType to obtain the previous page for, given the
currentPage.currentPage - The currentPage that tells the function what the previous page
to obtain is.public ProductPage pagedQuery(Query query, ProductType type, int pageNum) throws CatalogException
Catalog
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.
pagedQuery in interface Catalogquery - 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.ProductPage of results.CatalogException - If any error occurs.Copyright © 1999–2017 Apache OODT. All rights reserved.