org.apache.jackrabbit.core.observation
Class ObservationManagerImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.observation.ObservationManagerImpl
All Implemented Interfaces:
ObservationManager, EventStateCollectionFactory

public class ObservationManagerImpl
extends Object
implements ObservationManager, EventStateCollectionFactory

Each Session instance has its own ObservationManager instance. The class SessionLocalObservationManager implements this behaviour.


Constructor Summary
ObservationManagerImpl(ObservationDispatcher dispatcher, SessionImpl session, ClusterNode clusterNode)
          Creates an ObservationManager instance.
 
Method Summary
 void addEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal)
          
 EventFilter createEventFilter(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal)
          Creates a new event filter with the given restrictions.
 EventStateCollection createEventStateCollection()
          Creates an EventStateCollection.
 void dispose()
          Unregisters all EventListeners.
 EventJournal getEventJournal()
          Returns an unfiltered event journal for this workspace.
 EventJournal getEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName)
          Returns the event journal for this workspace.
 EventListenerIterator getRegisteredEventListeners()
          
 void removeEventListener(EventListener listener)
          
 void setUserData(String userData)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservationManagerImpl

public ObservationManagerImpl(ObservationDispatcher dispatcher,
                              SessionImpl session,
                              ClusterNode clusterNode)
Creates an ObservationManager instance.

Parameters:
dispatcher - observation dispatcher
session - the Session this ObservationManager belongs to.
itemMgr - ItemManager of the passed Session.
Throws:
NullPointerException - if dispatcher, session or itemMgr is null.
Method Detail

addEventListener

public void addEventListener(EventListener listener,
                             int eventTypes,
                             String absPath,
                             boolean isDeep,
                             String[] uuid,
                             String[] nodeTypeName,
                             boolean noLocal)
                      throws RepositoryException

Specified by:
addEventListener in interface ObservationManager
Throws:
RepositoryException

removeEventListener

public void removeEventListener(EventListener listener)
                         throws RepositoryException

Specified by:
removeEventListener in interface ObservationManager
Throws:
RepositoryException

getRegisteredEventListeners

public EventListenerIterator getRegisteredEventListeners()
                                                  throws RepositoryException

Specified by:
getRegisteredEventListeners in interface ObservationManager
Throws:
RepositoryException

setUserData

public void setUserData(String userData)
                 throws RepositoryException

Specified by:
setUserData in interface ObservationManager
Throws:
RepositoryException

dispose

public void dispose()
Unregisters all EventListeners.


createEventFilter

public EventFilter createEventFilter(int eventTypes,
                                     String absPath,
                                     boolean isDeep,
                                     String[] uuid,
                                     String[] nodeTypeName,
                                     boolean noLocal)
                              throws RepositoryException
Creates a new event filter with the given restrictions.

Parameters:
eventTypes - A combination of one or more event type constants encoded as a bitmask.
absPath - an absolute path.
isDeep - a boolean.
uuid - array of UUIDs.
nodeTypeName - array of node type names.
noLocal - a boolean.
Returns:
the event filter with the given restrictions.
Throws:
RepositoryException - if an error occurs.

getEventJournal

public EventJournal getEventJournal(int eventTypes,
                                    String absPath,
                                    boolean isDeep,
                                    String[] uuid,
                                    String[] nodeTypeName)
                             throws RepositoryException
Returns the event journal for this workspace. The events are filtered according to the passed criteria.

Specified by:
getEventJournal in interface ObservationManager
Parameters:
eventTypes - A combination of one or more event type constants encoded as a bitmask.
absPath - an absolute path.
isDeep - a boolean.
uuid - array of UUIDs.
nodeTypeName - array of node type names.
Returns:
the event journal for this repository.
Throws:
UnsupportedRepositoryOperationException - if this repository does not support an event journal (cluster journal disabled).
RepositoryException - if another error occurs.
See Also:
ObservationManager.getEventJournal(int, String, boolean, String[], String[])

getEventJournal

public EventJournal getEventJournal()
                             throws RepositoryException
Returns an unfiltered event journal for this workspace.

Specified by:
getEventJournal in interface ObservationManager
Returns:
the event journal for this repository.
Throws:
UnsupportedRepositoryOperationException - if this repository does not support an event journal (cluster journal disabled).
RepositoryException - if another error occurs.

createEventStateCollection

public EventStateCollection createEventStateCollection()
Creates an EventStateCollection.

Creates an EventStateCollection tied to the session which is attached to this ObservationManager instance.

Specified by:
createEventStateCollection in interface EventStateCollectionFactory
Returns:
a new EventStateCollection


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.