Class DefaultOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
java.lang.Object
com.broadleafcommerce.search.index.fulfillment.service.DefaultOrderFulfillmentService<P>
- All Implemented Interfaces:
OrderFulfillmentService<P>
public class DefaultOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
extends Object
implements OrderFulfillmentService<P>
Default implementation to read
OrderFulfillments
from the Order Service.- Author:
- Dima Myroniuk (dmyroniuk)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOrderFulfillmentService
(org.springframework.web.reactive.function.client.WebClient webClient, String orderFulfillmentEndpoint, String readOrderFulfillmentIdsPath, String readOrderFulfillmentsPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addBatchOrderFulfillmentIdFilter
(org.springframework.web.util.UriBuilder uriBuilder, List<String> ids) protected cz.jirutka.rsql.parser.ast.Node
buildBatchOrderFulfillmentIdsFilters
(String startId, Map<String, Object> additionalProperties) protected URI
buildReadBatchOfOrderFulfillmentIdsUri
(String startId, int batchSize) Deprecated.protected URI
buildReadBatchOfOrderFulfillmentIdsUri
(String startId, int batchSize, Map<String, Object> additionalProperties) Build the order fulfillment URI based on the provided parameters.protected URI
protected URI
protected String
protected String
protected String
The service client to use when calling inventory services.protected org.springframework.web.reactive.function.client.WebClient
readBatchOfOrderFulfillmentIds
(String startId, int batchSize) readBatchOfOrderFulfillmentIds
(String startId, int batchSize, Map<String, Object> additionalProperties) Reads a batch of IDs to be placed in a queue for processing.Reads a batch ofOrder fulfillments
by their IDs.readOrderFulfillmentByContextId
(String contextId) Reads anOrderFulfillment
by its ID.readOrderFulfillmentsByOrderId
(String orderId) Reads a batch ofOrder fulfillments
by order ID.void
setServiceClient
(String serviceClient) The service client to use when calling inventory services.
-
Field Details
-
CLIENT_REGISTRATION_ID
Deprecated.- See Also:
-
-
Constructor Details
-
DefaultOrderFulfillmentService
-
-
Method Details
-
readBatchOfOrderFulfillmentIds
public List<String> readBatchOfOrderFulfillmentIds(String startId, int batchSize) throws com.broadleafcommerce.search.api.SearchIndexException - Specified by:
readBatchOfOrderFulfillmentIds
in interfaceOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
-
readBatchOfOrderFulfillmentIds
public List<String> readBatchOfOrderFulfillmentIds(String startId, int batchSize, @Nullable Map<String, Object> additionalProperties) throws com.broadleafcommerce.search.api.SearchIndexExceptionDescription copied from interface:OrderFulfillmentService
Reads a batch of IDs to be placed in a queue for processing. Additional properties can also be specified to limit the items being read to be indexed.- Specified by:
readBatchOfOrderFulfillmentIds
in interfaceOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
- Parameters:
startId
- The starting IDbatchSize
- The size of the batchadditionalProperties
- additional information that can be used to filter the items to be indexed- Returns:
- A list of order fulfillment IDs.
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the order fulfillment ids fails.
-
buildReadBatchOfOrderFulfillmentIdsUri
@Deprecated(since="2.1.2-GA") protected URI buildReadBatchOfOrderFulfillmentIdsUri(@Nullable String startId, int batchSize) Deprecated.in favor ofbuildReadBatchOfOrderFulfillmentIdsUri(String, int, Map<String, Object>)
for the potential to utilize a time range when reading orders. -
buildReadBatchOfOrderFulfillmentIdsUri
protected URI buildReadBatchOfOrderFulfillmentIdsUri(@Nullable String startId, int batchSize, @Nullable Map<String, Object> additionalProperties) Build the order fulfillment URI based on the provided parameters.- Parameters:
startId
- The starting IDbatchSize
- The size of the batchadditionalProperties
- additional information that can be used to filter the items to be indexed- Returns:
- the built uri
-
readBatchOfOrderFulfillments
public List<P> readBatchOfOrderFulfillments(List<String> ids) throws com.broadleafcommerce.search.api.SearchIndexException Description copied from interface:OrderFulfillmentService
Reads a batch ofOrder fulfillments
by their IDs.- Specified by:
readBatchOfOrderFulfillments
in interfaceOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
- Parameters:
ids
- A list of order fulfillment IDs.- Returns:
- A list of order fulfillments or an empty list.
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the order fulfillment fails.
-
readOrderFulfillmentsByOrderId
public List<P> readOrderFulfillmentsByOrderId(String orderId) throws com.broadleafcommerce.search.api.SearchIndexException Description copied from interface:OrderFulfillmentService
Reads a batch ofOrder fulfillments
by order ID.- Specified by:
readOrderFulfillmentsByOrderId
in interfaceOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
- Parameters:
orderId
- an order ID.- Returns:
- A list of order fulfillments or an empty list.
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the order fulfillment fails.
-
readOrderFulfillmentByContextId
public Optional<P> readOrderFulfillmentByContextId(String contextId) throws com.broadleafcommerce.search.api.SearchIndexException Description copied from interface:OrderFulfillmentService
Reads anOrderFulfillment
by its ID.- Specified by:
readOrderFulfillmentByContextId
in interfaceOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
- Parameters:
contextId
- An order fulfillment id- Returns:
- An order fulfillment optional or
Optional.empty()
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the order fulfillment fails.
-
buildReadBatchOfOrderFulfillmentsUri
-
buildReadOrderFulfillmensByOrderIdUri
-
addBatchOrderFulfillmentIdFilter
-
buildBatchOrderFulfillmentIdsFilters
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient() -
getOrderFulfillmentEndpoint
-
getReadOrderFulfillmentIdsPath
-
getReadOrderFulfillmentsPath
-
getServiceClient
The service client to use when calling inventory services. Default is "indexerclient" -
setServiceClient
The service client to use when calling inventory services. Default is "indexerclient"
-
buildReadBatchOfOrderFulfillmentIdsUri(String, int, Map<String, Object>)
for the potential to utilize a time range when reading orders.