<?php
namespace Claromentis\Admin\Sysadmin\UseCase;

$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] ?: array()) + array();
use Claromentis\Admin\Sysadmin\ServiceStatus;
use Claromentis\Search\DaemonControl;
use Claromentis\Search\Exception\SearchConfigException;
class GetIndexingStatus
{
    
    
    
    
    private $daemon_control;
    public function __construct(DaemonControl $daemon_control)
    {
        $this->daemon_control = $daemon_control;
    }
    public function GetSummaryStatus(string $config_version)
    {
        if (!$this->daemon_control->GetStatus()) {
            return ServiceStatus::ERROR;
        }
        try {
            $this->daemon_control->CheckVersionMatches($config_version);
        } catch (SearchConfigException $_fe441aa3ef350bfb1a1a1ad8520dd530) {
            return ServiceStatus::ERROR;
        }
        return ServiceStatus::OK;
    }
}