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
EachSession
instance has its ownObservationManager
instance. The classSessionLocalObservationManager
implements this behaviour.
-
-
Constructor Summary
Constructors Constructor Description ObservationManagerImpl(ObservationDispatcher dispatcher, SessionImpl session, ClusterNode clusterNode)
Creates anObservationManager
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventListener(EventListener listener, int eventTypes, String absPath, boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal)
void
addEventListener(EventListener listener, JackrabbitEventFilter filter)
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 anEventStateCollection
.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)
-
-
-
Constructor Detail
-
ObservationManagerImpl
public ObservationManagerImpl(ObservationDispatcher dispatcher, SessionImpl session, ClusterNode clusterNode)
Creates anObservationManager
instance.- Parameters:
dispatcher
- observation dispatchersession
- theSession
this ObservationManager belongs to.clusterNode
-- Throws:
NullPointerException
- ifdispatcher
,session
orclusterNode
isnull
.
-
-
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 interfaceObservationManager
- Throws:
RepositoryException
-
addEventListener
public void addEventListener(EventListener listener, JackrabbitEventFilter filter) throws RepositoryException
- Specified by:
addEventListener
in interfaceJackrabbitObservationManager
- Throws:
RepositoryException
-
removeEventListener
public void removeEventListener(EventListener listener) throws RepositoryException
- Specified by:
removeEventListener
in interfaceObservationManager
- Throws:
RepositoryException
-
getRegisteredEventListeners
public EventListenerIterator getRegisteredEventListeners() throws RepositoryException
- Specified by:
getRegisteredEventListeners
in interfaceObservationManager
- Throws:
RepositoryException
-
setUserData
public void setUserData(String userData) throws RepositoryException
- Specified by:
setUserData
in 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:
getEventJournal
in 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:
getEventJournal
in 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
EventStateCollection
tied to the session which is attached to thisObservationManager
instance.- Specified by:
createEventStateCollection
in interfaceEventStateCollectionFactory
- Returns:
- a new
EventStateCollection
-
-