Class SolrCatalogInventoryService
- java.lang.Object
-
- com.broadleafcommerce.search.index.catalog.service.DefautlInventoryAvailabilityService
-
- com.broadleafcommerce.search.index.catalog.solr.service.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 theDefautlInventoryAvailabilityService
and implements a method to update Solr documents with Inventory availability data, when Stock Change notification occurs, for example.- Author:
- Kelly Tisdell (ktisdell)
-
-
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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
buildReadInventoryAvailabilityUri(Set<String> skus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
createContextInfoForConsolidatingAvailabilityRequest(String tenantId)
protected String
determineScope(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability availability)
protected String
determineSkuReferences(Set<String> skus, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected List<com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability>
findConsolidatedInventoryAvailability(Set<String> skus, String tenantId)
protected com.broadleafcommerce.search.provider.solr.SolrCollectionResolver
getCollectionResolver()
protected int
getCommitWithin()
Millis within which to commit the update to Solr.protected org.apache.solr.client.solrj.SolrClient
getSolrClient()
protected boolean
isApplicationScoped(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability availability)
void
updateInventoryAvailability(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability consolidatedInventoryAvailability)
protected void
updateInventoryAvailabilityInternal(com.broadleafcommerce.search.catalog.core.domain.ConsolidatedInventoryAvailability consolidatedInventoryAvailability, String collectionName)
-
Methods inherited from class com.broadleafcommerce.search.index.catalog.service.DefautlInventoryAvailabilityService
buildBasicUri, buildReadInventoryAvailabilityUri, determineSkuReferences, findConsolidatedInventoryAvailability, getForPickup, getForShipping, getHeaders, getInStore, getInventoryEndpoint, getMapper, getMinQuantity, getReadAvailabilityPath, getServiceClient, getWebClient, setServiceClient
-
-
-
-
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()
-
-