Class AbstractOrderRelatedSingleIndexRequestHandler
- java.lang.Object
-
- com.broadleafcommerce.search.index.common.messaging.handler.AbstractSingleIndexRequestHandler
-
- com.broadleafcommerce.search.index.order.messaging.handler.AbstractOrderRelatedSingleIndexRequestHandler
-
- Direct Known Subclasses:
OrderFulfillmentSingleIndexRequestHandler
,OrderSingleIndexRequestHandler
public abstract class AbstractOrderRelatedSingleIndexRequestHandler extends com.broadleafcommerce.search.index.common.messaging.handler.AbstractSingleIndexRequestHandler
Listens for and handles single index requests that ultimately trigger index updates for orders.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOrderRelatedSingleIndexRequestHandler(OrderService orderService, 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 String
getOrderCtxId(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
Read the context ID of the order associated with the given object.protected abstract String
getOrderCtxIdPath()
Get the path for retrieving the order context ID from a single index request JSON payload.protected OrderService
getOrderService()
protected com.broadleafcommerce.search.index.core.service.ReindexDelegationService
getReindexDelegationService()
protected com.broadleafcommerce.search.index.core.service.ReindexService
getReindexService()
protected void
indexOrder(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
void
processSingleIndexRequest(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
protected com.broadleafcommerce.search.order.core.domain.Order
readOrder(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
Read all state versions of orders with the context ID of the order associated with the given object.
-
-
-
Constructor Detail
-
AbstractOrderRelatedSingleIndexRequestHandler
protected AbstractOrderRelatedSingleIndexRequestHandler(OrderService orderService, com.broadleafcommerce.search.index.core.service.ReindexDelegationService reindexDelegationService, com.broadleafcommerce.search.index.core.service.ReindexService reindexService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Detail
-
processSingleIndexRequest
public void processSingleIndexRequest(com.fasterxml.jackson.databind.JsonNode singleIndexRequest)
- Specified by:
processSingleIndexRequest
in classcom.broadleafcommerce.search.index.common.messaging.handler.AbstractSingleIndexRequestHandler
-
indexOrder
protected void indexOrder(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) throws com.broadleafcommerce.search.api.SearchIndexException
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
-
readOrder
@Nullable protected com.broadleafcommerce.search.order.core.domain.Order readOrder(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) throws com.broadleafcommerce.search.api.SearchIndexException
Read all state versions of orders with the context ID of the order associated with the given object.- Parameters:
singleIndexRequest
- The JSON representation of the single index request- Returns:
- list of all state versions of orders with the object's order context ID
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if the object has no context ID for an order
-
getOrderCtxId
protected String getOrderCtxId(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) throws com.broadleafcommerce.search.api.SearchIndexException
Read the context ID of the order associated with the given object.- Parameters:
singleIndexRequest
- The JSON representation of the single index request- Returns:
- the context ID of the associated order
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if the object has no context ID for an order
-
getOrderCtxIdPath
protected abstract String getOrderCtxIdPath()
Get the path for retrieving the order context ID from a single index request JSON payload.- Returns:
- path to order context ID
-
getOrderService
protected OrderService getOrderService()
-
getReindexDelegationService
protected com.broadleafcommerce.search.index.core.service.ReindexDelegationService getReindexDelegationService()
-
getReindexService
protected com.broadleafcommerce.search.index.core.service.ReindexService getReindexService()
-
-