|
OpenMediaVault
0.6 (Kralizec)
The open network attached storage solution
|
Public Member Functions | |
| __construct ($name) | |
| getName () | |
| getListeners () | |
| addListener ($arg1, $arg2=null, $arg3=null, $arg4=20) | |
| notify ($type, $path) | |
| dumpListeners ($path="") | |
Public Member Functions inherited from OMVObject | |
| __construct () | |
| getLastError () | |
Static Public Member Functions | |
| static & | getInstance ($name="default") |
Additional Inherited Members | |
Protected Member Functions inherited from OMVObject | |
| 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/. OMVNotifyDispatcher is an configuration notification technology. It provides the possibility to simply monitor various events, e.g. on the configuration.
| OMVNotifyDispatcher::__construct | ( | $name | ) |
Constructor
| name | The name of the dispatcher. |
| OMVNotifyDispatcher::addListener | ( | $arg1, | |
$arg2 = null, |
|||
$arg3 = null, |
|||
$arg4 = 20 |
|||
| ) |
Add a listener to a given event message.
| arg1 | The event message type, e.g. OMV_NOTIFY_CREATE, OMV_NOTIFY_MODIFY, OMV_NOTIFY_PREDELETE, OMV_NOTIFY_DELETE or OMV_NOTIFY_MODIFY|OMV_NOTIFY_DELETE. |
| arg2 | The event message path that should be monitored, e.g. 'org.openmediavault.abc.xyz'. |
| arg3 | The callback function. |
| arg4 | The sequence number of the called function. Default is 20. If you want a function to be execute as the first one then set it to 1. |
| OMVNotifyDispatcher::dumpListeners | ( | $path = "" | ) |
Dump all registered listeners sorted by their event message path.
| path | The event message path that should be monitored. |
|
static |
Returns a dispatcher singleton.
| name | The name of the notification dispatcher. |
| OMVNotifyDispatcher::getListeners | ( | ) |
Returns all listeners.
| OMVNotifyDispatcher::getName | ( | ) |
Get the name of the dispatcher. The name is the unique identifier of a dispatcher.
| OMVNotifyDispatcher::notify | ( | $type, | |
| $path | |||
| ) |
Notify all registered listeners.
| type | The event message type that should be announced, e.g. OMV_NOTIFY_CREATE, OMV_NOTIFY_MODIFY, OMV_NOTIFY_PREDELETE, OMV_NOTIFY_DELETE or OMV_NOTIFY_MODIFY|OMV_NOTIFY_DELETE. |
| path | The event message path, e.g. 'org.openmediavault.abc.xyz'. |
| argX | The parameters to be passed. |
1.8.6