public class MappedDataSourceCatalog extends DataSourceCatalog
An extension to the DataSourceCatalog where product type names are
mapped to the table names in the database (to deal with large product type
names, which Oracle doesn't like)
dataSource, fieldIdStringFlag, INT, orderedValues, pageSizeX_POINT_ID| Constructor and Description |
|---|
MappedDataSourceCatalog(DataSource ds,
ValidationLayer valLayer,
boolean fieldId,
int pageSize,
long cacheUpdateMin,
Properties typeMap)
Constructs a new MappedDataSourceCatalog.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadata(Metadata metadata,
Product product)
Ingests
Metadata into the metadata store, and associates it with
the given productId. |
void |
addProductReferences(Product product)
|
Metadata |
getMetadata(Product product)
Gets the Metadata for a given Product.
|
List<Reference> |
getProductReferences(Product product)
Gets the
References associated with this Product. |
protected String |
getProductTypeTableName(String origName) |
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(Metadata metadata,
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. |
addProduct, getFirstPage, getLastProductPage, getNextPage, getNumProducts, getPrevPage, getProductById, getProductByName, getProducts, getProductsByProductType, getReducedMetadata, getResultListSize, getSqlQuery, getTopNProducts, getTopNProducts, getValidationLayer, quoteIt, setProductTransferStatuspublic MappedDataSourceCatalog(DataSource ds, ValidationLayer valLayer, boolean fieldId, int pageSize, long cacheUpdateMin, Properties typeMap)
ds - The DataSource connection to a DBMS catalog.valLayer - The ValidationLayer storign the element policy.fieldId - Whether or not field ids should be quoted.pageSize - The page size of returned products via Pagination API.cacheUpdateMin - The amount of minutes inbetween cache updates (if needed).typeMap - The mapping properties mapping product type names to table
name.public void addMetadata(Metadata metadata, Product product) throws CatalogException
Catalog
Ingests Metadata into the metadata store, and associates it with
the given productId.
addMetadata in interface CatalogaddMetadata in class DataSourceCatalogmetadata - The Metadata to ingest.product - The product to add the metadata for.CatalogException - If any general error occurs.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 CatalogaddProductReferences in class DataSourceCatalogproduct - 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 CataloggetMetadata in class DataSourceCatalogproduct - The Product to obtain the Metadata for.Metadata for the given productId.
CatalogException - If any error occurs.public List<Reference> getProductReferences(Product product) throws CatalogException
Catalog
Gets the References associated with this Product.
getProductReferences in interface CataloggetProductReferences in class DataSourceCatalogproduct - The Product to obtain the References for.List of References, associated with the
specified Product.CatalogExceptionpublic void modifyProduct(Product product) throws CatalogException
CatalogModifies an existing Product within the Catalog.
modifyProduct in interface CatalogmodifyProduct in class DataSourceCatalogproduct - The new Product information to modify the existing
Product with.CatalogException - If any error occurs.public void removeMetadata(Metadata metadata, Product product) throws CatalogException
Catalog
Removes Metadata from the metadata store, and disassociates it
from the given productId.
removeMetadata in interface CatalogremoveMetadata in class DataSourceCatalogmetadata - The Metadata to remove.product - The product for which the metadata is to be removed.CatalogException - If any general error occurs.public void removeProduct(Product product) throws CatalogException
Catalog
Removes a Product from the Catalog.
removeProduct in interface CatalogremoveProduct in class DataSourceCatalogproduct - The product to remove.CatalogException - If any error occurs.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 CatalogpagedQuery in class DataSourceCatalogquery - 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.public List<String> query(Query query, ProductType type) throws CatalogException
Catalog
Queries the Catalog with the specified Query
query in interface Catalogquery in class DataSourceCatalogquery - The set of criteria by which to query the Catalog.type - 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.Copyright © 1999–2017 Apache OODT. All rights reserved.