Blame view

src/InputOutput/WSImpl/WSInputOutputClass.php 1.93 KB
d5a86709   Elena.Budnik   interim commit
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
<?php

/**
 * @class WSInputOutputClass
 * @brief Class that's implement an InputOutputInterface for WebServices client. This class inherits from IHMInputOutputClass.
 * @details
 */
class  WSInputOutputClass extends IHMInputOutputClass
{
	/*
	 * @brief translate input data from WebServices request to AMDA_Integration module
	*/
	public static  $service;
	
	public static function setService($service)
	{
		self::$service = $service;	
	}
	
	public static function getService()
	{
		return self::$service;	
	}
	
	public function getInputData($input,$function,$requestId = "")
	{
		switch ($function)
		{
			case FunctionTypeEnumClass::PARAMS :
				switch (self::$service)
				{
					case 'download' :
						$this->inputOutput = new WSInputOutputParamsDownloadClass();
						break;
					case 'plot' :
						$this->inputOutput = new WSInputOutputParamsPlotClass();
						break;
					default :
						throw new Exception('Service'.self::$service.' not implemented yet');
				}
				break;
			case FunctionTypeEnumClass::PROCESSDELETE :
				$this->inputOutput = new IHMInputOutputDeleteProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSRUNNINGINFO :
				$this->inputOutput = new IHMInputOutputRunningInfoProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSGETINFO :
8b8f98e3   Elena.Budnik   getStatus fixed
49
				$this->inputOutput = new WSInputOutputGetInfoProcessClass();
d5a86709   Elena.Budnik   interim commit
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
				break;
			case FunctionTypeEnumClass::PROCESSCLEAN :
				$this->inputOutput = new IHMInputOutputCleanProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSGETREQUEST :
				$this->inputOutput = new IHMInputOutputGetProcessRequestClass();
				break;
			case FunctionTypeEnumClass::TTCONVERT :
				$this->inputOutput = new IHMInputOutputTTClass();
				break;
			default :
				throw new Exception('Request type '.$function.' not implemented for this client.');
		}

		return $this->inputOutput->getInputData($input,$function,$requestId);
	}

}

?>