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

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 ()
 

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/. OMVNotifyDispatcher is an configuration notification technology. It provides the possibility to simply monitor various events, e.g. on the configuration.

Constructor & Destructor Documentation

OMVNotifyDispatcher::__construct (   $name)

Constructor

Parameters
nameThe name of the dispatcher.

Member Function Documentation

OMVNotifyDispatcher::addListener (   $arg1,
  $arg2 = null,
  $arg3 = null,
  $arg4 = 20 
)

Add a listener to a given event message.

Parameters
arg1The event message type, e.g. OMV_NOTIFY_CREATE, OMV_NOTIFY_MODIFY, OMV_NOTIFY_PREDELETE, OMV_NOTIFY_DELETE or OMV_NOTIFY_MODIFY|OMV_NOTIFY_DELETE.
arg2The event message path that should be monitored, e.g. 'org.openmediavault.abc.xyz'.
arg3The callback function.
arg4The 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.

Parameters
pathThe event message path that should be monitored.
static& OMVNotifyDispatcher::getInstance (   $name = "default")
static

Returns a dispatcher singleton.

Parameters
nameThe name of the notification dispatcher.
Returns
The dispatcher object.
OMVNotifyDispatcher::getListeners ( )

Returns all listeners.

Returns
An array of listeners.
OMVNotifyDispatcher::getName ( )

Get the name of the dispatcher. The name is the unique identifier of a dispatcher.

Returns
The name of the dispatcher.
OMVNotifyDispatcher::notify (   $type,
  $path 
)

Notify all registered listeners.

Parameters
typeThe 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.
pathThe event message path, e.g. 'org.openmediavault.abc.xyz'.
argXThe parameters to be passed.

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