Class AbstractIndexProducer

  • All Implemented Interfaces:
    IndexProducer

    public abstract class AbstractIndexProducer
    extends Object
    implements IndexProducer
    This implementation of IndexProducer adds logging methods for convenience.
    • Constructor Detail

      • AbstractIndexProducer

        public AbstractIndexProducer()
    • Method Detail

      • logIndexRebuildBegin

        protected void logIndexRebuildBegin​(org.slf4j.Logger logger,
                                            String indexName,
                                            int total,
                                            String elementName)
        Log beginning of index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        elementName - The elements to be added (e.g. 'events').
      • logIndexRebuildBegin

        protected void logIndexRebuildBegin​(org.slf4j.Logger logger,
                                            String indexName,
                                            int total,
                                            String elementName,
                                            org.opencastproject.security.api.Organization org)
        Log beginning of index rebuild for this service and a specific organization.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        elementName - The elements to be added (e.g. 'events').
        org - The organization.
      • logIndexRebuildProgress

        protected void logIndexRebuildProgress​(org.slf4j.Logger logger,
                                               String indexName,
                                               int total,
                                               int current)
        Log the progress of the index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        current - The amount of elements that have already been re-added.
      • logIndexRebuildProgress

        protected void logIndexRebuildProgress​(org.slf4j.Logger logger,
                                               String indexName,
                                               int total,
                                               int current,
                                               org.opencastproject.security.api.Organization org)
        Log the progress of the index rebuild for this service and a specific organization.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        current - The amount of elements that have already been re-added.
        org - The organization.
      • logIndexRebuildProgress

        protected void logIndexRebuildProgress​(org.slf4j.Logger logger,
                                               String indexName,
                                               int total,
                                               int current,
                                               int batchSize)
        Log the progress of the index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        current - The amount of elements that have already been re-added.
        batchSize - The size of the batch we re-add in one go.
      • logIndexRebuildProgress

        protected void logIndexRebuildProgress​(org.slf4j.Logger logger,
                                               String indexName,
                                               int total,
                                               int current,
                                               int batchSize,
                                               org.opencastproject.security.api.Organization org)
        Log the progress of the index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        current - The amount of elements that have already been re-added.
        batchSize - The size of the batch we re-add in one go.
        org - The organization (can be null).
      • logSkippingElement

        protected void logSkippingElement​(org.slf4j.Logger logger,
                                          String elementName,
                                          String element,
                                          Throwable t)
        Log an error when one element can't be re-indexed.
        Parameters:
        logger - An slf4j logger to preserve the context.
        elementName - The name of the element that can't be added (e.g. 'event').
        element - The element that can't be added.
        t - The error that occurred.
      • logSkippingElement

        protected void logSkippingElement​(org.slf4j.Logger logger,
                                          String elementName,
                                          String element,
                                          org.opencastproject.security.api.Organization org,
                                          Throwable t)
        Log an error when one element can't be re-indexed.
        Parameters:
        logger - An slf4j logger to preserve the context.
        elementName - The name of the element that can't be added (e.g. 'event').
        element - The element that can't be added.
        t - The error that occurred.
        org - The organization.
      • logIndexRebuildError

        protected void logIndexRebuildError​(org.slf4j.Logger logger,
                                            String indexName,
                                            Throwable t)
        Log an error during an index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        t - The error that occurred.
      • logIndexRebuildError

        protected void logIndexRebuildError​(org.slf4j.Logger logger,
                                            String indexName,
                                            int total,
                                            int current,
                                            Throwable t)
        Log an error during an index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        total - The total amount of elements to be re-added.
        current - The amount of elements that have already been re-added.
        t - The error that occurred.
      • logIndexRebuildError

        protected void logIndexRebuildError​(org.slf4j.Logger logger,
                                            String indexName,
                                            Throwable t,
                                            org.opencastproject.security.api.Organization org)
        Log an error during an index rebuild for this service.
        Parameters:
        logger - An slf4j logger to preserve the context.
        indexName - The name of the index that's being rebuild.
        t - The error that occurred.
        org - The organization.