OpenMediaVault  0.6 (Kralizec)
The open network attached storage solution
 All Classes Functions Variables Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OMVJsonRpcProxy Class Reference
Inheritance diagram for OMVJsonRpcProxy:
OMVObject OMVDownloadRpcProxy OMVUploadRpcProxy

Public Member Functions

 handle ()
 
 cleanup ()
 
- Public Member Functions inherited from OMVObject
 __construct ()
 
 getLastError ()
 

Protected Member Functions

 getParams ()
 
 validate (&$errors)
 
 preExecute ()
 
 postExecute (&$response)
 
 handleResponse ($response)
 
- Protected Member Functions inherited from OMVObject
 setLastError ($error)
 
 debug ()
 

Protected Attributes

 $params = NULL
 
 $paramsSchema
 

Detailed Description

This file is part of OpenMediaVault.

License:
http://www.gnu.org/licenses/gpl.html GPL Version 3
Author
Volker Theile volke.nosp@m.r.th.nosp@m.eile@.nosp@m.open.nosp@m.media.nosp@m.vaul.nosp@m.t.org

OpenMediaVault is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

OpenMediaVault is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with OpenMediaVault. If not, see http://www.gnu.org/licenses/. The generic RPC proxy implementation that handles JSON RPC requests. A RPC request must contain the fields: service The name of the service. method The name of the method. params The method parameters as JSON string. options An optional array of RPC options with the fields: updatelastaccess Set to FALSE to do not update the time on which the last access took place.

Member Function Documentation

OMVJsonRpcProxy::cleanup ( )

The function that is called after the RPC has been successfully executed or it has been failed.

OMVJsonRpcProxy::getParams ( )
protected

Get the RPC parameters.

Returns
TRUE if successful, otherwise FALSE.
OMVJsonRpcProxy::handle ( )

Handle the RPC request.

Returns
The RPC response as JSON encoded data.
Exceptions
E_SESSION_TIMEOUT
E_RPC_GET_PARAMS_FAILED
E_RPC_INVALID_PARAMS
OMVJsonRpcProxy::handleResponse (   $response)
protected

Print the RPC responce.

Parameters
responseThe RPC response
Returns
None.
OMVJsonRpcProxy::postExecute ( $response)
protected

Do additional stuff after RPC has been executed.

Parameters
responseThe RPC response
Returns
None.
OMVJsonRpcProxy::preExecute ( )
protected

Do additional stuff before RPC is executed.

Returns
None.
OMVJsonRpcProxy::validate ( $errors)
protected

Validate the RPC parameters.

Parameters
errorsContains the error messages if validation fails.
Returns
TRUE if valid, otherwise FALSE.

Member Data Documentation

OMVJsonRpcProxy::$paramsSchema
protected
Initial value:
= '{
"type":"object",
"properties":{
"service":{"type":"string"},
"method":{"type":"string"},
"params":{"type":"any"},
"options":{"type":"object","optional":true}
}
}'

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