Interface ProductHydrationService

All Known Implementing Classes:
DefaultProductHydrationService

public interface ProductHydrationService
Responsible for performing simple hydration of references within Products by querying for those references and populating their full values.

By default, the following references will be hydrated in hydrate(Product, ContextInfo) and hydrate(Page, ContextInfo):

For a much more comprehensive and deeper aggregation of product data, see ProductConsolidationService.

Author:
Samarth Dhruva (samarthd)
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    hydrate(ProductOption unhydrated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Gets the IDs of items that are referenced by the unhydrated option, finds the referenced items in the data store, and then replaces each item reference on the option with the fully-populated representation of the item.
    hydrate(Product unhydrated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Gets the IDs of items that are referenced by the unhydrated product, finds the referenced items in the data store, and then replaces each item reference on the product with the fully-populated representation of the item.
    org.springframework.data.domain.Page<Product>
    hydrate(org.springframework.data.domain.Page<Product> unhydrated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Gets the IDs of items that are referenced by each product, finds the referenced items in the data store, and then replaces each item reference on the product with the fully-populated representation of the item.
    org.springframework.data.domain.Page<Product>
    hydratePrimaryAssets(org.springframework.data.domain.Page<Product> unhydrated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Specifically finds and hydrates the Product.primaryAsset of each product in the given page.
  • Method Details

    • hydrate

      Product hydrate(Product unhydrated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Gets the IDs of items that are referenced by the unhydrated product, finds the referenced items in the data store, and then replaces each item reference on the product with the fully-populated representation of the item.

      The class-level javadoc above describes the references which will be hydrated by default.

      Parameters:
      unhydrated - the unhydrated product whose references should be hydrated
      Returns:
      the product after applying the hydration
    • hydrate

      org.springframework.data.domain.Page<Product> hydrate(org.springframework.data.domain.Page<Product> unhydrated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Gets the IDs of items that are referenced by each product, finds the referenced items in the data store, and then replaces each item reference on the product with the fully-populated representation of the item.

      A page of those hydrated products is then returned.

      The class-level javadoc above describes the references which will be hydrated by default.

      Parameters:
      unhydrated - the page of unhydrated products whose references should be hydrated
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      a page of the hydrated products
    • hydratePrimaryAssets

      org.springframework.data.domain.Page<Product> hydratePrimaryAssets(org.springframework.data.domain.Page<Product> unhydrated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specifically finds and hydrates the Product.primaryAsset of each product in the given page.
      Parameters:
      unhydrated - the page of unhydrated products whose primary assets should be hydrated
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      a page of the hydrated products
    • hydrate

      ProductOption hydrate(ProductOption unhydrated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Gets the IDs of items that are referenced by the unhydrated option, finds the referenced items in the data store, and then replaces each item reference on the option with the fully-populated representation of the item.

      The class-level javadoc above describes the references which will be hydrated by default.

      Parameters:
      unhydrated - the unhydrated option whose references should be hydrated
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the option after applying the hydration