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
ConstructorsModifierConstructorDescriptionprotected
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
Modifier and TypeMethodDescriptionprotected void
deleteOrderFromIndex
(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) Deletes an order from the index.protected String
getOrderCtxId
(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) Read the context ID of the order associated with the given object.protected abstract String
Get the path for retrieving the order context ID from a single index request JSON payload.protected String
protected OrderService
protected com.broadleafcommerce.search.index.core.service.ReindexDelegationService
protected com.broadleafcommerce.search.index.core.service.ReindexService
protected void
indexOrder
(com.fasterxml.jackson.databind.JsonNode singleIndexRequest) protected boolean
isDelete
(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.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:
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
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()
-