public function __construct(Git_RemoteServer_GerritServer $server, $is_used)
 {
     $this->id = $server->getId();
     $this->host = $server->getHost();
     $this->http_port = $server->getHTTPPort();
     $this->ssh_port = $server->getSSHPort();
     $this->replication_key = $server->getReplicationKey();
     $this->use_ssl = $server->usesSSL();
     $this->login = $server->getLogin();
     $this->identity_file = $server->getIdentityFile();
     $this->use_gerrit_2_5 = $server->getGerritVersion() === Git_RemoteServer_GerritServer::DEFAULT_GERRIT_VERSION;
     $this->use_gerrit_2_8 = $server->getGerritVersion() !== Git_RemoteServer_GerritServer::DEFAULT_GERRIT_VERSION;
     $this->is_used = $is_used;
     $this->http_password = $server->getHTTPPassword();
 }
 public function queueGerritReplicationKeyUpdate(Git_RemoteServer_GerritServer $server)
 {
     $this->system_event_manager->createEvent(SystemEvent_GIT_GERRIT_ADMIN_KEY_DUMP::NAME, $server->getId(), SystemEvent::PRIORITY_HIGH, SystemEvent::OWNER_APP);
 }
 /**
  *
  * @param Git_RemoteServer_GerritServer $server
  * @return bool
  */
 public function isServerUsed(Git_RemoteServer_GerritServer $server)
 {
     return $this->git_dao->isRemoteServerUsed($server->getId());
 }
Ejemplo n.º 4
0
 private function doesRemoteGerritProjectNeedDeleting(Git_RemoteServer_GerritServer $server)
 {
     if ($server->getId() != $this->repository->getRemoteServerId()) {
         return false;
     }
     if (!$this->repository->wasPreviouslyMigratedButNotDeleted()) {
         return false;
     }
     $driver = $this->getGerritDriverForRepository($this->repository);
     $project_name = $driver->getGerritProjectName($this->repository);
     try {
         if (!$driver->doesTheProjectExist($server, $project_name)) {
             return false;
         }
     } catch (Git_Driver_Gerrit_Exception $e) {
         return false;
     }
     return true;
 }
Ejemplo n.º 5
0
 private function cacheGroupDefinitionForServer(Git_RemoteServer_GerritServer $server)
 {
     if (!isset($this->cache_groups[$server->getId()])) {
         $this->cache_groups[$server->getId()] = $this->driver_factory->getDriver($server)->getAllGroups($server);
     }
 }