ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLuceneRPCAdapter Class Reference
+ Inheritance diagram for ilLuceneRPCAdapter:
+ Collaboration diagram for ilLuceneRPCAdapter:

Public Member Functions

 ilLuceneRPCAdapter ()
 setMode ($a_mode)
 getMode ()
 setFiles (&$files)
getFiles ()
 setHTLMs (&$htlms)
getHTLMs ()
 setQueryString ($a_str)
 getQueryString ()
 setSearchFilter ($a_filter)
 getSearchFilter ()
 __getClientId ()
 Create a unique client id.
 send ()
 Send message to remote rpc server and get response.
 __prepareQueryParams ()
 __preparePingParams ()
 __prepareIndexFileParams ()
 __prepareIndexHTLMParams ()
 __prepareFlushIndex ()
- Public Member Functions inherited from ilRPCServerAdapter
 ilRPCServerAdapter ()
 setResponseTimeout ($a_response_timeout)
 __checkPear ()
 __initClient ()
 Create RPC client object.
 __initMessage ($a_message_name, $params)
 Create RPC message object.

Data Fields

 $mode = ''
 $files = array()
 $query_str = ''
 $filter = ''
- Data Fields inherited from ilRPCServerAdapter
 $response_timeout = RPC_TIMEOUT
 $log = null
 $db = null
 $err = null
 $settings_obj = null
 $rpc_client = null
 $rpc_message = null

Detailed Description

Definition at line 35 of file class.ilLuceneRPCAdapter.php.

Member Function Documentation

ilLuceneRPCAdapter::__getClientId ( )

Create a unique client id.

Since the lucene index can be used from multiple ILIAS-Installations it must be unique over installations

Returns
string client_identifier

Definition at line 96 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareFlushIndex(), __prepareIndexFileParams(), __prepareIndexHTLMParams(), __preparePingParams(), and __prepareQueryParams().

{
global $ilias;
// TODO: handle problem if nic_key isn't set
return $ilias->getSetting('nic_key').'_'.CLIENT_ID;
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareFlushIndex ( )

Definition at line 190 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$this->__initMessage('Indexer.ilClearIndex',array(new XML_RPC_Value($this->__getClientId(),"string")));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareIndexFileParams ( )

Definition at line 162 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), getFiles(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
foreach($this->getFiles() as $obj_id => $fname)
{
$struct[$obj_id] = new XML_RPC_Value($fname,"string");
}
$params = array(new XML_RPC_Value($this->__getClientId(),"string"),
new XML_RPC_Value($struct,"struct"));
$this->__initMessage('Indexer.ilFileIndexer',$params);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareIndexHTLMParams ( )

Definition at line 177 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), getHTLMs(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
foreach($this->getHTLMs() as $obj_id => $fname)
{
$struct[$obj_id] = new XML_RPC_Value($fname,"string");
}
$this->__initMessage('Indexer.ilHTLMIndexer',array(new XML_RPC_Value($this->__getClientId(),"string"),
new XML_RPC_Value($struct,"struct")));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__preparePingParams ( )

Definition at line 154 of file class.ilLuceneRPCAdapter.php.

References __getClientId(), ilRPCServerAdapter\__initMessage(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$this->__initMessage('Searcher.ilPing',array(new XML_RPC_Value($this->__getClientId(),"string")));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::__prepareQueryParams ( )

Definition at line 139 of file class.ilLuceneRPCAdapter.php.

References $filter, __getClientId(), ilRPCServerAdapter\__initMessage(), getQueryString(), getSearchFilter(), and ilRPCServerAdapter\setResponseTimeout().

Referenced by send().

{
$this->setResponseTimeout(5);
$filter = array();
foreach($this->getSearchFilter() as $obj_type)
{
$filter[] = new XML_RPC_Value($obj_type,'string');
}
$this->__initMessage('Searcher.ilSearch',array(new XML_RPC_Value($this->__getClientId(),"string"),
new XML_RPC_Value($this->getQueryString(),"string"),
new XML_RPC_Value($filter,'array')));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilLuceneRPCAdapter::getFiles ( )

Definition at line 60 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareIndexFileParams().

{
return $this->files ? $this->files : array();
}

+ Here is the caller graph for this function:

& ilLuceneRPCAdapter::getHTLMs ( )

Definition at line 68 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareIndexHTLMParams().

{
return $this->htlms;
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getMode ( )

Definition at line 52 of file class.ilLuceneRPCAdapter.php.

References $mode.

Referenced by send().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getQueryString ( )

Definition at line 77 of file class.ilLuceneRPCAdapter.php.

References $query_str.

Referenced by __prepareQueryParams().

{
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::getSearchFilter ( )

Definition at line 86 of file class.ilLuceneRPCAdapter.php.

Referenced by __prepareQueryParams().

{
return $this->filter ? $this->filter : array();
}

+ Here is the caller graph for this function:

ilLuceneRPCAdapter::ilLuceneRPCAdapter ( )

Definition at line 43 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\ilRPCServerAdapter().

+ Here is the call graph for this function:

ilLuceneRPCAdapter::send ( )

Send message to remote rpc server and get response.

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

protected

Reimplemented from ilRPCServerAdapter.

Definition at line 106 of file class.ilLuceneRPCAdapter.php.

References ilRPCServerAdapter\__initClient(), __prepareFlushIndex(), __prepareIndexFileParams(), __prepareIndexHTLMParams(), __preparePingParams(), __prepareQueryParams(), and getMode().

{
$this->__initClient();
switch($this->getMode())
{
case 'ping':
break;
case 'file':
break;
case 'query':
break;
case 'htlm':
break;
case 'flush':
break;
default:
$this->log->write('ilLuceneRPCHandler(): No valid mode given');
return false;
}
return parent::send();
}

+ Here is the call graph for this function:

ilLuceneRPCAdapter::setFiles ( $files)

Definition at line 56 of file class.ilLuceneRPCAdapter.php.

References $files.

{
$this->files =& $files;
}
ilLuceneRPCAdapter::setHTLMs ( $htlms)

Definition at line 64 of file class.ilLuceneRPCAdapter.php.

{
$this->htlms = $htlms;
}
ilLuceneRPCAdapter::setMode (   $a_mode)

Definition at line 48 of file class.ilLuceneRPCAdapter.php.

{
$this->mode = $a_mode;
}
ilLuceneRPCAdapter::setQueryString (   $a_str)

Definition at line 73 of file class.ilLuceneRPCAdapter.php.

{
$this->query_str = $a_str;
}
ilLuceneRPCAdapter::setSearchFilter (   $a_filter)

Definition at line 82 of file class.ilLuceneRPCAdapter.php.

{
$this->filter = $a_filter;
}

Field Documentation

ilLuceneRPCAdapter::$files = array()

Definition at line 38 of file class.ilLuceneRPCAdapter.php.

Referenced by setFiles().

ilLuceneRPCAdapter::$filter = ''

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

Referenced by __prepareQueryParams().

ilLuceneRPCAdapter::$mode = ''

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

Referenced by getMode().

ilLuceneRPCAdapter::$query_str = ''

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

Referenced by getQueryString().


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