Class ObservationManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.core.observation.ObservationManagerImpl
-
- All Implemented Interfaces:
ObservationManager,JackrabbitObservationManager,EventStateCollectionFactory
public class ObservationManagerImpl extends Object implements EventStateCollectionFactory, JackrabbitObservationManager
EachSessioninstance has its ownObservationManagerinstance. The classSessionLocalObservationManagerimplements this behaviour.
-
-
Constructor Summary
Constructors Constructor Description ObservationManagerImpl(ObservationDispatcher dispatcher, SessionImpl session, ClusterNode clusterNode)Creates anObservationManagerinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal)voidaddEventListener(EventListener listener, JackrabbitEventFilter filter)EventFiltercreateEventFilter(int eventTypes, List<String> absPaths, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal, boolean noExternal, boolean noInternal)Creates a new event filter with the given restrictions.EventStateCollectioncreateEventStateCollection()Creates anEventStateCollection.voiddispose()Unregisters all EventListeners.EventJournalgetEventJournal()Returns an unfiltered event journal for this workspace.EventJournalgetEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName)Returns the event journal for this workspace.EventListenerIteratorgetRegisteredEventListeners()voidremoveEventListener(EventListener listener)voidsetUserData(String userData)
-
-
-
Constructor Detail
-
ObservationManagerImpl
public ObservationManagerImpl(ObservationDispatcher dispatcher, SessionImpl session, ClusterNode clusterNode)
Creates anObservationManagerinstance.- Parameters:
dispatcher- observation dispatchersession- theSessionthis ObservationManager belongs to.clusterNode-- Throws:
NullPointerException- ifdispatcher,sessionorclusterNodeisnull.
-
-
Method Detail
-
addEventListener
public void addEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException
- Specified by:
addEventListenerin interfaceObservationManager- Throws:
RepositoryException
-
addEventListener
public void addEventListener(EventListener listener, JackrabbitEventFilter filter) throws RepositoryException
- Specified by:
addEventListenerin interfaceJackrabbitObservationManager- Throws:
RepositoryException
-
removeEventListener
public void removeEventListener(EventListener listener) throws RepositoryException
- Specified by:
removeEventListenerin interfaceObservationManager- Throws:
RepositoryException
-
getRegisteredEventListeners
public EventListenerIterator getRegisteredEventListeners() throws RepositoryException
- Specified by:
getRegisteredEventListenersin interfaceObservationManager- Throws:
RepositoryException
-
setUserData
public void setUserData(String userData) throws RepositoryException
- Specified by:
setUserDatain interfaceObservationManager- Throws:
RepositoryException
-
dispose
public void dispose()
Unregisters all EventListeners.
-
createEventFilter
public EventFilter createEventFilter(int eventTypes, List<String> absPaths, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal, boolean noExternal, boolean noInternal) 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.absPaths- absolute paths.isDeep- aboolean.uuid- array of UUIDs.nodeTypeName- array of node type names.noLocal- aboolean.noExternal- aboolean.noInternal- aboolean.- 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:
getEventJournalin interfaceObservationManager- Parameters:
eventTypes- A combination of one or more event type constants encoded as a bitmask.absPath- an absolute path.isDeep- aboolean.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:
getEventJournalin interfaceObservationManager- 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 anEventStateCollection.Creates an
EventStateCollectiontied to the session which is attached to thisObservationManagerinstance.- Specified by:
createEventStateCollectionin interfaceEventStateCollectionFactory- Returns:
- a new
EventStateCollection
-
-