Class IndexRebuildService

  • All Implemented Interfaces:
    org.osgi.framework.BundleActivator

    public class IndexRebuildService
    extends Object
    implements org.osgi.framework.BundleActivator
    The bundle activator is defined in the pom.xml of this bundle.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IndexRebuildService.Service
      The services whose data is indexed by ElasticSearch.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void rebuildIndex​(org.opencastproject.elasticsearch.index.AbstractSearchIndex index)
      Clear and rebuild the index from all services.
      void rebuildIndex​(org.opencastproject.elasticsearch.index.AbstractSearchIndex index, String serviceName)
      Partially rebuild the index from a specific service.
      void start​(org.osgi.framework.BundleContext bundleContext)
      Called by OSGI when this bundle is started.
      void stop​(org.osgi.framework.BundleContext bundleContext)
      Called by OSGI when this bundle is stopped.
    • Constructor Detail

      • IndexRebuildService

        public IndexRebuildService()
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext bundleContext)
                   throws Exception
        Called by OSGI when this bundle is started.
        Specified by:
        start in interface org.osgi.framework.BundleActivator
        Parameters:
        bundleContext - The bundle context.
        Throws:
        Exception
      • stop

        public void stop​(org.osgi.framework.BundleContext bundleContext)
                  throws Exception
        Called by OSGI when this bundle is stopped.
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
        Parameters:
        bundleContext - The bundle context.
        Throws:
        Exception
      • rebuildIndex

        public void rebuildIndex​(org.opencastproject.elasticsearch.index.AbstractSearchIndex index)
                          throws IOException,
                                 IndexRebuildException
        Clear and rebuild the index from all services.
        Parameters:
        index - The index to rebuild.
        Throws:
        IOException - Thrown if the index cannot be cleared.
        IndexRebuildException - Thrown if the index rebuild failed.