Class SolrIndexStatusServiceImpl

java.lang.Object
org.broadleafcommerce.core.search.service.solr.index.SolrIndexStatusServiceImpl
All Implemented Interfaces:
SolrIndexStatusService

@Service("blSolrIndexStatusService") public class SolrIndexStatusServiceImpl extends Object implements SolrIndexStatusService
Author:
Jeff Fischer
  • Field Details

    • providers

      protected List<SolrIndexStatusProvider> providers
    • solrIndexStatusErrorRetryCount

      @Value("${solr.index.status.error.retry.count:3}") protected Integer solrIndexStatusErrorRetryCount
  • Constructor Details

    • SolrIndexStatusServiceImpl

      public SolrIndexStatusServiceImpl()
  • Method Details

    • addIndexStatus

      public void addIndexStatus(Long eventId, Date eventCreatedDate)
      Description copied from interface: SolrIndexStatusService
      Adds a new IndexStatusInfo given the eventId and the create date
      Specified by:
      addIndexStatus in interface SolrIndexStatusService
    • getIndexStatus

      public IndexStatusInfo getIndexStatus()
      Description copied from interface: SolrIndexStatusService
      Returns a populated IndexStatusInfo instance from the provider(s)
      Specified by:
      getIndexStatus in interface SolrIndexStatusService
      Returns:
      the index status information
    • setIndexStatus

      public void setIndexStatus(IndexStatusInfo status)
      Description copied from interface: SolrIndexStatusService
      Adds an IndexStatusInfo entry into the status providers
      Specified by:
      setIndexStatus in interface SolrIndexStatusService
    • addIndexErrorStatus

      public void addIndexErrorStatus(Long eventId, Integer eventRetryCount, Date eventCreatedDate)
      Will add a new IndexError entry if one does not exist. If one exists, it will increment the retry count. If the retry count is exceeded, it will move the event to the dead events list and treat the event as if it were successful
      Specified by:
      addIndexErrorStatus in interface SolrIndexStatusService
      Parameters:
      eventId - The id of the event producing the error
      eventRetryCount - The retry count as defined by the event
      eventCreatedDate - The date that the event was created
    • getSeedStatusInstance

      public IndexStatusInfo getSeedStatusInstance()
      Description copied from interface: SolrIndexStatusService
      Provide a custom IndexStatusInfo instance to be used by the system.
      Specified by:
      getSeedStatusInstance in interface SolrIndexStatusService
      Returns:
    • updateIndexStatus

      protected void updateIndexStatus(IndexStatusInfo status)
      Performs the actual update process with the list of providers
      Parameters:
      status -
    • clearErrorStatus

      protected void clearErrorStatus(IndexStatusInfo status)
      Removes an existing error status entry. The assumption is that an entry had an error condition and subsequently succeeded. Upon success, the current error entry should be removed.
      Parameters:
      status -
    • isEventIdInError

      protected List<Long> isEventIdInError(Collection<String> additionalInfoIds, IndexStatusInfo persistedStatus)
      Determines which passed InfoIds already exist in the persisted statuses from the provider(s)
      Parameters:
      additionalInfoIds -
      persistedStatus -
      Returns: