ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjSearchRpcClientCoordinator.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
24 {
25  protected ilSetting $settings;
26  protected ilLogger $src_logger;
27 
28  public function __construct(
29  ilSetting $settings,
30  ilLogger $src_logger
31  ) {
32  $this->settings = $settings;
33  $this->src_logger = $src_logger;
34  }
35 
36  public function refreshLuceneSettings(): bool
37  {
38  try {
39  $this->getRpcClient()->refreshSettings(
40  $this->getClientId() .
41  '_' .
42  $this->settings->get('inst_id', '0')
43  );
44  return true;
45  } catch (Exception $exception) {
46  $this->src_logger->error(
47  'Refresh of lucene server settings failed with message: ' .
48  $exception->getMessage()
49  );
50  throw $exception;
51  }
52  }
53 
54  protected function getRpcClient(): ilRpcClient
55  {
56  return ilRpcClientFactory::factory('RPCAdministration');
57  }
58 
59  protected function getClientId(): string
60  {
61  return (string) CLIENT_ID;
62  }
63 }
static factory(string $a_package, int $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
Class ilRpcClient.
const CLIENT_ID
Definition: constants.php:41
__construct(ilSetting $settings, ilLogger $src_logger)