Interface CatalogProvider<I extends CatalogItem>

Type Parameters:
I - The type of the results expected in the SearchResponse. Should extend CatalogItem.
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 Type
    Method
    Description
    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 supplied BulkOperationRequest.
    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 the SearchResponse.
    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 given CategoryProductRequest.
  • 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 supplied BulkOperationRequest.
      Parameters:
      bulkOperationRequest - the BulkOperationRequest to create
      contextInfo - 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 check
      entityType - 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 the SearchResponse.
      Parameters:
      catalogItems - the list of catalog items from the search service
      bulkOperationRequest - the BulkOperationRequest for this bulk operation
      bulkOperationResponse - the bulk operation created
      pageable - the current page information
      contextInfo - 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 records
      bulkOperationResponse - the bulk operation
      contextInfo - 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 information
      contextInfo - 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 id
      contextInfo - 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 given CategoryProductRequest. 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 the CategoryProductResponse to be forwarded onto the Sandbox service for reversion.
      Parameters:
      request - the CategoryProductRequest to update
      contextInfo - context information surrounding sandboxing/multitenant state
      Returns:
      the list of products