Blame view

src/InputOutput/WSImpl/Tools/WSJobsManagerClass.php 1.35 KB
d5a86709   Elena.Budnik   interim commit
1
2
3
4
5
6
7
8
9
10
<?php
/**
 * @class WSJobsManagerClass
 * @brief Jobs manager
 * @details
 */
class WSJobsManagerClass extends IHMJobsManagerClass {

	protected $jobXml, $jobXmlName;

60dcc38e   Elena.Budnik   getParameter (sim...
11
12
13
14
	protected $bkgRootNode = array(WSConfigClass::PLOT => 'bkgPlotRootNode',
			WSConfigClass::PARAMETER => 'bkgParamRootNode',
			WSConfigClass::ORBIT => 'bkgOrbRootNode',
			WSConfigClass::DATASET => 'bkgDatasetRootNode');
d5a86709   Elena.Budnik   interim commit
15

60dcc38e   Elena.Budnik   getParameter (sim...
16
17
18
	protected $resRootNode = array(WSConfigClass::PLOT => 'resPlotRootNode',
			WSConfigClass::PARAMETER => 'resParamRootNode',
			WSConfigClass::ORBIT => 'resOrbRootNode',
73e42b04   Elena.Budnik   bug in ID
19
			WSConfigClass::DATASET => 'resDatasetRootNode');
d5a86709   Elena.Budnik   interim commit
20
21
22
23
24
25

	/*
	 * @brief Constructor
	*/
	function __construct()
	{
131e60ff   Benjamin Renard   Implement real co...
26
		$this->isWSJob = TRUE;
d5a86709   Elena.Budnik   interim commit
27
28
	}

131e60ff   Benjamin Renard   Implement real co...
29
30
31
32
	protected function getJobsFilePath()
        {
                return WSConfigClass::getWsJobsFile();
        }
d5a86709   Elena.Budnik   interim commit
33

131e60ff   Benjamin Renard   Implement real co...
34
35
36
	protected function sendErrorNotification($message) {
		error_log("WebServices Error : ".$message);
		error_log("WebServices Error : ".$message, email);
d5a86709   Elena.Budnik   interim commit
37
38
	}

1346266d   Elena.Budnik   interin commit
39
	/*
131e60ff   Benjamin Renard   Implement real co...
40
41
42
	 * @brief Get job key
	 */
	protected function getJobKey($obj)
1346266d   Elena.Budnik   interin commit
43
	{
131e60ff   Benjamin Renard   Implement real co...
44
		return WSInputOutputClass::getService();
1346266d   Elena.Budnik   interin commit
45
46
	}
	
dc2aed18   Elena.Budnik   getUrlFinishedJob
47
48
49
50
51
52
53
54
55
56
	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')); 
	}
d5a86709   Elena.Budnik   interim commit
57
58
}
?>