WSInputOutputClass.php 2.03 KB
<?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 WSConfigClass::PARAMETER :
					case WSConfigClass::DATASET :
					case WSConfigClass::ORBIT :
						$this->inputOutput = new WSInputOutputParamsDownloadClass();
						break;
					case WSConfigClass::PLOT :
						$this->inputOutput = new WSInputOutputParamsPlotClass();
						break;
					default :
						throw new Exception('Service'.self::$service.' not implemented yet');
				}
				break;
			case FunctionTypeEnumClass::PROCESSDELETE :
				$this->inputOutput = new WSInputOutputDeleteProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSRUNNINGINFO :
				$this->inputOutput = new IHMInputOutputRunningInfoProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSGETINFO :
				$this->inputOutput = new WSInputOutputGetInfoProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSCLEAN :
				$this->inputOutput = new IHMInputOutputCleanProcessClass();
				break;
			case FunctionTypeEnumClass::PROCESSGETREQUEST :
				$this->inputOutput = new IHMInputOutputGetProcessRequestClass();
				break;
			case FunctionTypeEnumClass::TTCONVERT :
				$this->inputOutput = new WSInputOutputTTClass();
				break;
			default :
				throw new Exception('Request type '.$function.' not implemented for this client.');
		}

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

}

?>