WSInputOutputClass.php 1.93 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 '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 :
				$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 IHMInputOutputTTClass();
				break;
			default :
				throw new Exception('Request type '.$function.' not implemented for this client.');
		}

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

}

?>