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 readOrderFulfillments
from the Order Service.- Author:
- Dima Myroniuk (dmyroniuk)
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
CLIENT_REGISTRATION_ID
Deprecated.
-
Constructor Summary
Constructors Constructor Description DefaultOrderFulfillmentService(org.springframework.web.reactive.function.client.WebClient webClient, String orderFulfillmentEndpoint, String readOrderFulfillmentIdsPath, String readOrderFulfillmentsPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addBatchOrderFulfillmentIdFilter(org.springframework.web.util.UriBuilder uriBuilder, List<String> ids)
protected URI
buildReadBatchOfOrderFulfillmentIdsUri(String startId, int batchSize)
protected URI
buildReadBatchOfOrderFulfillmentsUri(List<String> ids)
protected URI
buildReadOrderFulfillmensByOrderIdUri(String orderId)
protected String
getOrderFulfillmentEndpoint()
protected String
getReadOrderFulfillmentIdsPath()
protected String
getReadOrderFulfillmentsPath()
String
getServiceClient()
The service client to use when calling inventory services.protected org.springframework.web.reactive.function.client.WebClient
getWebClient()
List<String>
readBatchOfOrderFulfillmentIds(String startId, int batchSize)
Reads a batch of IDs to be placed in a queue for processing.List<P>
readBatchOfOrderFulfillments(List<String> ids)
Reads a batch ofOrder fulfillments
by their IDs.Optional<P>
readOrderFulfillmentByContextId(String contextId)
Reads anOrderFulfillment
by its ID.List<P>
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 Detail
-
CLIENT_REGISTRATION_ID
@Deprecated protected static final String CLIENT_REGISTRATION_ID
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
readBatchOfOrderFulfillmentIds
public List<String> readBatchOfOrderFulfillmentIds(String startId, int batchSize) throws com.broadleafcommerce.search.api.SearchIndexException
Description copied from interface:OrderFulfillmentService
Reads a batch of IDs to be placed in a queue for processing.- Specified by:
readBatchOfOrderFulfillmentIds
in interfaceOrderFulfillmentService<P extends com.broadleafcommerce.search.fulfillment.core.domain.OrderFulfillment>
- Parameters:
startId
- The starting IDbatchSize
- The size of the batch- Returns:
- A list of order fulfillment IDs.
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the order fulfillment ids fails.
-
buildReadBatchOfOrderFulfillmentIdsUri
protected URI buildReadBatchOfOrderFulfillmentIdsUri(@Nullable String startId, int batchSize)
-
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
protected URI buildReadBatchOfOrderFulfillmentsUri(List<String> ids)
-
buildReadOrderFulfillmensByOrderIdUri
protected URI buildReadOrderFulfillmensByOrderIdUri(String orderId)
-
addBatchOrderFulfillmentIdFilter
protected void addBatchOrderFulfillmentIdFilter(org.springframework.web.util.UriBuilder uriBuilder, List<String> ids)
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient()
-
getOrderFulfillmentEndpoint
protected String getOrderFulfillmentEndpoint()
-
getReadOrderFulfillmentIdsPath
protected String getReadOrderFulfillmentIdsPath()
-
getReadOrderFulfillmentsPath
protected String getReadOrderFulfillmentsPath()
-
getServiceClient
public String getServiceClient()
The service client to use when calling inventory services. Default is "indexerclient"
-
setServiceClient
public void setServiceClient(String serviceClient)
The service client to use when calling inventory services. Default is "indexerclient"
-
-