/**
  * batch updateExclusiveFileSyncImportJob action updates a BatchJob of type FILESYNC_IMPORT that was claimed using the getExclusiveFileSyncImportJobs
  * 
  * @action updateExclusiveFileSyncImportJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveFileSyncImportJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     // verifies that the job is of the right type
     if ($dbBatchJob->getJobType() != KalturaBatchJobType::FILESYNC_IMPORT) {
         throw new KalturaAPIException(APIErrors::UPDATE_EXCLUSIVE_JOB_WRONG_TYPE, $id, serialize($lockKey), serialize($job));
     }
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
Пример #2
0
 /**
  * batch updateExclusiveVirusScanJob action updates a BatchJob of type VIRUS_SCAN that was claimed using the getExclusiveVirusScanJobs
  * 
  * @action updateExclusiveVirusScanJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveVirusScanJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     // verifies that the job is of the right type
     $jobType = VirusScanPlugin::getBatchJobTypeCoreValue(VirusScanBatchJobType::VIRUS_SCAN);
     if ($dbBatchJob->getJobType() != $jobType) {
         throw new KalturaAPIException(APIErrors::UPDATE_EXCLUSIVE_JOB_WRONG_TYPE, $id, serialize($lockKey), serialize($job));
     }
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
 /**
  * batch updateExclusiveDistributionFetchReportJob action updates a BatchJob of type DISTRIBUTION_FETCH_REPORT that was claimed using the getExclusiveDistributionFetchReportJobs
  * 
  * @action updateExclusiveDistributionFetchReportJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveDistributionFetchReportJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     // verifies that the job is of the right type
     $jobType = ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_FETCH_REPORT);
     if ($dbBatchJob->getJobType() != $jobType) {
         throw new KalturaAPIException(APIErrors::UPDATE_EXCLUSIVE_JOB_WRONG_TYPE, $id, serialize($lockKey), serialize($job));
     }
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
 /**
  * batch updateExclusiveJobAction action updates a BatchJob of extended type that was claimed using the getExclusiveJobs
  * 
  * @action updateExclusiveJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }