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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractOrderRelatedSingleIndexRequestHandler(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
Modifier and TypeMethodDescriptionprotected voiddeleteOrderFromIndex(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) Deletes an order from the index.protected StringgetOrderCtxId(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) Read the context ID of the order associated with the given object.protected abstract StringGet the path for retrieving the order context ID from a single index request JSON payload.protected Stringprotected OrderServiceprotected com.broadleafcommerce.search.index.core.service.ReindexDelegationServiceprotected com.broadleafcommerce.search.index.core.service.ReindexServiceprotected voidindexOrder(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) protected booleanisDelete(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) voidprocessSingleIndexRequest(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) protected com.broadleafcommerce.search.order.core.domain.OrderreadOrder(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) Read all state versions of orders with the context ID of the order associated with the given object.Methods inherited from class com.broadleafcommerce.search.index.common.messaging.handler.AbstractSingleIndexRequestHandler
getObjectMapper, getSupportedSimpleTypeNames, handle, hook, isValidType
-
Field Details
-
DEFAULT_DELETE_PROPERTY
- See Also:
-
-
Constructor Details
-
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 Details
-
processSingleIndexRequest
public void processSingleIndexRequest(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) - Specified by:
processSingleIndexRequestin 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
Get the path for retrieving the order context ID from a single index request JSON payload.- Returns:
- path to order context ID
-
isDelete
protected boolean isDelete(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) - Parameters:
singleIndexRequest- The JSON representation of the single index request- Returns:
- true if this is an order delete, else false.
-
deleteOrderFromIndex
protected void deleteOrderFromIndex(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) throws com.broadleafcommerce.search.api.SearchIndexException Deletes an order from the index.- Parameters:
singleIndexRequest- The JSON representation of the single index request- Throws:
com.broadleafcommerce.search.api.SearchIndexException- If the deletion fails.
-
getOrderDeleteProperty
-
getOrderService
-
getReindexDelegationService
protected com.broadleafcommerce.search.index.core.service.ReindexDelegationService getReindexDelegationService() -
getReindexService
protected com.broadleafcommerce.search.index.core.service.ReindexService getReindexService()
-