Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilter.java
===================================================================
--- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilter.java	(revision 0)
+++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilter.java	(working copy)
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.observation;
+
+import org.apache.jackrabbit.api.observation.JackrabbitEventFilter;
+import org.apache.jackrabbit.oak.plugins.observation.filter.FilterBuilder;
+import org.apache.jackrabbit.oak.plugins.observation.filter.FilterBuilder.Condition;
+
+/**
+ * Extension to JackrabbitEventFilter which encapsulates features supported only
+ * by Oak (and not Jackrabbit).
+ */
+public class OakEventFilter extends JackrabbitEventFilter {
+
+    private FilterBuilder builder;
+
+    private Condition all;
+
+    private Condition any;
+
+    public OakEventFilter(JackrabbitEventFilter blueprint) {
+        copy(blueprint);
+    }
+
+    private void copy(JackrabbitEventFilter blueprint) {
+        setAbsPath(blueprint.getAbsPath());
+        setAdditionalPaths(blueprint.getAdditionalPaths());
+        setEventTypes(blueprint.getEventTypes());
+        setExcludedPaths(blueprint.getExcludedPaths());
+        String[] identifiers = blueprint.getIdentifiers();
+        if (identifiers != null) {
+            setIdentifiers(identifiers);
+        }
+        setIsDeep(blueprint.getIsDeep());
+        String[] nodeTypes = blueprint.getNodeTypes();
+        if (nodeTypes != null) {
+            setNodeTypes(nodeTypes);
+        }
+        setNoExternal(blueprint.getNoExternal());
+        setNoInternal(blueprint.getNoInternal());
+        setNoLocal(blueprint.getNoLocal());
+    }
+
+    public FilterBuilder builder() {
+        if (builder == null) {
+            builder = new FilterBuilder();
+        }
+        return builder;
+    }
+
+    public OakEventFilter and(Condition... condition) {
+        if (all == null) {
+            all = builder.all(condition);
+        } else {
+            all = builder.all(all, builder.all(condition));
+        }
+        return this;
+    }
+
+    public OakEventFilter or(Condition... condition) {
+        if (any == null) {
+            any = builder.any(condition);
+        } else {
+            any = builder.any(any, builder.any(condition));
+        }
+        return this;
+    }
+
+    public Condition getAnds() {
+        return all;
+    }
+
+    public Condition getOrs() {
+        return any;
+    }
+
+}

Property changes on: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/OakEventFilter.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java
===================================================================
--- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java	(revision 1766515)
+++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java	(working copy)
@@ -238,6 +238,18 @@
 
         List<Condition> excludeConditions = createExclusions(filterBuilder, excludedPaths);
 
+        if (filter instanceof OakEventFilter) {
+            OakEventFilter oakEventFilter = (OakEventFilter) filter;
+            Condition ands = oakEventFilter.getAnds();
+            if (ands != null) {
+                excludeConditions.add(ands);
+            }
+            Condition ors = oakEventFilter.getOrs();
+            if (ors != null) {
+                includeConditions.add(ors);
+            }
+        }
+        
         filterBuilder
             .includeSessionLocal(!noLocal)
             .includeClusterExternal(!noExternal)
Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/util/EventFilterBuilder.java
===================================================================
--- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/util/EventFilterBuilder.java	(revision 0)
+++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/util/EventFilterBuilder.java	(working copy)
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.observation.util;
+
+import org.apache.jackrabbit.api.observation.JackrabbitEventFilter;
+import org.apache.jackrabbit.oak.jcr.observation.OakEventFilter;
+import org.apache.jackrabbit.oak.plugins.observation.filter.FilterBuilder.Condition;
+
+public class EventFilterBuilder {
+
+    /**
+     * 
+     * @param baseFilter the base filter potentially containing other settings
+     * @param globPath glob path that should be added as include path pattern. Note that 
+     * the NamePathMapper is not applied on this globPath.
+     * @return a new filter based on the provided one plus the new glob path as include path
+     */
+    public static JackrabbitEventFilter orGlobPath(JackrabbitEventFilter baseFilter, String globPath) {
+        OakEventFilter originalFilter = oakEventFilter(baseFilter);
+        Condition globPathCondition = originalFilter.builder().path(globPath);
+        return originalFilter.or(globPathCondition);
+    }
+    
+    private static OakEventFilter oakEventFilter(JackrabbitEventFilter filter) {
+        if (filter instanceof OakEventFilter) {
+            return (OakEventFilter) filter;
+        } else {
+            return new OakEventFilter(filter);
+        }
+    }
+
+}

Property changes on: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/util/EventFilterBuilder.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
