Interface QueueProvider

  • All Superinterfaces:
    Distributable
    All Known Implementing Classes:
    AbstractQueueProvider, DefaultLocalQueueProvider

    public interface QueueProvider
    extends Distributable
    Component to provide access to a Queue, or specifically a ReindexQueue. This component also provides a mechanism to destroy a Queue. Implementations should keep track of a Queues that are in use. They should never create a Queue that is already in use. Therefore this component acts as a Queue registry.
    Author:
    Kelly Tisdell (ktisdell)
    • Method Detail

      • getOrCreateQueue

        <T> ReindexQueue<T> getOrCreateQueue​(com.broadleafcommerce.search.api.type.IndexableType type)
                                      throws com.broadleafcommerce.search.api.SearchIndexException
        Get the Queue for the given IndexableType. If the Queue does not exist yet, creates a new queue and registers it for the type.

        When creating a new Queue, the ReindexQueue.getQueueName() will be 'IndexableType.getType()'. For example, 'PRODUCT'.

        Parameters:
        type - the type to get or create the queue for
        Returns:
        the queue registered for the type
        Throws:
        com.broadleafcommerce.search.api.SearchIndexException - if an error occurs getting or creating the queue
      • destroyQueue

        void destroyQueue​(ReindexQueue<?> queue)
                   throws com.broadleafcommerce.search.api.SearchIndexException
        Takes the necessary steps to remove or destroy the Queue, if necessary. Otherwise, this will be a pass-through (e.g. when the Queue is in-memory and has no cleanup requirements).
        Parameters:
        queue - the queue to be destroyed
        Throws:
        com.broadleafcommerce.search.api.SearchIndexException - if an error occurs trying to destroy the queue