public class SolrCatalog extends Object implements Catalog
Catalog interface
 that uses a Solr back-end metadata store.X_POINT_ID| Constructor and Description | 
|---|
| SolrCatalog(String solrUrl,
           ProductIdGenerator productIdGenerator,
           ProductSerializer productSerializer) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addMetadata(Metadata metadata,
           Product product)
 Ingests  Metadatainto the metadata store, and associates it with
 the givenproductId. | 
| void | addProduct(Product product)Method that adds a Product to the Catalog,
 persisting its fundamental CAS attributes (id, name, type, ingestion time, etc.). | 
| void | addProductReferences(Product product) | 
| 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 type) | 
| ProductPage | getPrevPage(ProductType type,
           ProductPage currentPage) | 
| Product | getProductById(String productId)
 Gets a  Product, with the specifiedproductId. | 
| Product | getProductByName(String productName)
 Gets a  Productwith the specifiedproductName. | 
| List<Reference> | getProductReferences(Product product)
 Gets the  References associated with this Product. | 
| List<Product> | getProducts() | 
| List<Product> | getProductsByProductType(ProductType type) | 
| 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  Nmost recent products that have been
 cataloged. | 
| List<Product> | getTopNProducts(int n,
               ProductType type)
 Gets the top  Nmost recent products that have been
 cataloged for the givenProductType. | 
| 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(Metadata metadata,
              Product product)This method implementation will remove the specified keys and values from the product metadata,
 leaving all other metadata keys and values unchanged. | 
| void | removeProduct(Product product)
 Removes a  Productfrom the Catalog. | 
| void | setProductTransferStatus(Product product)
 Persists the  transferStatusattribute of the givenProductto the Catalog. | 
public SolrCatalog(String solrUrl, ProductIdGenerator productIdGenerator, ProductSerializer productSerializer)
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 Catalogmetadata - The Metadata to ingest.product - The product to add the metadata for.CatalogException - If any general error occurs.public void removeMetadata(Metadata metadata, Product product) throws CatalogException
removeMetadata in interface Catalogmetadata - The Metadata to remove.product - The product for which the metadata is to be removed.CatalogException - If any general error occurs.public void addProduct(Product product) throws CatalogException
addProduct in interface Catalogproduct - The Product to add.CatalogException - If any error occurs during the add.public void modifyProduct(Product product) throws CatalogException
CatalogModifies an existing Product within the Catalog.
modifyProduct in interface Catalogproduct - The new Product information to modify the existing
            Product with.CatalogException - If any error occurs.public void removeProduct(Product product) throws CatalogException
Catalog
 Removes a Product from the Catalog.
 
removeProduct in interface Catalogproduct - The product to remove.CatalogException - If any error occurs.public void setProductTransferStatus(Product product) throws CatalogException
Catalog
 Persists the transferStatus attribute of the given
 Product to the Catalog.
setProductTransferStatus in interface Catalogproduct - The Product whose transfer status will be persisted. The
            caller should make sure that the product ID field is set.CatalogExceptionpublic 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 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 type) throws CatalogException
CataloggetProductsByProductType in interface Catalogtype - 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 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 Metadata getReducedMetadata(Product product, List<String> elements) throws CatalogException
CatalogGets a reduced set of metadata for a give Product.
getReducedMetadata in interface Catalogproduct - The Product to obtain the Metadata for.elements - The set of metadata elements of interest.Metadata for the given productId.CatalogException - If any error occurs.public List<String> query(Query query, ProductType type) throws CatalogException
 Queries the Catalog with the specified Query
 
query in interface Catalogquery - 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.public List<Product> getTopNProducts(int n) throws CatalogException
Catalog
 Gets the top N most recent products that have been
 cataloged.
 
getTopNProducts in interface Catalogn - The amount of recent products to return.List of Products that have been cataloged
         recently.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 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.public 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 List<Product> getTopNProducts(int n, ProductType type) throws CatalogException
Catalog
 Gets the top N most recent products that have been
 cataloged for the given ProductType.
 
getTopNProducts in interface Catalogn - The amount of recent products to return.type - 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 int getNumProducts(ProductType type) throws CatalogException
getNumProducts in interface Catalogtype - The ProductType to count the number of products for.Products for the
         specified ProductType.CatalogException - If any error occurs.Copyright © 1999–2017 Apache OODT. All rights reserved.