Author: mduerig
Date: Wed Nov 20 14:04:42 2013
New Revision: 1543818
URL: http://svn.apache.org/r1543818
Log:
OAK-1133: Observation listener PLUS
Javadoc
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/EventTypeFilter.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/NodeTypeFilter.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/PathFilter.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/UuidFilter.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/EventTypeFilter.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/EventTypeFilter.java?rev=1543818&r1=1543817&r2=1543818&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/EventTypeFilter.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/EventTypeFilter.java
Wed Nov 20 14:04:42 2013
@@ -26,11 +26,23 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.spi.state.NodeState;
/**
- * TODO EventTypeFilter...
+ * {@code EventTypeFilter} filters based on event types as defined
+ * by {@link javax.jcr.observation.ObservationManager#addEventListener(
+ javax.jcr.observation.EventListener, int, String, boolean, String[],
String[], boolean)
+ ObservationManager.addEventListener()}.
*/
public class EventTypeFilter implements Filter {
private final int eventTypes;
+ /**
+ * Create a new {@code Filter} instance that includes all events matching
+ * the {@code eventTypes} bit mask. That is, a given event is included if
+ * the corresponding bit in {@code eventType} is set.
+ *
+ * @param eventTypes bit mask encoding the types of events to include
+ *
+ * @see Event
+ */
public EventTypeFilter(int eventTypes) {
this.eventTypes = eventTypes;
}
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/NodeTypeFilter.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/NodeTypeFilter.java?rev=1543818&r1=1543817&r2=1543818&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/NodeTypeFilter.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/NodeTypeFilter.java
Wed Nov 20 14:04:42 2013
@@ -30,8 +30,11 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.spi.state.NodeState;
/**
- * TODO NodeTypeFilter...
- * TODO Clarify: filter applies to parent
+ * {@code EventTypeFilter} filters based on the node type of the
+ * <em>associated parent node</em> as defined by
+ * {@link javax.jcr.observation.ObservationManager#addEventListener(
+ javax.jcr.observation.EventListener, int, String, boolean, String[],
String[], boolean)
+ ObservationManager.addEventListener()}.
*/
public class NodeTypeFilter implements Filter {
private final ImmutableTree beforeTree;
@@ -39,6 +42,15 @@ public class NodeTypeFilter implements F
private final ReadOnlyNodeTypeManager ntManager;
private final String[] ntNames;
+ /**
+ * Create a new {@code Filter} instance that includes an event when the
type of the
+ * associated parent node is of one of the node types in {@code ntNames}.
+ *
+ * @param beforeTree associated parent before state
+ * @param afterTree associated parent after state
+ * @param ntManager node type manager used to determine type inhabitation
+ * @param ntNames node type names to match
+ */
public NodeTypeFilter(@Nonnull ImmutableTree beforeTree, @Nonnull
ImmutableTree afterTree,
@Nonnull ReadOnlyNodeTypeManager ntManager, @Nonnull String[]
ntNames) {
this.beforeTree = checkNotNull(beforeTree);
@@ -90,13 +102,6 @@ public class NodeTypeFilter implements F
//------------------------------------------------------------< private
>---
- /**
- * Checks whether to include an event based on the type of the associated
- * parent node and the node type filter.
- *
- * @return whether to include the event based on the type of the associated
- * parent node.
- */
private boolean includeByType() {
ImmutableTree associatedParent = afterTree.exists()
? afterTree
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/PathFilter.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/PathFilter.java?rev=1543818&r1=1543817&r2=1543818&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/PathFilter.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/PathFilter.java
Wed Nov 20 14:04:42 2013
@@ -30,8 +30,10 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.spi.state.NodeState;
/**
- * TODO PathFilter...
- * TODO Clarify: filter applies to parent
+ * {@code EventTypeFilter} filters based on the path of the <em>associated
parent node</em> as
+ * defined by {@link javax.jcr.observation.ObservationManager#addEventListener(
+ javax.jcr.observation.EventListener, int, String, boolean, String[],
String[], boolean)
+ ObservationManager.addEventListener()}.
*/
public class PathFilter implements Filter {
private final ImmutableTree beforeTree;
@@ -39,6 +41,15 @@ public class PathFilter implements Filte
private final String path;
private final boolean deep;
+ /**
+ * Create a new {@code Filter} instance that includes an event when the
path of the
+ * associated parent node matches the one of this filter or - when the
{@code deep}
+ * flag is set - is a descendant of the path of this filter.
+ *
+ * @param beforeTree associated parent before state
+ * @param afterTree associated parent after state
+ * @param path path to match
+ */
public PathFilter(@Nonnull ImmutableTree beforeTree, @Nonnull
ImmutableTree afterTree,
@Nonnull String path, boolean deep) {
this.beforeTree = checkNotNull(beforeTree);
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/UuidFilter.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/UuidFilter.java?rev=1543818&r1=1543817&r2=1543818&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/UuidFilter.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/UuidFilter.java
Wed Nov 20 14:04:42 2013
@@ -30,14 +30,25 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.spi.state.NodeState;
/**
- * TODO UuidFilter
- * TODO Clarify: filter applies to parent
+ * {@code EventTypeFilter} filters based on the uuid of the
+ * <em>associated parent node</em> as defined by
+ * {@link javax.jcr.observation.ObservationManager#addEventListener(
+ javax.jcr.observation.EventListener, int, String, boolean, String[],
String[], boolean)
+ ObservationManager.addEventListener()}.
*/
public class UuidFilter implements Filter {
private final NodeState before;
private final NodeState after;
private final String[] uuids;
+ /**
+ * Create a new {@code Filter} instance that includes an event when the
uuid of the
+ * associated parent node matches one of the uuids of this filter.
+ *
+ * @param before associated parent before state
+ * @param after associated parent after state
+ * @param uuids uuids to match
+ */
public UuidFilter(@Nonnull NodeState before, @Nonnull NodeState after,
@Nonnull String[] uuids) {
this.before = checkNotNull(before);