Class ProductDao
java.lang.Object
gov.nasa.pds.registry.common.es.dao.ProductDao
Product data access object.
Provides methods to query Elasticsearch for product information.
- Author:
- karpenko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCollectionIds(String bundleLidvid) Get collection references of a bundle.getLatestLidVids(Collection<String> lids) Given a list of LIDs, find latest versionsgetProductClass(String lidvid) Get product class by LIDVIDintgetRefDocCount(String collectionLidVid, char type) Get number of reference documents (pages) by collection LIDVID and type.Get product references from collection inventoryvoidupdateArchiveStatus(Collection<String> lidvids, String status) Update archive status by lidvids
-
Constructor Details
-
ProductDao
Constructor.- Parameters:
client- Elasticsearch clientindexName- Elasticsearch index name, e.g., "registry".
-
-
Method Details
-
getProductClass
Get product class by LIDVID- Parameters:
lidvid- product LIDVID- Returns:
- product class, such as "Product_Bundle" or null if the LIDVID doesn't exist.
- Throws:
Exception- an exception
-
getRefDocCount
Get number of reference documents (pages) by collection LIDVID and type.- Parameters:
collectionLidVid- collection LIDVIDtype- reference type: 'P' - primary, 'S' - secondary- Returns:
- number of documents (pages)
- Throws:
Exception- an exception
-
getRefs
Get product references from collection inventory- Parameters:
collectionLidVid- collection LIDVIDtype- reference type: 'P' - primary, 'S' - secondarypage- page number starting from 1- Returns:
- list of product LIDVIDs
- Throws:
Exception- ResponseException exception - there was a problem calling Elasticsearch, other exceptions - parsing problems (invalid JSON).
-
updateArchiveStatus
Update archive status by lidvids- Parameters:
lidvids- a list of lidvids to updatestatus- new status- Throws:
Exception- an exception
-
getCollectionIds
Get collection references of a bundle. References can be either LIDs, LIDVIDs or both.- Parameters:
bundleLidvid- bundle LIDVID- Returns:
- Collection references
- Throws:
Exception- an exception
-
getLatestLidVids
Given a list of LIDs, find latest versions- Parameters:
lids- a list of LIDs- Returns:
- a list of latest LIDVIDs
- Throws:
Exception- an exception
-