Class SolrCatalogInventoryService

  • All Implemented Interfaces:
    com.broadleafcommerce.search.index.catalog.service.InventoryAvailabilityService

    public class SolrCatalogInventoryService
    extends com.broadleafcommerce.search.index.catalog.service.DefautlInventoryAvailabilityService
    This component extends the DefautlInventoryAvailabilityService and implements a method to update Solr documents with Inventory availability data, when Stock Change notification occurs, for example.
    Author:
    Kelly Tisdell (ktisdell)
    • Field Summary

      • Fields inherited from class com.broadleafcommerce.search.index.catalog.service.DefautlInventoryAvailabilityService

        ADDITIONAL_SKUS_JSON_PATH, CLIENT_REGISTRATION_ID, FOR_IN_STORE_PARAM, FOR_PICKUP_PARAM, FOR_SHIPPING_PARAM, MIN_QUANTITY_PARAM, PRIMARY_SKU_JSON_PATH, SKU_CODES_PARAM
    • Constructor Summary

      Constructors 
      Constructor Description
      SolrCatalogInventoryService​(org.springframework.web.reactive.function.client.WebClient webClient, String inventoryEndpoint, String readAvailabilityPath, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.search.provider.solr.SolrCollectionResolver collectionResolver, org.apache.solr.client.solrj.SolrClient solrClient)  
    • Constructor Detail

      • SolrCatalogInventoryService

        public SolrCatalogInventoryService​(org.springframework.web.reactive.function.client.WebClient webClient,
                                           String inventoryEndpoint,
                                           String readAvailabilityPath,
                                           com.fasterxml.jackson.databind.ObjectMapper mapper,
                                           com.broadleafcommerce.search.provider.solr.SolrCollectionResolver collectionResolver,
                                           org.apache.solr.client.solrj.SolrClient solrClient)
    • Method Detail

      • updateInventoryAvailability

        public void updateInventoryAvailability​(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability consolidatedInventoryAvailability)
      • updateInventoryAvailabilityInternal

        protected void updateInventoryAvailabilityInternal​(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability consolidatedInventoryAvailability,
                                                           String collectionName)
      • getCommitWithin

        protected int getCommitWithin()
        Millis within which to commit the update to Solr.
        Returns:
      • findConsolidatedInventoryAvailability

        protected List<com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability> findConsolidatedInventoryAvailability​(Set<String> skus,
                                                                                                                                                 String tenantId)
      • createContextInfoForConsolidatingAvailabilityRequest

        protected com.broadleafcommerce.data.tracking.core.context.ContextInfo createContextInfoForConsolidatingAvailabilityRequest​(String tenantId)
      • buildReadInventoryAvailabilityUri

        protected String buildReadInventoryAvailabilityUri​(@NonNull
                                                           Set<String> skus,
                                                           @Nullable
                                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • determineSkuReferences

        protected String determineSkuReferences​(Set<String> skus,
                                                com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • isApplicationScoped

        protected boolean isApplicationScoped​(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability availability)
      • determineScope

        protected String determineScope​(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability availability)
      • getCollectionResolver

        protected com.broadleafcommerce.search.provider.solr.SolrCollectionResolver getCollectionResolver()
      • getSolrClient

        protected org.apache.solr.client.solrj.SolrClient getSolrClient()