HCE Project PHP language client API bindings OOP style  1.1.1
Hierarchical Cluster Engine PHP Client Interface API OOP style
 All Classes Namespaces Files Functions Variables Pages
HCE\transport\Request Class Reference

Public Member Functions

 setConnection ($connection=null)
 getConnection ()
 setMessageId ($messageId)
 getMessageId ()
 setMessageBody ($messageBody)
 getMessageBody ()
 setErrorCode ($errorCode)
 getErrorCode ()
 __construct ($connection=null)
 __destruct ()
 execute ($msgBody=NULL, $timeout=null)
 messageSend ($fields_array)

Protected Member Functions

 messageReceive ($timeout=PROTOCOL_MSG_RESPONSE_TIMEOUT_DEFAULT)

Protected Attributes

 $connection = NULL
 $messageId = NULL
 $messageBody = NULL
 $timeout = PROTOCOL_MSG_RESPONSE_TIMEOUT_DEFAULT
 $error = 0

Detailed Description

HCE Request class implements basic functionality of client-side of HCE Cluster Node application interaction

Definition at line 24 of file Request.inc.php.

Constructor & Destructor Documentation

HCE\transport\Request::__construct (   $connection = null)

create instance and set the HCE connection

Parameters
$connection- connection object

Definition at line 147 of file Request.inc.php.

Here is the call graph for this function:

HCE\transport\Request::__destruct ( )

delete HCE connection (disconnect zmq socket, free zmq socket and context)

Definition at line 161 of file Request.inc.php.

Member Function Documentation

HCE\transport\Request::execute (   $msgBody = NULL,
  $timeout = null 
)

Execute request and returns response object instance

Parameters
$msgBody- command message body to send
$timeout- timeout value of response
Returns
Response object

Definition at line 176 of file Request.inc.php.

HCE\transport\Request::getConnection ( )

Returns connection object

Returns
connection object

Definition at line 70 of file Request.inc.php.

HCE\transport\Request::getErrorCode ( )

Returns erro code of last executed request

Returns
error code

Definition at line 136 of file Request.inc.php.

HCE\transport\Request::getMessageBody ( )

Returns message body

Returns
message body

Definition at line 116 of file Request.inc.php.

HCE\transport\Request::getMessageId ( )

Returns message Id

Returns
message Id

Definition at line 96 of file Request.inc.php.

HCE\transport\Request::messageReceive (   $timeout = PROTOCOL_MSG_RESPONSE_TIMEOUT_DEFAULT)
protected

receive HCE connection message

Parameters
$timeout- receive timeout, msec
Returns
HCE responses array or PROTOCOL_ERROR_TIMEOUT - if timeout reached

Definition at line 268 of file Request.inc.php.

HCE\transport\Request::messageSend (   $fields_array)

send HCE connection message

Parameters
$fields_array- array of message fields 'id' and 'body'
Returns
HCE message fields array or error PROTOCOL_ERROR_FIELDS_NOT_SET - fields array not set proper way

Definition at line 236 of file Request.inc.php.

HCE\transport\Request::setConnection (   $connection = null)

Set connection

Parameters
$connection- connection object, if omitted or null, new admin localhost connection object created

Definition at line 57 of file Request.inc.php.

HCE\transport\Request::setErrorCode (   $errorCode)

Set error code

Parameters
$errorCode- error code

Definition at line 127 of file Request.inc.php.

HCE\transport\Request::setMessageBody (   $messageBody)

Set message body

Parameters
$messageBody- message body

Definition at line 107 of file Request.inc.php.

HCE\transport\Request::setMessageId (   $messageId)

Set message Id

Parameters
$messageId- message unique Id
Returns
boolean : true if Id is not empty and false in opposite

Definition at line 82 of file Request.inc.php.

Member Data Documentation

HCE\transport\Request::$connection = NULL
protected

Connection object

Definition at line 28 of file Request.inc.php.

HCE\transport\Request::$error = 0
protected

Request error code of last operation result

Definition at line 48 of file Request.inc.php.

HCE\transport\Request::$messageBody = NULL
protected

Request body

Definition at line 38 of file Request.inc.php.

HCE\transport\Request::$messageId = NULL
protected

Request message Id

Definition at line 33 of file Request.inc.php.

HCE\transport\Request::$timeout = PROTOCOL_MSG_RESPONSE_TIMEOUT_DEFAULT
protected

Request timeout ms

Definition at line 43 of file Request.inc.php.


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