Class AbstractProductSingleIndexRequestHandler
- java.lang.Object
-
- com.broadleafcommerce.search.index.common.messaging.handler.AbstractSingleIndexRequestHandler
-
- com.broadleafcommerce.search.index.catalog.messaging.handler.AbstractProductSingleIndexRequestHandler
-
- Direct Known Subclasses:
AncillaryProductSingleIndexRequestHandler
,ProductSingleIndexRequestHandler
public abstract class AbstractProductSingleIndexRequestHandler extends com.broadleafcommerce.search.index.common.messaging.handler.AbstractSingleIndexRequestHandler
Abstract SingleIndexRequest handler capable of reading products from Catalog for use in event processing.
-
-
Constructor Summary
Constructors Constructor Description AbstractProductSingleIndexRequestHandler(CatalogService catalogService, com.broadleafcommerce.search.index.core.service.ReindexDelegationService reindexDelegationService, com.broadleafcommerce.search.index.core.service.ReindexService reindexService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CatalogService
getCatalogService()
protected String
getProductCtxId(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
Read the context ID of the product associated with the given object.protected abstract String
getProductCtxIdPath()
Get the path for retrieving the product context ID from a single index request JSON payload.protected com.broadleafcommerce.search.index.core.service.ReindexDelegationService
getReindexDelegationService()
protected com.broadleafcommerce.search.index.core.service.ReindexService
getReindexService()
protected List<com.broadleafcommerce.search.catalog.core.domain.Product>
readProducts(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
Read all state versions of products with the context ID of the product associated with the given object.
-
-
-
Constructor Detail
-
AbstractProductSingleIndexRequestHandler
public AbstractProductSingleIndexRequestHandler(CatalogService catalogService, com.broadleafcommerce.search.index.core.service.ReindexDelegationService reindexDelegationService, com.broadleafcommerce.search.index.core.service.ReindexService reindexService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Detail
-
readProducts
protected List<com.broadleafcommerce.search.catalog.core.domain.Product> readProducts(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) throws com.broadleafcommerce.search.api.SearchIndexException
Read all state versions of products with the context ID of the product associated with the given object.- Parameters:
singleIndexRequest
- The JSON representation of the single index request- Returns:
- list of all state versions of products with the object's product context ID
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if the object has no context ID for a product
-
getProductCtxId
protected String getProductCtxId(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) throws com.broadleafcommerce.search.api.SearchIndexException
Read the context ID of the product associated with the given object.- Parameters:
singleIndexRequest
- The JSON representation of the single index request- Returns:
- the context ID of the associated product
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if the object has no context ID for a product
-
getProductCtxIdPath
protected abstract String getProductCtxIdPath()
Get the path for retrieving the product context ID from a single index request JSON payload.- Returns:
- path to product context ID
-
getCatalogService
protected CatalogService getCatalogService()
-
getReindexDelegationService
protected com.broadleafcommerce.search.index.core.service.ReindexDelegationService getReindexDelegationService()
-
getReindexService
protected com.broadleafcommerce.search.index.core.service.ReindexService getReindexService()
-
-