continue;
}
// process event making sure we have the right event type
Path path = change.getPath();
PathFactory pathFactory = getValueFactories().getPathFactory();
String userId = getUserId();
if (change.includes(ChangeType.NODE_ADDED) && ((this.eventTypes & Event.NODE_ADDED) == Event.NODE_ADDED)) {
// create event for added node
events.add(new JcrEvent(Event.NODE_ADDED, path.getString(geNamespaceRegistry()), userId));
} else if (change.includes(ChangeType.NODE_REMOVED)
&& ((this.eventTypes & Event.NODE_REMOVED) == Event.NODE_REMOVED)) {
// create event for removed node
events.add(new JcrEvent(Event.NODE_REMOVED, path.getString(geNamespaceRegistry()), userId));
}
if (change.includes(ChangeType.PROPERTY_CHANGED)
&& ((this.eventTypes & Event.PROPERTY_CHANGED) == Event.PROPERTY_CHANGED)) {
for (Property property : change.getModifiedProperties()) {
// create event for changed property
Path propertyPath = pathFactory.create(path, property.getName().getString(geNamespaceRegistry()));
events.add(new JcrEvent(Event.PROPERTY_CHANGED, propertyPath.getString(geNamespaceRegistry()), userId));
}
}
// properties have changed
if (change.includes(ChangeType.PROPERTY_ADDED)
&& ((this.eventTypes & Event.PROPERTY_ADDED) == Event.PROPERTY_ADDED)) {
for (Property property : change.getAddedProperties()) {
// create event for added property
Path propertyPath = pathFactory.create(path, property.getName().getString(geNamespaceRegistry()));
events.add(new JcrEvent(Event.PROPERTY_ADDED, propertyPath.getString(geNamespaceRegistry()), userId));
}
}
if (change.includes(ChangeType.PROPERTY_REMOVED)
&& ((this.eventTypes & Event.PROPERTY_REMOVED) == Event.PROPERTY_REMOVED)) {
for (Name name : change.getRemovedProperties()) {
// create event for removed property
Path propertyPath = pathFactory.create(path, name);
events.add(new JcrEvent(Event.PROPERTY_REMOVED, propertyPath.getString(geNamespaceRegistry()), userId));
}
}
}