示例#1
0
 /**
  * @var StorageProfile $storage
  * @var FileSync $fileSync
  */
 public function setJobData(StorageProfile $storage, FileSync $filesync)
 {
     $this->setServerUrl($storage->getStorageUrl());
     $this->setServerUsername($storage->getStorageUsername());
     $this->setServerPassword($storage->getStoragePassword());
     $this->setServerPrivateKey($storage->getPrivateKey());
     $this->setServerPublicKey($storage->getPublicKey());
     $this->setServerPassPhrase($storage->getPassPhrase());
     $this->setFtpPassiveMode($storage->getStorageFtpPassiveMode());
     $this->setSrcFileSyncId($filesync->getId());
     $this->setDestFileSyncStoredPath($storage->getStorageBaseDir() . '/' . $filesync->getFilePath());
 }
示例#2
0
 public function setStorageExportJobData(StorageProfile $externalStorage, FileSync $fileSync, $srcFileSyncLocalPath, $force = false)
 {
     $this->setServerUrl($externalStorage->getStorageUrl());
     $this->setServerUsername($externalStorage->getStorageUsername());
     $this->setServerPassword($externalStorage->getStoragePassword());
     $this->setServerPrivateKey($externalStorage->getPrivateKey());
     $this->setServerPublicKey($externalStorage->getPublicKey());
     $this->setServerPassPhrase($externalStorage->getPassPhrase());
     $this->setFtpPassiveMode($externalStorage->getStorageFtpPassiveMode());
     $this->setSrcFileSyncLocalPath($srcFileSyncLocalPath);
     $this->setSrcFileSyncId($fileSync->getId());
     $this->setForce($force);
     $this->setDestFileSyncStoredPath($externalStorage->getStorageBaseDir() . '/' . $fileSync->getFilePath());
     $this->setCreateLink($externalStorage->getCreateFileLink());
 }
 public static function addStorageDeleteJob(BatchJob $parentJob = null, $entryId = null, StorageProfile $storage, FileSync $fileSync)
 {
     $netStorageDeleteData = new kStorageDeleteJobData();
     $netStorageDeleteData->setServerUrl($storage->getStorageUrl());
     $netStorageDeleteData->setServerUsername($storage->getStorageUsername());
     $netStorageDeleteData->setServerPassword($storage->getStoragePassword());
     $netStorageDeleteData->setFtpPassiveMode($storage->getStorageFtpPassiveMode());
     $netStorageDeleteData->setSrcFileSyncId($fileSync->getId());
     $netStorageDeleteData->setDestFileSyncStoredPath($storage->getStorageBaseDir() . '/' . $fileSync->getFilePath());
     if ($parentJob) {
         $batchJob = $parentJob->createChild(false);
     } else {
         $batchJob = new BatchJob();
         $batchJob->setEntryId($entryId);
         $batchJob->setPartnerId($storage->getPartnerId());
     }
     KalturaLog::log("Creating Net-Storage Delete job, with source file: " . $netStorageDeleteData->getSrcFileSyncLocalPath());
     return self::addJob($batchJob, $netStorageDeleteData, BatchJobType::STORAGE_DELETE, $storage->getProtocol());
 }
示例#4
0
 /**
  * @param BatchJob $parentJob
  * @param string $entryId
  * @param int $partnerId
  * @param StorageProfile $externalStorage
  * @param SyncFile $fileSync
  * @param string $srcFileSyncLocalPath
  * @param bool $force
  * 
  * @return BatchJob
  */
 public static function addStorageExportJob(BatchJob $parentJob = null, $entryId, $partnerId, StorageProfile $externalStorage, FileSync $fileSync, $srcFileSyncLocalPath, $force = false)
 {
     KalturaLog::log(__METHOD__ . " entryId[{$entryId}], partnerId[{$partnerId}], externalStorage id[" . $externalStorage->getId() . "], fileSync id[" . $fileSync->getId() . "], srcFileSyncLocalPath[{$srcFileSyncLocalPath}]");
     $netStorageExportData = new kStorageExportJobData();
     $netStorageExportData->setServerUrl($externalStorage->getStorageUrl());
     $netStorageExportData->setServerUsername($externalStorage->getStorageUsername());
     $netStorageExportData->setServerPassword($externalStorage->getStoragePassword());
     $netStorageExportData->setFtpPassiveMode($externalStorage->getStorageFtpPassiveMode());
     $netStorageExportData->setSrcFileSyncLocalPath($srcFileSyncLocalPath);
     $netStorageExportData->setSrcFileSyncId($fileSync->getId());
     $netStorageExportData->setForce($force);
     $netStorageExportData->setDestFileSyncStoredPath($externalStorage->getStorageBaseDir() . '/' . $fileSync->getFilePath());
     $batchJob = null;
     if ($parentJob) {
         $batchJob = $parentJob->createChild(false);
     } else {
         $batchJob = new BatchJob();
         $batchJob->setEntryId($entryId);
         $batchJob->setPartnerId($partnerId);
     }
     KalturaLog::log("Creating Storage export job, with source file: " . $netStorageExportData->getSrcFileSyncLocalPath());
     return self::addJob($batchJob, $netStorageExportData, BatchJobType::STORAGE_EXPORT, $externalStorage->getProtocol());
 }