/** * @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, $dc = null) { KalturaLog::debug("entryId[{$entryId}], partnerId[{$partnerId}], externalStorage id[" . $externalStorage->getId() . "], fileSync id[" . $fileSync->getId() . "], srcFileSyncLocalPath[{$srcFileSyncLocalPath}]"); $netStorageExportData = kStorageExportJobData::getInstance($externalStorage->getProtocol()); $netStorageExportData->setStorageExportJobData($externalStorage, $fileSync, $srcFileSyncLocalPath); $batchJob = null; if ($parentJob) { $batchJob = $parentJob->createChild(BatchJobType::STORAGE_EXPORT, $externalStorage->getProtocol(), false); } else { $batchJob = new BatchJob(); $batchJob->setEntryId($entryId); $batchJob->setPartnerId($partnerId); } $batchJob->setObjectId($fileSync->getId()); $batchJob->setObjectType(BatchJobObjectType::FILE_SYNC); $batchJob->setJobSubType($externalStorage->getProtocol()); $batchJob->setDc($dc); KalturaLog::log("Creating Storage export job, with source file: " . $netStorageExportData->getSrcFileSyncLocalPath()); return self::addJob($batchJob, $netStorageExportData, BatchJobType::STORAGE_EXPORT, $externalStorage->getProtocol()); }