phpcr/src/PHPCR/Observation/ObservationManagerInterface.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    This file is part of the PHPCR API and was originally ported from the Java JCR API to PHP by Karsten Dambekalns for the FLOW3 project.

    Copyright 2008-2011 Karsten Dambekalns karsten@typo3.org

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0
    

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    License
    Apache Software License 2.0  
    Link
    http://phpcr.github.com/  

    \PHPCR\Observation\ObservationManagerInterface

    Package: Default
    The ObservationManager object.

    Acquired via WorkspaceInterface::getObservationManager(). Allows for the registration and deregistration of event listeners.

    The \Traversable interface enables the implementation to be addressed with foreach. ObservationManager has to implement either \IteratorAggregate or \Iterator. The iterator is equivalent to getRegisteredEventListeners() returning a list of all registered event listeners. The iterator keys have no significant meaning.

    Parent(s)
    \Traversable
    Api
     

    Methods

    methodpublicaddEventListener(\PHPCR\Observation\EventListenerInterface $listener, \PHPCR\Observation\EventFilterInterface $filter) : void

    Adds an event listener that listens for the events specified by the passed {@link EventFilterInterface}.

    In addition to the EventFilter, the set of events reported will be further filtered by the access rights of the current Session.

    See EventFilter for a description of the filtering parameters available.

    The filter 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 filter. The implementation must ensure that no events are lost during the changeover.

    In addition to the filters placed on a listener above, the scope of observation support, in terms of which parts of a workspace are observable, may also be subject to implementation-specific restrictions. For example, in some repositories observation of changes in the jcr:system subgraph may not be supported.

    Parameters
    NameTypeDescription
    $listener\PHPCR\Observation\EventListenerInterface
    $filter\PHPCR\Observation\EventFilterInterface
    Throws
    ExceptionDescription
    \PHPCR\RepositoryExceptionIf an error occurs.
    Details
    Api
     
    Since
    JCR 2.1  
    methodpubliccreateEventFilter() : \PHPCR\Observation\EventFilterInterface

    Creates an EventFilter that can then be configured and passed to the method addEventListener.

    Returns
    TypeDescription
    \PHPCR\Observation\EventFilterInterface
    Details
    Api
     
    Since
    JCR 2.1  
    methodpublicgetEventJournal(\PHPCR\Observation\EventFilterInterface $filter) : \PHPCR\Observation\EventJournalInterface

    Retrieves the event journal for this workspace.

    If journaled observation is not supported for this workspace, null is returned.

    Events returned in the EventJournal instance will be filtered according to the parameters set on the EventFilter that is passed to this method.

    Additionally, the current session's access restrictions as well as any additional restrictions specified through implementation-specific configuration will also affect the set of returned events.

    Parameters
    NameTypeDescription
    $filter\PHPCR\Observation\EventFilterInterface
    Returns
    TypeDescription
    \PHPCR\Observation\EventJournalInterfacean EventJournal (or null).
    Throws
    ExceptionDescription
    \PHPCR\RepositoryExceptionif an error occurs
    Details
    Api
     
    Since
    JCR 2.1  
    methodpublicgetRegisteredEventListeners() : \Iterator

    Returns all event listeners that have been registered through this session.

    If no listeners have been registered, an empty iterator is returned.

    Returns
    TypeDescription
    \Iteratorimplementing <b>SeekableIterator</b> and <b>Countable</b>. Values are the EventListenerInterface instances. Keys have no meaning.
    Throws
    ExceptionDescription
    \PHPCR\RepositoryExceptionif an error occurs
    Details
    Api
     
    methodpublicremoveEventListener(\PHPCR\Observation\EventListenerInterface $listener) : void

    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.

    Parameters
    NameTypeDescription
    $listener\PHPCR\Observation\EventListenerInterface

    The listener to deregister.

    Throws
    ExceptionDescription
    \PHPCR\RepositoryExceptionif an error occurs.
    Details
    Api
     
    methodpublicsetUserData(string $userData) : void

    Sets the user data information that will be returned by EventInterface::getUserData().

    Parameters
    NameTypeDescription
    $userDatastring

    the user data

    Throws
    ExceptionDescription
    \PHPCR\RepositoryExceptionif an error occurs
    Details
    Api
     
    Documentation was generated by phpDocumentor 2.0.0a12.