content: /*
   * This library is part of OpenCms -
   * the Open Source Content Management System
   *
   * Copyright (c) Alkacon Software GmbH & Co. KG (https://www.alkacon.com)
   *
   * This library is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
   * This library is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * For further information about Alkacon Software, please see the
   * company website: https://www.alkacon.com
   *
   * For further information about OpenCms, please see the
   * project website: https://www.opencms.org
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this library; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
  package org.opencms.ui.apps.userdata;
  
  import org.opencms.file.CmsObject;
  import org.opencms.report.A_CmsReportThread;
  import org.opencms.report.I_CmsReport;
  
  import java.util.function.Consumer;
  
  /**
   * Report thread for searching user data.
   */
  public class CmsUserDataReportThread extends A_CmsReportThread {
  
      /** The action to execute. */
      private Consumer<I_CmsReport> m_action;
  
      /**
       * Creates a new instance.
       *
       * @param cms the CMS context
       * @param action the action to execute
       */
      public CmsUserDataReportThread(CmsObject cms, Consumer<I_CmsReport> action) {
  
          super(cms, "userData");
          m_action = action;
          initHtmlReport(cms.getRequestContext().getLocale());
      }
  
      /**
       * @see org.opencms.report.A_CmsReportThread#getReportUpdate()
       */
      @Override
      public String getReportUpdate() {
  
          return getReport().getReportUpdate();
      }
  
      /**
       * @see java.lang.Thread#run()
       */
      @Override
      public void run() {
  
          I_CmsReport report = getReport();
          m_action.accept(report);
  
      }
  
  }
  