*/
protected EntryCollector(SessionImpl systemSession, NodeId rootID) throws RepositoryException {
this.systemSession = systemSession;
this.rootID = rootID;
ObservationManager observationMgr = systemSession.getWorkspace().getObservationManager();
/*
Make sure the collector and all subscribed listeners are informed upon
ACL modifications. Interesting events are:
- new ACL (NODE_ADDED)
- new ACE (NODE_ADDED)
- changing ACE (PROPERTY_CHANGED)
- removed ACL (NODE_REMOVED)
- removed ACE (NODE_REMOVED)
*/
int events = Event.PROPERTY_CHANGED | Event.NODE_ADDED | Event.NODE_REMOVED;
String[] ntNames = new String[] {
systemSession.getJCRName(NT_REP_ACCESS_CONTROLLABLE),
systemSession.getJCRName(NT_REP_ACL),
systemSession.getJCRName(NT_REP_ACE)
};
String rootPath = systemSession.getRootNode().getPath();
observationMgr.addEventListener(this, events, rootPath, true, null, ntNames, true);
/*
In addition both the collector and all subscribed listeners should be
informed about any kind of move events.
*/
moveListener = new MoveListener();
observationMgr.addEventListener(moveListener, Event.NODE_MOVED, rootPath, true, null, null, true);
}