Class ObservationManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.observation.ObservationManagerImpl
-
- All Implemented Interfaces:
ObservationManager,JackrabbitObservationManager
public class ObservationManagerImpl extends Object implements JackrabbitObservationManager
-
-
Field Summary
Fields Modifier and Type Field Description static MarkerOBSERVATION
-
Constructor Summary
Constructors Constructor Description ObservationManagerImpl(SessionContext sessionContext, ReadOnlyNodeTypeManager nodeTypeManager, Whiteboard whiteboard, int queueLength, CommitRateLimiter commitRateLimiter)Create a new instance based on aContentSessionthat needs to implementObservable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuids, String[] nodeTypeName, boolean noLocal)voidaddEventListener(EventListener listener, JackrabbitEventFilter filter)Adds an event listener that listens for the events specified by the passedJackrabbitEventFilter.voidaddEventListener(EventListener listener, FilterProvider filterProvider)Adds an event listener that listens for the events specified by thefilterProviderpassed to this method.voiddispose()EventJournalgetEventJournal()EventJournalgetEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName)EventListenerIteratorgetRegisteredEventListeners()voidremoveEventListener(EventListener listener)voidsetUserData(@Nullable String userData)
-
-
-
Field Detail
-
OBSERVATION
public static final Marker OBSERVATION
-
-
Constructor Detail
-
ObservationManagerImpl
public ObservationManagerImpl(SessionContext sessionContext, ReadOnlyNodeTypeManager nodeTypeManager, Whiteboard whiteboard, int queueLength, CommitRateLimiter commitRateLimiter)
Create a new instance based on aContentSessionthat needs to implementObservable.- Parameters:
sessionContext- session delegate of the session in whose context this observation manager operates.nodeTypeManager- node type manager for the content sessionwhiteboard-- Throws:
IllegalArgumentException- ifcontentSessiondoesn't implementObservable.
-
-
Method Detail
-
dispose
public void dispose()
-
addEventListener
public void addEventListener(EventListener listener, FilterProvider filterProvider)
Adds an event listener that listens for the events specified by thefilterProviderpassed to this method.The set of events will be further filtered by the access rights of the current
Session.The filters of an already-registered
EventListenercan be changed at runtime by re-registering the sameEventListenerobject (i.e. the same actual Java object) with a new filter provider. The implementation must ensure that no events are lost during the changeover.- Parameters:
listener- anEventListenerobject.filterProvider- filter provider specifying the filter for this listener
-
addEventListener
public void addEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuids, String[] nodeTypeName, boolean noLocal) throws RepositoryException
- Specified by:
addEventListenerin interfaceObservationManager- Throws:
RepositoryException
-
addEventListener
public void addEventListener(EventListener listener, JackrabbitEventFilter filter) throws RepositoryException
Description copied from interface:JackrabbitObservationManagerAdds an event listener that listens for the events specified by the passedJackrabbitEventFilter.In addition to the
EventFilter, the set of events reported will be further filtered by the access rights of the currentSession.See
JackrabbitEventFilterfor a description of the filtering parameters available.The filter of an already-registered
EventListenercan be changed at runtime by re-registering the sameEventListenerobject (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:systemsubgraph may not be supported.- Specified by:
addEventListenerin interfaceJackrabbitObservationManager- Parameters:
listener- anEventListenerobject.filter- anJackrabbitEventFilterobject.- Throws:
RepositoryException- If an error occurs.
-
removeEventListener
public void removeEventListener(EventListener listener)
- Specified by:
removeEventListenerin interfaceObservationManager
-
getRegisteredEventListeners
public EventListenerIterator getRegisteredEventListeners()
- Specified by:
getRegisteredEventListenersin interfaceObservationManager
-
setUserData
public void setUserData(@Nullable @Nullable String userData)- Specified by:
setUserDatain interfaceObservationManager
-
getEventJournal
public EventJournal getEventJournal() throws RepositoryException
- Specified by:
getEventJournalin interfaceObservationManager- Throws:
RepositoryException
-
getEventJournal
public EventJournal getEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName) throws RepositoryException
- Specified by:
getEventJournalin interfaceObservationManager- Throws:
RepositoryException
-
-