* Allows for the registration and deregistration of event listeners. * * @author Markus Nix * @package phpcr * @subpackage observation */ interface ObservationManager { /** * Adds an event listener that listens for the specified eventTypes (a combination of one or more * event types encoded as a bit mask value). *

* The set of events can be filtered by specifying restrictions based on characteristics of the node associated * with the event. In the case of event types NODE_ADDED and NODE_REMOVED, the node * associated with an event is the node at (or formerly at) the path returned by Event.getPath. * In the case of event types PROPERTY_ADDED, PROPERTY_REMOVED and * PROPERTY_CHANGED, the node associated with an event is the parent node of the property at * (or formerly at) the path returned by Event.getPath: *

* The restrictions are "ANDed" together. In other words, for a particular node to be "listened to" it must meet all the restrictions. *

* Additionally, if noLocal is true, then events generated by the session through which * the listener was registered are ignored. Otherwise, they are not ignored. *

* The filters of an already-registered EventListener can be changed at runtime by re-registering the * same EventListener object (i.e. the same actual Java object) with a new set of filter arguments. * The implementation must ensure that no events are lost during the changeover. * * @param listener an {@link EventListener} object. * @param eventTypes A combination of one or more event type constants encoded as a bitmask. * @param absPath an absolute path. * @param isDeep a boolean. * @param uuid array of UUIDs. * @param nodeTypeName array of node type names. * @param noLocal a boolean. * @throws RepositoryException If an error occurs. */ public function addEventListener( EventListener $listener, $eventTypes, $absPath, $isDeep, $uuid, $nodeTypeName, $noLocal ); /** * Deregisters an event listener. *

* A listener may be deregistered while it is being executed. The * deregistration method will block until the listener has completed * executing. An exception to this rule is a listener which deregisters * itself from within the onEvent method. In this case, the * deregistration method returns immediately, but deregistration will * effectively be delayed until the listener completes. * * @param listener The listener to deregister. * * @throws RepositoryException If an error occurs. */ public function removeEventListener( EventListener $listener ); /** * Returns all event listeners that have been registered through this session. * If no listeners have been registered, an empty iterator is returned. * * @return an EventListenerIterator. * @throws RepositoryException */ public function getRegisteredEventListeners(); } ?>