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 Marker
OBSERVATION
-
Constructor Summary
Constructors Constructor Description ObservationManagerImpl(SessionContext sessionContext, ReadOnlyNodeTypeManager nodeTypeManager, Whiteboard whiteboard, int queueLength, CommitRateLimiter commitRateLimiter)
Create a new instance based on aContentSession
that needs to implementObservable
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuids, String[] nodeTypeName, boolean noLocal)
void
addEventListener(EventListener listener, JackrabbitEventFilter filter)
Adds an event listener that listens for the events specified by the passedJackrabbitEventFilter
.void
addEventListener(EventListener listener, FilterProvider filterProvider)
Adds an event listener that listens for the events specified by thefilterProvider
passed to this method.void
dispose()
EventJournal
getEventJournal()
EventJournal
getEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName)
EventListenerIterator
getRegisteredEventListeners()
void
removeEventListener(EventListener listener)
void
setUserData(@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 aContentSession
that 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
- ifcontentSession
doesn'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 thefilterProvider
passed 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
EventListener
can be changed at runtime by re-registering the sameEventListener
object (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
- anEventListener
object.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:
addEventListener
in interfaceObservationManager
- Throws:
RepositoryException
-
addEventListener
public void addEventListener(EventListener listener, JackrabbitEventFilter filter) throws RepositoryException
Description copied from interface:JackrabbitObservationManager
Adds 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
JackrabbitEventFilter
for a description of the filtering parameters available.The filter of an already-registered
EventListener
can be changed at runtime by re-registering the sameEventListener
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.- Specified by:
addEventListener
in interfaceJackrabbitObservationManager
- Parameters:
listener
- anEventListener
object.filter
- anJackrabbitEventFilter
object.- Throws:
RepositoryException
- If an error occurs.
-
removeEventListener
public void removeEventListener(EventListener listener)
- Specified by:
removeEventListener
in interfaceObservationManager
-
getRegisteredEventListeners
public EventListenerIterator getRegisteredEventListeners()
- Specified by:
getRegisteredEventListeners
in interfaceObservationManager
-
setUserData
public void setUserData(@Nullable @Nullable String userData)
- Specified by:
setUserData
in interfaceObservationManager
-
getEventJournal
public EventJournal getEventJournal() throws RepositoryException
- Specified by:
getEventJournal
in interfaceObservationManager
- Throws:
RepositoryException
-
getEventJournal
public EventJournal getEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName) throws RepositoryException
- Specified by:
getEventJournal
in interfaceObservationManager
- Throws:
RepositoryException
-
-