Interface CustomerService
- All Known Implementing Classes:
DefaultCustomerService
public interface CustomerService
Service to interact with Customer service to retrieve customers for indexing.
-
Method Summary
Modifier and TypeMethodDescriptionreadBatchOfCustomerIds
(String startId, int batchSize) Reads a batch of IDs to be placed in a queue for processing.List<com.broadleafcommerce.search.customer.core.domain.Customer>
readBatchOfCustomers
(List<String> ids) Reads a batch ofCustomers
by their IDs.Optional<com.broadleafcommerce.search.customer.core.domain.Customer>
readCustomer
(String id) Reads a batch ofCustomers
by their IDs.
-
Method Details
-
readBatchOfCustomerIds
List<String> readBatchOfCustomerIds(@Nullable String startId, int batchSize) throws com.broadleafcommerce.search.api.SearchIndexException Reads a batch of IDs to be placed in a queue for processing.- Parameters:
startId
- The starting IDbatchSize
- The size of the batch- Returns:
- A list of customer IDs.
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the customer ids fails.
-
readBatchOfCustomers
List<com.broadleafcommerce.search.customer.core.domain.Customer> readBatchOfCustomers(List<String> ids) throws com.broadleafcommerce.search.api.SearchIndexException Reads a batch ofCustomers
by their IDs.- Parameters:
ids
- A list of customer IDs.- Returns:
- A list of customers or an empty list.
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the customer fails.
-
readCustomer
Optional<com.broadleafcommerce.search.customer.core.domain.Customer> readCustomer(String id) throws com.broadleafcommerce.search.api.SearchIndexException Reads a batch ofCustomers
by their IDs.- Parameters:
id
- A customer id- Returns:
- A customer optional or
Optional.empty()
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if reading the customer fails.
-