Public Member Functions | Data Fields

ilRPCServerAdapter Class Reference

Inheritance diagram for ilRPCServerAdapter:

Public Member Functions

 ilRPCServerAdapter ()
 setResponseTimeout ($a_response_timeout)
send ()
 Send message to remote rpc server and get response.
 __checkPear ()
 __initClient ()
 Create RPC client object.
 __initMessage ($a_message_name, $params)
 Create RPC message object.

Data Fields

 $response_timeout = RPC_TIMEOUT
 $log = null
 $db = null
 $err = null
 $settings_obj = null
 $rpc_client = null
 $rpc_message = null

Detailed Description

Definition at line 37 of file class.ilRPCServerAdapter.php.


Member Function Documentation

ilRPCServerAdapter::__checkPear (  ) 

Definition at line 90 of file class.ilRPCServerAdapter.php.

Referenced by ilRPCServerAdapter().

        {
                if(!include_once('XML/RPC.php'))
                {
                        $this->log->write('ilLuceneRPCAdapter(): Cannot find pear library XML_RPC. Aborting');
                        $this->err->raiseError("Cannot find pear package 'XML_RPC'. Aborting ",$this->err->MESSAGE);
                }
                return true;
        }

Here is the caller graph for this function:

ilRPCServerAdapter::__initClient (  ) 

Create RPC client object.

Settings are read from class RPCSServerSettings.

Returns:
boolean success

protected

Definition at line 107 of file class.ilRPCServerAdapter.php.

Referenced by ilFO2PDF::send(), and ilLuceneRPCAdapter::send().

        {
                include_once 'XML/RPC.php';

                $this->rpc_client =& new XML_RPC_Client($this->settings_obj->getPath(),
                                                                                                $this->settings_obj->getHost(),
                                                                                                $this->settings_obj->getPort());
                #$this->rpc_client->setDebug(1);

                return true;
        }

Here is the caller graph for this function:

ilRPCServerAdapter::__initMessage ( a_message_name,
params 
)

Create RPC message object.

Parameters:
string message name. Something like 'Indexer.ilFileIndexer'
array of objects. Array of XML_RPC_Value objects. (Params of remote procedures)
Returns:
boolean success

protected

Definition at line 129 of file class.ilRPCServerAdapter.php.

Referenced by ilLuceneRPCAdapter::__prepareFlushIndex(), ilFO2PDF::__prepareFO2PDFParams(), ilLuceneRPCAdapter::__prepareIndexFileParams(), ilLuceneRPCAdapter::__prepareIndexHTLMParams(), ilLuceneRPCAdapter::__preparePingParams(), and ilLuceneRPCAdapter::__prepareQueryParams().

        {
                include_once 'XML/RPC.php';
                
                $this->rpc_message =& new XML_RPC_Message($a_message_name,$params);
                
                // We create the payload here since it might be quite time consuming 
                // and this could cause a socket read exception on the server side.
                $this->rpc_message->createPayload();

                return true;
        }

Here is the caller graph for this function:

ilRPCServerAdapter::ilRPCServerAdapter (  ) 

Definition at line 49 of file class.ilRPCServerAdapter.php.

References $ilLog, and __checkPear().

Referenced by ilFO2PDF::ilFO2PDF(), and ilLuceneRPCAdapter::ilLuceneRPCAdapter().

        {
                global $ilLog,$ilDB,$ilError;

                $this->log =& $ilLog;
                $this->db =& $ilDB;
                $this->err =& $ilError;

                $this->__checkPear();

                $this->settings_obj =& new ilRPCServerSettings();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilRPCServerAdapter::send (  ) 

Send message to remote rpc server and get response.

Returns:
object result object. Type is depend on the calles method

protected

Reimplemented in ilLuceneRPCAdapter, and ilFO2PDF.

Definition at line 74 of file class.ilRPCServerAdapter.php.

        {
                include_once 'XML/RPC.php';
                if(!$response =& $this->rpc_client->send($this->rpc_message,$this->response_timeout))
                {
                        $this->log->write("ilRPCServerAdapter: Communication error");
                        return null;
                }
                if($response->faultCode())
                {
                        $this->log->write("ilRPCServerAdapter: Communication error: ". $response->faultString());
                        return null;
                }
                return XML_RPC_decode($response->value());
        }

ilRPCServerAdapter::setResponseTimeout ( a_response_timeout  ) 

Field Documentation

ilRPCServerAdapter::$db = null

Definition at line 41 of file class.ilRPCServerAdapter.php.

ilRPCServerAdapter::$err = null

Definition at line 42 of file class.ilRPCServerAdapter.php.

ilRPCServerAdapter::$log = null

Reimplemented in ilFO2PDF.

Definition at line 40 of file class.ilRPCServerAdapter.php.

ilRPCServerAdapter::$response_timeout = RPC_TIMEOUT

Definition at line 39 of file class.ilRPCServerAdapter.php.

ilRPCServerAdapter::$rpc_client = null

Definition at line 46 of file class.ilRPCServerAdapter.php.

ilRPCServerAdapter::$rpc_message = null

Definition at line 47 of file class.ilRPCServerAdapter.php.

ilRPCServerAdapter::$settings_obj = null

Definition at line 44 of file class.ilRPCServerAdapter.php.


The documentation for this class was generated from the following file: