WSJobsManagerClass.php 1.35 KB
<?php
/**
 * @class WSJobsManagerClass
 * @brief Jobs manager
 * @details
 */
class WSJobsManagerClass extends IHMJobsManagerClass {

	protected $jobXml, $jobXmlName;

	protected $bkgRootNode = array(WSConfigClass::PLOT => 'bkgPlotRootNode',
			WSConfigClass::PARAMETER => 'bkgParamRootNode',
			WSConfigClass::ORBIT => 'bkgOrbRootNode',
			WSConfigClass::DATASET => 'bkgDatasetRootNode');

	protected $resRootNode = array(WSConfigClass::PLOT => 'resPlotRootNode',
			WSConfigClass::PARAMETER => 'resParamRootNode',
			WSConfigClass::ORBIT => 'resOrbRootNode',
			WSConfigClass::DATASET => 'resDatasetRootNode');

	/*
	 * @brief Constructor
	*/
	function __construct()
	{
		$this->isWSJob = TRUE;
	}

	protected function getJobsFilePath()
        {
                return WSConfigClass::getWsJobsFile();
        }

	protected function sendErrorNotification($message) {
		error_log("WebServices Error : ".$message);
		error_log("WebServices Error : ".$message, email);
	}

	/*
	 * @brief Get job key
	 */
	protected function getJobKey($obj)
	{
		return WSInputOutputClass::getService();
	}
	
	public function getResultFromProcessId($id)
	{
		$res = $this->init();
		$job = $this->jobXml->getElementById($id);
		
		if (!$job)
			return array('success' => false, 'message' => "Job not reachable"); 
		
		return array('success' => true, 'result' => $job->getAttribute('result')); 
	}
}
?>