WSJobsManagerClass.php
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?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'));
}
}
?>