Index: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/JackrabbitEventFilter.java =================================================================== --- jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/JackrabbitEventFilter.java (revision 1759223) +++ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/observation/JackrabbitEventFilter.java (working copy) @@ -95,6 +95,7 @@ private String[] excludedPaths = new String[]{}; private boolean noExternal; private boolean noInternal; + private boolean consolidateChanges; /** * Sets the eventTypes parameter of the filter. @@ -273,6 +274,9 @@ */ public JackrabbitEventFilter setNoExternal(boolean noExternal) { this.noExternal = noExternal; + if (noExternal) { + consolidateChanges = false; + } return this; } @@ -294,6 +298,9 @@ */ public JackrabbitEventFilter setNoInternal(boolean noInternal) { this.noInternal = noInternal; + if (noInternal) { + consolidateChanges = false; + } return this; } @@ -306,4 +313,33 @@ return noInternal; } + /** + * If set {@code true}, allows the repository to consolidate changes and + * report changes from multiple {@code Session.save()} calls with a single + * {@code EventListener.onEvent()} callback. When this parameter is enabled, + * both {@code noExternal} and {@code noInternal} are automatically reset + * to {@code false} and changes are reported from all cluster nodes. + *

+ * Please note that sequences of consolidated changes may not show the same + * events as individual changes do. E.g. adding a node and removing it again + * will result in no event when consolidated. + * + * @param consolidateChanges a {@code boolean}. + * @return this event filter instance. + */ + public JackrabbitEventFilter setConsolidateChanges(boolean consolidateChanges) { + this.consolidateChanges = consolidateChanges; + this.noInternal = false; + this.noExternal = false; + return this; + } + + /** + * Returns the {@code consolidateChanges} parameter of this filter. + * + * @return a {@code boolean}. + */ + public boolean getConsolidateChanges() { + return consolidateChanges; + } } \ No newline at end of file