Blame view

src/InputOutput/WSImpl/WSInputOutputClass.php 2.09 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
<?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)
				{
60dcc38e   Elena.Budnik   getParameter (sim...
32
33
34
					case WSConfigClass::PARAMETER :
					case WSConfigClass::DATASET :
					case WSConfigClass::ORBIT :
d5a86709   Elena.Budnik   interim commit
35
36
						$this->inputOutput = new WSInputOutputParamsDownloadClass();
						break;
60dcc38e   Elena.Budnik   getParameter (sim...
37
					case WSConfigClass::PLOT :
d5a86709   Elena.Budnik   interim commit
38
39
40
41
42
43
44
						$this->inputOutput = new WSInputOutputParamsPlotClass();
						break;
					default :
						throw new Exception('Service'.self::$service.' not implemented yet');
				}
				break;
			case FunctionTypeEnumClass::PROCESSDELETE :
1346266d   Elena.Budnik   interin commit
45
				$this->inputOutput = new WSInputOutputDeleteProcessClass();
d5a86709   Elena.Budnik   interim commit
46
47
48
49
50
				break;
			case FunctionTypeEnumClass::PROCESSRUNNINGINFO :
				$this->inputOutput = new IHMInputOutputRunningInfoProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSGETINFO :
8b8f98e3   Elena.Budnik   getStatus fixed
51
				$this->inputOutput = new WSInputOutputGetInfoProcessClass();
d5a86709   Elena.Budnik   interim commit
52
53
54
55
56
57
58
				break;
			case FunctionTypeEnumClass::PROCESSCLEAN :
				$this->inputOutput = new IHMInputOutputCleanProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSGETREQUEST :
				$this->inputOutput = new IHMInputOutputGetProcessRequestClass();
				break;
738745d3   Elena.Budnik   draft for Web Ser...
59
			//TODO actually this is done by WebServer xslt transformation
d5a86709   Elena.Budnik   interim commit
60
			case FunctionTypeEnumClass::TTCONVERT :
738745d3   Elena.Budnik   draft for Web Ser...
61
				$this->inputOutput = new WSInputOutputTTClass();
d5a86709   Elena.Budnik   interim commit
62
63
64
65
66
67
68
69
70
71
72
				break;
			default :
				throw new Exception('Request type '.$function.' not implemented for this client.');
		}

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

}

?>