本文整理汇总了PHP中BatchJob::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP BatchJob::getStatus方法的具体用法?PHP BatchJob::getStatus怎么用?PHP BatchJob::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BatchJob
的用法示例。
在下文中一共展示了BatchJob::getStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: abortDbBatchJob
public static function abortDbBatchJob(BatchJob $dbBatchJob, $force = false)
{
// No need to abort finished job
if (in_array($dbBatchJob->getStatus(), BatchJobPeer::getClosedStatusList())) {
if ($force) {
$dbBatchJob->setExecutionStatus(BatchJobExecutionStatus::ABORTED);
$dbBatchJob->save();
}
return $dbBatchJob;
}
$lockObject = $dbBatchJob->getBatchJobLock();
if (is_null($lockObject)) {
KalturaLog::err("Batch job [" . $dbBatchJob->getId() . "] doesn't have a lock object and can't be deleted. Status (" . $dbBatchJob->getStatus() . ")");
return $dbBatchJob;
}
// Update status
$con = Propel::getConnection();
$update = new Criteria();
$update->add(BatchJobLockPeer::STATUS, BatchJob::BATCHJOB_STATUS_ABORTED);
$update->add(BatchJobLockPeer::VERSION, $lockObject->getVersion() + 1);
$updateCondition = new Criteria();
$updateCondition->add(BatchJobLockPeer::ID, $lockObject->getId(), Criteria::EQUAL);
$updateCondition->add(BatchJobLockPeer::VERSION, $lockObject->getVersion(), Criteria::EQUAL);
$updateCondition->add(BatchJobLockPeer::SCHEDULER_ID, null, Criteria::ISNULL);
$affectedRows = BasePeer::doUpdate($updateCondition, $update, $con);
if ($affectedRows) {
$dbBatchJob->setExecutionStatus(BatchJobExecutionStatus::ABORTED);
$dbBatchJob = self::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_ABORTED);
} else {
$dbBatchJob->setExecutionStatus(BatchJobExecutionStatus::ABORTED);
$dbBatchJob->save();
}
self::abortChildJobs($dbBatchJob);
return $dbBatchJob;
}
示例2: doConsume
/**
* @param kBatchJobStatusEventConsumer $consumer
* @return bool true if should continue to the next consumer
*/
protected function doConsume(KalturaEventConsumer $consumer)
{
if (!$consumer->shouldConsumeJobStatusEvent($this->dbBatchJob)) {
return true;
}
KalturaLog::debug(get_class($this) . " event consumed by " . get_class($consumer) . " job id [" . $this->dbBatchJob->getId() . "] type [" . $this->dbBatchJob->getJobType() . "] sub type [" . $this->dbBatchJob->getJobSubType() . "] status [" . $this->dbBatchJob->getStatus() . "]");
return $consumer->updatedJob($this->dbBatchJob, $this->twinJob);
}
示例3: updatedJob
public function updatedJob(BatchJob $dbBatchJob)
{
$data = $dbBatchJob->getData();
$providerData = $data->getProviderData();
$entryId = $providerData->getEntryId();
$partnerId = $dbBatchJob->getPartnerId();
$spokenLanguage = $providerData->getSpokenLanguage();
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_DONT_PROCESS) {
$transcript = $this->getAssetsByLanguage($entryId, array(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT)), $spokenLanguage, true);
if (!$transcript) {
$transcript = new TranscriptAsset();
$transcript->setType(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT));
$transcript->setEntryId($entryId);
$transcript->setPartnerId($partnerId);
$transcript->setLanguage($spokenLanguage);
$transcript->setContainerFormat(AttachmentType::TEXT);
$transcript->setAccuracy(self::DEFAULT_ACCURACY);
}
$transcript->setStatus(AttachmentAsset::ASSET_STATUS_QUEUED);
$transcript->save();
return true;
}
$formatsString = $providerData->getCaptionAssetFormats();
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED) {
$clientHelper = VoicebasePlugin::getClientHelper($providerData->getApiKey(), $providerData->getApiPassword());
$externalEntryExists = $clientHelper->checkExistingExternalContent($entryId);
if (!$externalEntryExists) {
KalturaLog::err('remote content does not exist');
return true;
}
$formatsArray = explode(',', $formatsString);
$formatsArray[] = "TXT";
$contentsArray = $clientHelper->getRemoteTranscripts($entryId, $formatsArray);
KalturaLog::debug('contents are - ' . print_r($contentsArray, true));
$transcript = $this->getAssetsByLanguage($entryId, array(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT)), $spokenLanguage, true);
$captions = $this->getAssetsByLanguage($entryId, array(CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION)), $spokenLanguage);
$this->setObjectContent($transcript, $contentsArray["TXT"], null, true);
unset($contentsArray["TXT"]);
foreach ($contentsArray as $format => $content) {
$captionFormatConst = constant("KalturaCaptionType::" . $format);
if (isset($captions[$captionFormatConst])) {
$caption = $captions[$captionFormatConst];
} else {
$caption = new CaptionAsset();
$caption->setEntryId($entryId);
$caption->setPartnerId($partnerId);
$caption->setLanguage($spokenLanguage);
$caption->setContainerFormat($captionFormatConst);
$caption->setAccuracy(self::DEFAULT_ACCURACY);
$caption->setStatus(CaptionAsset::ASSET_STATUS_QUEUED);
$caption->save();
}
$this->setObjectContent($caption, $content, $format);
}
}
return true;
}
示例4: doConsume
protected function doConsume(KalturaEventConsumer $consumer)
{
if (!$consumer->shouldConsumeIntegrationCloseEvent($this->object, $this->modifiedColumns)) {
return true;
}
KalturaLog::debug('consumer [' . get_class($consumer) . '] started handling [' . get_class($this) . '] batch-job id [' . $this->batchJob->getId() . '] status [' . $this->batchJob->getStatus() . ']');
$result = $consumer->integrationJobClosed($this->batchJob);
KalturaLog::debug('consumer [' . get_class($consumer) . '] finished handling [' . get_class($this) . '] batch-job id [' . $this->batchJob->getId() . '] status [' . $this->batchJob->getStatus() . ']');
return $result;
}
示例5: doConsume
/**
* @param kBatchJobStatusEventConsumer $consumer
* @return bool true if should continue to the next consumer
*/
protected function doConsume(KalturaEventConsumer $consumer)
{
if (!$consumer->shouldConsumeJobStatusEvent($this->dbBatchJob)) {
return true;
}
KalturaLog::debug('consumer [' . get_class($consumer) . '] started handling [' . get_class($this) . '] job id [' . $this->dbBatchJob->getId() . '] type [' . $this->dbBatchJob->getJobType() . '] sub type [' . $this->dbBatchJob->getJobSubType() . '] status [' . $this->dbBatchJob->getStatus() . ']');
$result = $consumer->updatedJob($this->dbBatchJob);
KalturaLog::debug('consumer [' . get_class($consumer) . '] finished handling [' . get_class($this) . '] job id [' . $this->dbBatchJob->getId() . '] type [' . $this->dbBatchJob->getJobType() . '] sub type [' . $this->dbBatchJob->getJobSubType() . '] status [' . $this->dbBatchJob->getStatus() . ']');
return $result;
}
示例6: shouldConsumeJobStatusEvent
public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
{
if ($dbBatchJob->getJobType() == IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION) && $dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_DONT_PROCESS && $dbBatchJob->getData()->getTriggerType() == BpmEventNotificationIntegrationPlugin::getIntegrationTriggerCoreValue(BpmEventNotificationIntegrationTrigger::BPM_EVENT_NOTIFICATION)) {
return true;
}
return false;
}
示例7: updatedJob
public function updatedJob(BatchJob $dbBatchJob, BatchJob $twinJob = null)
{
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED) {
return self::onDistributionJobFinished($dbBatchJob);
}
return true;
}
示例8: shouldConsumeJobStatusEvent
public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
{
if ($dbBatchJob->getJobType() != IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION)) {
return false;
}
$closedStatusList = array(BatchJob::BATCHJOB_STATUS_FINISHED, BatchJob::BATCHJOB_STATUS_FAILED, BatchJob::BATCHJOB_STATUS_ABORTED, BatchJob::BATCHJOB_STATUS_FATAL, BatchJob::BATCHJOB_STATUS_FINISHED_PARTIALLY);
return in_array($dbBatchJob->getStatus(), $closedStatusList);
}
示例9: onDistributionJobUpdated
/**
* @param BatchJob $dbBatchJob
* @param kDistributionJobData $data
* @param BatchJob $twinJob
* @return BatchJob
*/
public static function onDistributionJobUpdated(BatchJob $dbBatchJob, kDistributionJobData $data, BatchJob $twinJob = null)
{
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_ALMOST_DONE:
return self::onDistributionJobUpdatedAlmostDone($dbBatchJob, $data, $twinJob);
default:
return $dbBatchJob;
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:kYouTubeDistributionEventConsumer.php
示例10: onDistributionJobUpdated
/**
* @param BatchJob $dbBatchJob
* @param kDistributionJobData $data
* @return BatchJob
*/
public static function onDistributionJobUpdated(BatchJob $dbBatchJob, kDistributionJobData $data)
{
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_FINISHED:
return self::onDistributionJobFinished($dbBatchJob, $data);
default:
return $dbBatchJob;
}
}
示例11: shouldConsumeJobStatusEvent
public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
{
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FAILED) {
$parseMultiBatchJobType = CaptionPlugin::getBatchJobTypeCoreValue(ParseMultiLanguageCaptionAssetBatchType::PARSE_MULTI_LANGUAGE_CAPTION_ASSET);
if ($dbBatchJob->getJobType() == $parseMultiBatchJobType) {
return true;
}
}
return false;
}
示例12: updatedJob
/**
* @param BatchJob $dbBatchJob
* @return bool true if should continue to the next consumer
*/
public function updatedJob(BatchJob $dbBatchJob)
{
$data = $dbBatchJob->getData();
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_FINISHED:
return self::handleJobFinished($dbBatchJob, $data);
default:
return $dbBatchJob;
}
}
示例13: updatedImport
protected function updatedImport(BatchJob $dbBatchJob, kDropFolderImportJobData $data, BatchJob $twinJob = null)
{
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_FINISHED:
return $this->updatedImportFinished($dbBatchJob, $data, $twinJob);
case BatchJob::BATCHJOB_STATUS_FAILED:
case BatchJob::BATCHJOB_STATUS_FATAL:
return $this->updatedImportFailed($dbBatchJob, $data, $twinJob);
default:
return $dbBatchJob;
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:kDropFolderEventsConsumer.php
示例14: shouldConsumeJobStatusEvent
public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
{
if ($dbBatchJob->getJobType() != EventNotificationPlugin::getBatchJobTypeCoreValue(EventNotificationBatchType::EVENT_NOTIFICATION_HANDLER)) {
return false;
}
if ($dbBatchJob->getJobSubType() != BusinessProcessNotificationPlugin::getBusinessProcessNotificationTemplateTypeCoreValue(BusinessProcessNotificationTemplateType::BPM_START)) {
return false;
}
if ($dbBatchJob->getStatus() != BatchJob::BATCHJOB_STATUS_FINISHED) {
return false;
}
return true;
}
示例15: updatedTransformMetadata
protected function updatedTransformMetadata(BatchJob $dbBatchJob, kTransformMetadataJobData $data, BatchJob $twinJob = null)
{
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_PENDING:
return $this->updatedTransformMetadataPending($dbBatchJob, $data, $twinJob);
case BatchJob::BATCHJOB_STATUS_FINISHED:
return $this->updatedTransformMetadataFinished($dbBatchJob, $data, $twinJob);
case BatchJob::BATCHJOB_STATUS_FAILED:
case BatchJob::BATCHJOB_STATUS_FATAL:
return $this->updatedTransformMetadataFailed($dbBatchJob, $data, $twinJob);
default:
return $dbBatchJob;
}
}