public class ObservationManagerImpl extends Object implements EventStateCollectionFactory, JackrabbitObservationManager
Session
instance has its own ObservationManager
instance. The class SessionLocalObservationManager
implements
this behaviour.Constructor and Description |
---|
ObservationManagerImpl(ObservationDispatcher dispatcher,
SessionImpl session,
ClusterNode clusterNode)
Creates an
ObservationManager instance. |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(EventListener listener,
int eventTypes,
String absPath,
boolean isDeep,
String[] uuid,
String[] nodeTypeName,
boolean noLocal) |
void |
addEventListener(EventListener listener,
JackrabbitEventFilter filter)
Adds an event listener that listens for the events specified
by the passed
JackrabbitEventFilter . |
EventFilter |
createEventFilter(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.
|
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) |
public ObservationManagerImpl(ObservationDispatcher dispatcher, SessionImpl session, ClusterNode clusterNode)
ObservationManager
instance.dispatcher
- observation dispatchersession
- the Session
this ObservationManager
belongs to.clusterNode
- NullPointerException
- if dispatcher
, session
or clusterNode
is null
.public void addEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException
addEventListener
in interface ObservationManager
RepositoryException
public void addEventListener(EventListener listener, JackrabbitEventFilter filter) throws RepositoryException
JackrabbitObservationManager
JackrabbitEventFilter
.
In addition to the EventFilter
, the set of events reported
will be further filtered by the access rights of the
current Session
.
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 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.
addEventListener
in interface JackrabbitObservationManager
listener
- an EventListener
object.filter
- an JackrabbitEventFilter
object.RepositoryException
- If an error occurs.public void removeEventListener(EventListener listener) throws RepositoryException
removeEventListener
in interface ObservationManager
RepositoryException
public EventListenerIterator getRegisteredEventListeners() throws RepositoryException
getRegisteredEventListeners
in interface ObservationManager
RepositoryException
public void setUserData(String userData) throws RepositoryException
setUserData
in interface ObservationManager
RepositoryException
public void dispose()
public EventFilter createEventFilter(int eventTypes, List<String> absPaths, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal, boolean noExternal, boolean noInternal) throws RepositoryException
eventTypes
- A combination of one or more event type constants encoded as a bitmask.absPaths
- absolute paths.isDeep
- a boolean
.uuid
- array of UUIDs.nodeTypeName
- array of node type names.noLocal
- a boolean
.noExternal
- a boolean
.noInternal
- a boolean
.RepositoryException
- if an error occurs.public EventJournal getEventJournal(int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName) throws RepositoryException
getEventJournal
in interface ObservationManager
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.UnsupportedRepositoryOperationException
- if this repository does
not support an event journal (cluster journal disabled).RepositoryException
- if another error occurs.ObservationManager.getEventJournal(int, String, boolean, String[], String[])
public EventJournal getEventJournal() throws RepositoryException
getEventJournal
in interface ObservationManager
UnsupportedRepositoryOperationException
- if this repository does
not support an event journal (cluster journal disabled).RepositoryException
- if another error occurs.public EventStateCollection createEventStateCollection()
EventStateCollection
.
Creates an EventStateCollection
tied to the session
which is attached to this ObservationManager
instance.
createEventStateCollection
in interface EventStateCollectionFactory
EventStateCollection
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.