Interface CatalogProvider<I extends CatalogItem>
- Type Parameters:
I
- The type of the results expected in theSearchResponse
. Should extendCatalogItem
.
- All Known Implementing Classes:
ExternalCatalogProvider
public interface CatalogProvider<I extends CatalogItem>
Provider for interfacing with operations around catalog. Typically utilizes
WebClient
to
make requests to an external REST API.-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.bulk.v2.domain.BulkOperationResponse
createBulkOperation
(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates a bulk operation with the suppliedBulkOperationRequest
.List<com.broadleafcommerce.bulk.v2.domain.SupportedBulkOperation>
getSupportedBulkOperations
(String operationType, String entityType) Retrieves the list of supported bulk operations for the given operation type in catalog services.com.broadleafcommerce.bulk.v2.domain.InitializeItemResponse
initializeItems
(SearchResponse<I> catalogItems, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Initializes the bulk operation items from the entities returned in theSearchResponse
.org.springframework.data.domain.Page<Category>
retrieveAutoIncludedCategories
(org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a page of categories that are marked as `AUTO_INCLUDE`.retrieveCategoryDetails
(String categoryContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves the category details for the given category context id.com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse
updateBulkOperationTotalRecordCount
(long totalRecordCount, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates the bulk operation to set the total record count after item initialization.updateCategoryProducts
(CategoryProductRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates the category products for the givenCategoryProductRequest
.
-
Method Details
-
createBulkOperation
com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse createBulkOperation(com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates a bulk operation with the suppliedBulkOperationRequest
.- Parameters:
bulkOperationRequest
- theBulkOperationRequest
to createcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the created bulk operation
-
getSupportedBulkOperations
List<com.broadleafcommerce.bulk.v2.domain.SupportedBulkOperation> getSupportedBulkOperations(String operationType, @Nullable String entityType) Retrieves the list of supported bulk operations for the given operation type in catalog services.- Parameters:
operationType
- the operation type to checkentityType
- the entity type to check- Returns:
- the list of supported bulk operations
-
initializeItems
com.broadleafcommerce.bulk.v2.domain.InitializeItemResponse initializeItems(SearchResponse<I> catalogItems, com.broadleafcommerce.bulk.v2.domain.BulkOperationRequest bulkOperationRequest, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Initializes the bulk operation items from the entities returned in theSearchResponse
.- Parameters:
catalogItems
- the list of catalog items from the search servicebulkOperationRequest
- theBulkOperationRequest
for this bulk operationbulkOperationResponse
- the bulk operation createdpageable
- the current page informationcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the
InitializeItemResponse
containing the items created for the bulk operation
-
updateBulkOperationTotalRecordCount
com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse updateBulkOperationTotalRecordCount(long totalRecordCount, com.broadleafcommerce.bulk.v2.domain.BulkOperationResponse bulkOperationResponse, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates the bulk operation to set the total record count after item initialization.- Parameters:
totalRecordCount
- the total number of bulk operation item recordsbulkOperationResponse
- the bulk operationcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the updated
bulk operation
-
retrieveAutoIncludedCategories
org.springframework.data.domain.Page<Category> retrieveAutoIncludedCategories(org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a page of categories that are marked as `AUTO_INCLUDE`.- Parameters:
page
- the page informationcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the page of categories
-
retrieveCategoryDetails
Category retrieveCategoryDetails(String categoryContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves the category details for the given category context id.- Parameters:
categoryContextId
- the category context idcontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the category details
-
updateCategoryProducts
CategoryProductResponse updateCategoryProducts(CategoryProductRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates the category products for the givenCategoryProductRequest
. This will add or remove products from the categories. Any products that are unable to be removed will have their change container ids be returned in theCategoryProductResponse
to be forwarded onto the Sandbox service for reversion.- Parameters:
request
- theCategoryProductRequest
to updatecontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- the list of products
-