OpenMediaVault
0.6 (Kralizec)
The open network attached storage solution
|
Public Member Functions | |
getName () | |
initialize () | |
hasMethod ($name) | |
callMethod ($name, $params, $context) | |
callMethodBg ($name, $params, $context) | |
![]() | |
__construct () | |
getLastError () | |
Protected Member Functions | |
registerMethod ($rpcName, $methodName=NULL) | |
registerMethodSequence ($service, $method, $method2) | |
validateMethodParams ($params, $schema) | |
validateMethodContext ($context, $required) | |
getAdminContext () | |
fork () | |
createBgProcStatus () | |
createBgProcOutput ($prefix="bgoutput") | |
writeBgProcOutput ($filename, $content) | |
initializeBgProcStatus ($filename, $pid) | |
finalizeBgProcStatus ($filename, $result=NULL, $exception=NULL) | |
updateBgProcStatus ($filename, $key, $value) | |
getBgProcStatus ($filename) | |
unlinkBgProcStatus ($filename) | |
exec ($command, &$output=NULL, $outputFilename=NULL) | |
execve ($path, $args=NULL, $outputFilename=NULL) | |
applyFilter ($array, $start, $limit, $sortField=NULL, $sortDir=NULL) | |
deleteConfigObjectByPath ($xpath, $message) | |
setModuleDirty ($name) | |
isModuleDirty ($name) | |
![]() | |
setLastError ($error) | |
debug () | |
This file is part of OpenMediaVault.
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 core RPC service class.
|
finalprotected |
Helper function to filter the method result using the given filter arguments.
array | The array of objects to filter. |
start | The index where to start. |
limit | The number of elements to process. |
sortField | The name of the column used to sort. |
sortDir | The sort direction, ASC or DESC. |
|
final |
Call the given RPC service method. Registered method hooks will be called after the origin method has been successfully called.
name | The name of the method. |
params | The method parameters. |
context | The context of the caller. |
E_RPC_SERVICE_METHOD_NOT_EXISTS |
|
final |
Call the given RPC service method in a background process. Registered method hooks will be called after the origin method has been successfully called.
name | The name of the method. |
params | The method parameters. |
context | The context of the caller. |
E_RPC_SERVICE_METHOD_NOT_EXISTS |
|
finalprotected |
Helper function to create the file containing the background process output.
E_MISC_FAILURE |
|
finalprotected |
Helper function to create the file containing the background process status.
E_MISC_FAILURE |
|
protected |
Helper function to delete an configuration object matching the given XPath expression. The notification types OMV_NOTIFY_PREDELETE and OMV_NOTIFY_DELETE will be submitted to its subscribers.
xpath | The XPath expression of the object to delete. |
message | The message of the notification to be submitted. |
E_CONFIG_GET_OBJECT_FAILED | |
E_CONFIG_OBJECT_NOT_FOUND |
|
finalprotected |
Helper function to execute an external program. The command output will be redirected to the given file if set.
command | The command that will be executed. |
output | If the output argument is present, then the specified array will be filled with every line of the command output from stdout. Trailing whitespace, such as , is not included in this array. |
outputFilename | The name of the file that receives the command output from stdout. If set to NULL the command output will not be redirected to a file. |
|
finalprotected |
Helper function to executes specified program in current process space.
path | The path to a binary executable or a script with a valid path pointing to an executable in the shebang as the first line. |
args | An array of argument strings passed to the program. |
outputFilename | The name of the file that receives the command output from STDOUT. STDERR will be redirected to this file, too. If set to NULL the command output will not be redirected to a file. |
|
finalprotected |
Helper function to finalize the background process status file.
filename | The name of the status file. |
result | The result of the background process, e.g. the output of an executed command. Defaults to NULL. |
exception | The exception that has been thrown. Defaults to NULL. |
E_MISC_FAILURE |
|
finalprotected |
Helper function to fork the current running process.
E_MISC_FAILURE |
|
finalprotected |
Helper function to get the administrator context.
|
finalprotected |
Helper function to get the background process status file content.
filename | The name of the status file. |
|
abstract |
Get the name of the RPC service.
|
final |
Check if the given service method exists.
|
abstract |
Initialize the RPC service.
|
finalprotected |
Helper function to update the background process status file.
filename | The name of the status file. |
pid | The PID of the background process. |
E_MISC_FAILURE |
|
finalprotected |
Helper function to check whether a module is marked dirty.
name | The name of the module. |
|
finalprotected |
Register a RPC service method. Only those methods can be executed via RPC.
rpcName | The name of the RPC service method. |
methodName | The name of the class method that implements the RPC sevice method. If set to NULL the name given in rpcName is used. Defaults to NULL. |
E_RPC_SERVICE_METHOD_NOT_EXISTS |
|
finalprotected |
Create a combined RPC service method call sequence of the original method and the passed method. The passed method is called with the parameters of the original RPC service method.
service | The name of the RPC service. |
method | The name of the original RPC service method. |
method2 | The name of the method that should be called after the original RPC service method. |
E_RPC_SERVICE_NOT_FOUND | |
E_RPC_SERVICE_METHOD_NOT_EXISTS |
|
finalprotected |
Helper function to mark a module as dirty.
name | The name of the module. |
|
finalprotected |
Helper function to unlink the background process status file.
filename | The name of the status file. |
|
finalprotected |
Helper function to update informations of the background process status file.
filename | The name of the status file. |
key | The name of the field to be modified. |
value | The new value of the field. |
|
finalprotected |
Helper function to validate the method caller context.
context | The caller context to be validated. |
required | The required context. |
E_RPC_SERVICE_METHOD_INVALID_CONTEXT |
|
finalprotected |
Helper function to validate the given method parameters using JSON schema.
params | The parameters to be validated. |
schema | The JSON schema that describes the method parameters. Can be given as UTF-8 encoded JSON or an associative array. |
E_RPC_SERVICE_METHOD_INVALID_PARAMS |
|
finalprotected |
Helper function to write a string to the background process output.
filename | Path to the file where to write the content. |
content | The content to write. |