jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1330912 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/mk/index/ main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/osgi/ main/java/org/apache/jackrabbit/oak/query/ main/java/org/apache/...
Date Thu, 26 Apr 2012 15:54:49 GMT
Author: thomasm
Date: Thu Apr 26 15:54:48 2012
New Revision: 1330912

URL: http://svn.apache.org/viewvc?rev=1330912&view=rev
Log:
OAK-34 Define query API (move the relevant interfaces to a new 'spi' package)

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java
      - copied, changed from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java
      - copied, changed from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Cursor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Filter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndex.java
      - copied, changed from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndexProvider.java
      - copied, changed from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndexProvider.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Cursor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndexProvider.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AndImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ConstraintImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NotImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/OrImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/index/Indexer.java Thu Apr 26 15:54:48 2012
@@ -27,8 +27,8 @@ import org.apache.jackrabbit.mk.util.Exc
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.mk.util.SimpleLRUCache;
 import org.apache.jackrabbit.oak.query.index.PropertyContentIndex;
-import org.apache.jackrabbit.oak.query.index.QueryIndex;
-import org.apache.jackrabbit.oak.query.index.QueryIndexProvider;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
+import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
 
 import java.util.ArrayList;
 import java.util.Collections;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java Thu Apr 26 15:54:48 2012
@@ -27,7 +27,7 @@ import org.apache.jackrabbit.oak.kernel.
 import org.apache.jackrabbit.oak.kernel.NodeState;
 import org.apache.jackrabbit.oak.kernel.NodeStore;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
-import org.apache.jackrabbit.oak.query.index.QueryIndexProvider;
+import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiIndexProvider.java Thu Apr 26 15:54:48 2012
@@ -1,3 +1,21 @@
+/*
+ * 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.osgi;
 
 import java.util.Collections;
@@ -5,13 +23,17 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.oak.query.index.QueryIndex;
-import org.apache.jackrabbit.oak.query.index.QueryIndexProvider;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
+import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
 
+/**
+ * This index provider combines all indexes of all available OSGi index
+ * providers.
+ */
 public class OsgiIndexProvider implements ServiceTrackerCustomizer, QueryIndexProvider {
 
     private BundleContext context;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java Thu Apr 26 15:54:48 2012
@@ -46,8 +46,8 @@ import org.apache.jackrabbit.oak.query.a
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 import org.apache.jackrabbit.oak.query.ast.SourceImpl;
 import org.apache.jackrabbit.oak.query.ast.UpperCaseImpl;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.QueryIndex;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
 
 /**
  * Represents a parsed query. Lifecycle: use the constructor to create a new
@@ -465,7 +465,7 @@ public class Query {
         this.queryEngine = queryEngine;
     }
 
-    public QueryIndex getBestIndex(Filter filter) {
+    public QueryIndex getBestIndex(FilterImpl filter) {
         return queryEngine.getBestIndex(filter);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java Thu Apr 26 15:54:48 2012
@@ -24,10 +24,10 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.QueryEngine;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.QueryIndex;
-import org.apache.jackrabbit.oak.query.index.QueryIndexProvider;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 import org.apache.jackrabbit.oak.query.index.TraversingIndex;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
+import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
 
 public class QueryEngineImpl implements QueryEngine {
 
@@ -94,7 +94,7 @@ public class QueryEngineImpl implements 
         return q.executeQuery(mk.getHeadRevision());
     }
 
-    public QueryIndex getBestIndex(Filter filter) {
+    public QueryIndex getBestIndex(FilterImpl filter) {
         QueryIndex best = null;
         double bestCost = Double.MAX_VALUE;
         for (QueryIndex index : getIndexes()) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AndImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AndImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AndImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AndImpl.java Thu Apr 26 15:54:48 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class AndImpl extends ConstraintImpl {
 
@@ -53,7 +53,7 @@ public class AndImpl extends ConstraintI
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         constraint1.apply(f);
         constraint2.apply(f);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeImpl.java Thu Apr 26 15:54:48 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 public class ChildNodeImpl extends ConstraintImpl {
 
@@ -67,9 +67,9 @@ public class ChildNodeImpl extends Const
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         if (selector == f.getSelector()) {
-            f.restrictPath(parentPath, PathRestriction.DIRECT_CHILDREN);
+            f.restrictPath(parentPath, Filter.PathRestriction.DIRECT_CHILDREN);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ChildNodeJoinConditionImpl.java Thu Apr 26 15:54:48 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 public class ChildNodeJoinConditionImpl extends JoinConditionImpl {
 
@@ -75,14 +75,14 @@ public class ChildNodeJoinConditionImpl 
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         String p = parentSelector.currentPath();
         String c = childSelector.currentPath();
         if (f.getSelector() == parentSelector && c != null) {
-            f.restrictPath(PathUtils.getParentPath(c), PathRestriction.EXACT);
+            f.restrictPath(PathUtils.getParentPath(c), Filter.PathRestriction.EXACT);
         }
         if (f.getSelector() == childSelector && p != null) {
-            f.restrictPath(p, PathRestriction.DIRECT_CHILDREN);
+            f.restrictPath(p, Filter.PathRestriction.DIRECT_CHILDREN);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java Thu Apr 26 15:54:48 2012
@@ -20,7 +20,7 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class ComparisonImpl extends ConstraintImpl {
 
@@ -254,7 +254,7 @@ public class ComparisonImpl extends Cons
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         CoreValue v = operand2.currentValue();
         if (v != null) {
             if (operator == Operator.LIKE) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ConstraintImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ConstraintImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ConstraintImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ConstraintImpl.java Thu Apr 26 15:54:48 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public abstract class ConstraintImpl extends AstElement {
 
@@ -32,6 +32,6 @@ public abstract class ConstraintImpl ext
      *
      * @param f the filter
      */
-    public abstract void apply(Filter f);
+    public abstract void apply(FilterImpl f);
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeImpl.java Thu Apr 26 15:54:48 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 public class DescendantNodeImpl extends ConstraintImpl {
 
@@ -65,9 +65,9 @@ public class DescendantNodeImpl extends 
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         if (f.getSelector() == selector) {
-            f.restrictPath(ancestorPath, PathRestriction.ALL_CHILDREN);
+            f.restrictPath(ancestorPath, Filter.PathRestriction.ALL_CHILDREN);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DescendantNodeJoinConditionImpl.java Thu Apr 26 15:54:48 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 public class DescendantNodeJoinConditionImpl extends JoinConditionImpl {
 
@@ -74,14 +74,14 @@ public class DescendantNodeJoinCondition
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         String d = descendantSelector.currentPath();
         String a = ancestorSelector.currentPath();
         if (d != null && f.getSelector() == ancestorSelector) {
-            f.restrictPath(PathUtils.getParentPath(d), PathRestriction.PARENT);
+            f.restrictPath(PathUtils.getParentPath(d), Filter.PathRestriction.PARENT);
         }
         if (a != null && f.getSelector() == descendantSelector) {
-            f.restrictPath(a, PathRestriction.DIRECT_CHILDREN);
+            f.restrictPath(a, Filter.PathRestriction.DIRECT_CHILDREN);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java Thu Apr 26 15:54:48 2012
@@ -17,12 +17,12 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public abstract class DynamicOperandImpl extends AstElement {
 
     public abstract CoreValue currentValue();
 
-    public abstract void apply(Filter f, Operator operator, CoreValue v);
+    public abstract void apply(FilterImpl f, Operator operator, CoreValue v);
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java Thu Apr 26 15:54:48 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class EquiJoinConditionImpl extends JoinConditionImpl {
 
@@ -89,7 +89,7 @@ public class EquiJoinConditionImpl exten
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         CoreValue v1 = selector1.currentProperty(property1Name);
         CoreValue v2 = selector2.currentProperty(property2Name);
         if (f.getSelector() == selector1 && v2 != null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java Thu Apr 26 15:54:48 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class FullTextSearchImpl extends ConstraintImpl {
 
@@ -75,7 +75,7 @@ public class FullTextSearchImpl extends 
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         // TODO support fulltext index conditions
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java Thu Apr 26 15:54:48 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class FullTextSearchScoreImpl extends DynamicOperandImpl {
 
@@ -50,7 +50,7 @@ public class FullTextSearchScoreImpl ext
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         // TODO support fulltext index conditions (score)
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinConditionImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/JoinConditionImpl.java Thu Apr 26 15:54:48 2012
@@ -13,13 +13,13 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 
 public abstract class JoinConditionImpl extends AstElement {
 
     public abstract boolean evaluate();
 
-    public abstract void apply(Filter f);
+    public abstract void apply(FilterImpl f);
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java Thu Apr 26 15:54:48 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class LengthImpl extends DynamicOperandImpl {
 
@@ -55,7 +55,7 @@ public class LengthImpl extends DynamicO
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         // ignore
         // TODO LENGTH(x) conditions: can use IS NOT NULL?
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java Thu Apr 26 15:54:48 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class LowerCaseImpl extends DynamicOperandImpl {
 
@@ -54,7 +54,7 @@ public class LowerCaseImpl extends Dynam
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         // ignore
         // TODO UPPER(x) conditions: can use IS NOT NULL?
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java Thu Apr 26 15:54:48 2012
@@ -20,7 +20,7 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class NodeLocalNameImpl extends DynamicOperandImpl {
 
@@ -62,7 +62,7 @@ public class NodeLocalNameImpl extends D
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         // TODO support LOCALNAME index conditions
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java Thu Apr 26 15:54:48 2012
@@ -20,7 +20,7 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class NodeNameImpl extends DynamicOperandImpl {
 
@@ -59,7 +59,7 @@ public class NodeNameImpl extends Dynami
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         // TODO support NAME(..) index conditions
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NotImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NotImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NotImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NotImpl.java Thu Apr 26 15:54:48 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class NotImpl extends ConstraintImpl {
 
@@ -48,7 +48,7 @@ public class NotImpl extends ConstraintI
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         // ignore
         // TODO convert NOT conditions
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/OrImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/OrImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/OrImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/OrImpl.java Thu Apr 26 15:54:48 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class OrImpl extends ConstraintImpl {
 
@@ -54,7 +54,7 @@ public class OrImpl extends ConstraintIm
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         // ignore
         // TODO convert OR conditions to UNION
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java Thu Apr 26 15:54:48 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class PropertyExistenceImpl extends ConstraintImpl {
 
@@ -65,7 +65,7 @@ public class PropertyExistenceImpl exten
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         if (f.getSelector() == selector) {
             f.restrictProperty(propertyName, Operator.NOT_EQUAL, (CoreValue) null);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java Thu Apr 26 15:54:48 2012
@@ -22,7 +22,7 @@ import org.apache.jackrabbit.mk.json.Jso
 import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class PropertyValueImpl extends DynamicOperandImpl {
 
@@ -88,7 +88,7 @@ public class PropertyValueImpl extends D
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         if (f.getSelector() == selector) {
             f.restrictProperty(propertyName, operator, v);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeImpl.java Thu Apr 26 15:54:48 2012
@@ -18,8 +18,8 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 public class SameNodeImpl extends ConstraintImpl {
 
@@ -63,9 +63,9 @@ public class SameNodeImpl extends Constr
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         if (f.getSelector() == selector) {
-            f.restrictPath(path, PathRestriction.EXACT);
+            f.restrictPath(path, Filter.PathRestriction.EXACT);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SameNodeJoinConditionImpl.java Thu Apr 26 15:54:48 2012
@@ -18,8 +18,8 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 public class SameNodeJoinConditionImpl extends JoinConditionImpl {
 
@@ -87,14 +87,14 @@ public class SameNodeJoinConditionImpl e
     }
 
     @Override
-    public void apply(Filter f) {
+    public void apply(FilterImpl f) {
         String p1 = selector1.currentPath();
         String p2 = selector2.currentPath();
         if (f.getSelector() == selector1) {
-            f.restrictPath(p2, PathRestriction.EXACT);
+            f.restrictPath(p2, Filter.PathRestriction.EXACT);
         }
         if (f.getSelector() == selector2) {
-            f.restrictPath(p1, PathRestriction.EXACT);
+            f.restrictPath(p1, Filter.PathRestriction.EXACT);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java Thu Apr 26 15:54:48 2012
@@ -23,9 +23,9 @@ import org.apache.jackrabbit.mk.json.Jso
 import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.query.Query;
-import org.apache.jackrabbit.oak.query.index.Cursor;
-import org.apache.jackrabbit.oak.query.index.Filter;
-import org.apache.jackrabbit.oak.query.index.QueryIndex;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
+import org.apache.jackrabbit.oak.spi.Cursor;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
 
 public class SelectorImpl extends SourceImpl {
 
@@ -77,8 +77,8 @@ public class SelectorImpl extends Source
         return  nodeTypeName + " AS " + getSelectorName() + " /* " + index.getPlan(createFilter()) + " */";
     }
 
-    private Filter createFilter() {
-        Filter f = new Filter(this);
+    private FilterImpl createFilter() {
+        FilterImpl f = new FilterImpl(this);
         if (joinCondition != null) {
             joinCondition.apply(f);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java Thu Apr 26 15:54:48 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter;
+import org.apache.jackrabbit.oak.query.index.FilterImpl;
 
 public class UpperCaseImpl extends DynamicOperandImpl {
 
@@ -54,7 +54,7 @@ public class UpperCaseImpl extends Dynam
     }
 
     @Override
-    public void apply(Filter f, Operator operator, CoreValue v) {
+    public void apply(FilterImpl f, Operator operator, CoreValue v) {
         // ignore
         // TODO UPPER(x) conditions: can use IS NOT NULL?
     }

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java (from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java&r1=1330882&r2=1330912&rev=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java Thu Apr 26 15:54:48 2012
@@ -22,6 +22,7 @@ import org.apache.jackrabbit.mk.util.Pat
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
+import org.apache.jackrabbit.oak.spi.Filter;
 
 import java.util.HashMap;
 import java.util.Map.Entry;
@@ -29,7 +30,7 @@ import java.util.Map.Entry;
 /**
  * A filter or lookup condition.
  */
-public class Filter {
+public class FilterImpl implements Filter {
 
     /**
      * The selector this filter applies to.
@@ -46,44 +47,6 @@ public class Filter {
      */
     private String path = "/";
 
-    /**
-     * The path restriction type.
-     */
-    public enum PathRestriction {
-
-        /**
-         * A parent of this node
-         */
-        PARENT("/.."),
-
-        /**
-         * This exact node only.
-         */
-        EXACT(""),
-
-        /**
-         * All direct child nodes.
-         */
-        DIRECT_CHILDREN("/*"),
-
-        /**
-         * All direct and indirect child nodes.
-         */
-        ALL_CHILDREN("//*");
-
-        private final String name;
-
-        PathRestriction(String name) {
-            this.name = name;
-        }
-
-        @Override
-        public String toString() {
-            return name;
-        }
-
-    }
-
     private PathRestriction pathRestriction = PathRestriction.ALL_CHILDREN;
 
     /**
@@ -99,41 +62,6 @@ public class Filter {
     private final HashMap<String, PropertyRestriction> propertyRestrictions =
             new HashMap<String, PropertyRestriction>();
 
-    static class PropertyRestriction {
-
-        /**
-         * The name of the property.
-         */
-        public String propertyName;
-
-        /**
-         * The first value to read, or null to read from the beginning.
-         */
-        public CoreValue first;
-
-        /**
-         * Whether values that match the first should be returned.
-         */
-        public boolean firstIncluding;
-
-        /**
-         * The last value to read, or null to read until the end.
-         */
-        public CoreValue last;
-
-        /**
-         * Whether values that match the last should be returned.
-         */
-        public boolean lastIncluding;
-
-        @Override
-        public String toString() {
-            return (first == null ? "" : ((firstIncluding ? "[" : "(") + first)) + ".." +
-                    (last == null ? "" : last + (lastIncluding ? "]" : ")"));
-        }
-
-    }
-
     /**
      * Only return distinct values.
      */
@@ -141,7 +69,7 @@ public class Filter {
 
     // TODO support "order by"
 
-    public Filter(SelectorImpl selector) {
+    public FilterImpl(SelectorImpl selector) {
         this.selector = selector;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/PropertyContentIndex.java Thu Apr 26 15:54:48 2012
@@ -23,7 +23,9 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.mk.index.PropertyIndex;
 import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.query.index.Filter.PropertyRestriction;
+import org.apache.jackrabbit.oak.spi.Cursor;
+import org.apache.jackrabbit.oak.spi.Filter;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
 
 /**
  * An index that stores the index data in a {@code MicroKernel}.
@@ -41,7 +43,7 @@ public class PropertyContentIndex implem
     @Override
     public double getCost(Filter filter) {
         String propertyName = index.getName();
-        PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
+        Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
         if (restriction == null) {
             return Double.MAX_VALUE;
         }
@@ -65,7 +67,7 @@ public class PropertyContentIndex implem
     @Override
     public String getPlan(Filter filter) {
         String propertyName = index.getName();
-        PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
+        Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
 
         return "propertyIndex \"" + restriction.propertyName + " " + restriction.toString() + '"';
     }
@@ -73,7 +75,7 @@ public class PropertyContentIndex implem
     @Override
     public Cursor query(Filter filter, String revisionId) {
         String propertyName = index.getName();
-        PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
+        Filter.PropertyRestriction restriction = filter.getPropertyRestriction(propertyName);
         if (restriction == null) {
             throw new IllegalArgumentException("No restriction for " + propertyName);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingCursor.java Thu Apr 26 15:54:48 2012
@@ -16,6 +16,7 @@ package org.apache.jackrabbit.oak.query.
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.mk.util.PathUtils;
+import org.apache.jackrabbit.oak.spi.Cursor;
 import java.util.ArrayList;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/TraversingIndex.java Thu Apr 26 15:54:48 2012
@@ -20,6 +20,9 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.util.PathUtils;
+import org.apache.jackrabbit.oak.spi.Cursor;
+import org.apache.jackrabbit.oak.spi.Filter;
+import org.apache.jackrabbit.oak.spi.QueryIndex;
 
 public class TraversingIndex implements QueryIndex {
 

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java (from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Cursor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Cursor.java&r1=1330882&r2=1330912&rev=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Cursor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Cursor.java Thu Apr 26 15:54:48 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.query.index;
+package org.apache.jackrabbit.oak.spi;
 
 import org.apache.jackrabbit.mk.simple.NodeImpl;
 

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Filter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Filter.java?rev=1330912&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Filter.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/Filter.java Thu Apr 26 15:54:48 2012
@@ -0,0 +1,126 @@
+/*
+ * 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.spi;
+
+import org.apache.jackrabbit.oak.api.CoreValue;
+
+/**
+ * The filter for an index lookup.
+ */
+public interface Filter {
+
+    /**
+     * Get the property restriction for the given property, if any.
+     *
+     * @param propertyName the property name
+     * @return the restriction, or null if there is no restriction for this property
+     */
+    PropertyRestriction getPropertyRestriction(String propertyName);
+
+    /**
+     * Get the path restriction type.
+     *
+     * @return the path restriction type
+     */
+    PathRestriction getPathRestriction();
+
+    /**
+     * Get the path, or "/" if there is no path restriction set.
+     *
+     * @return the path
+     */
+    String getPath();
+
+    /**
+     * A restriction for a property.
+     */
+    static class PropertyRestriction {
+
+        /**
+         * The name of the property.
+         */
+        public String propertyName;
+
+        /**
+         * The first value to read, or null to read from the beginning.
+         */
+        public CoreValue first;
+
+        /**
+         * Whether values that match the first should be returned.
+         */
+        public boolean firstIncluding;
+
+        /**
+         * The last value to read, or null to read until the end.
+         */
+        public CoreValue last;
+
+        /**
+         * Whether values that match the last should be returned.
+         */
+        public boolean lastIncluding;
+
+        @Override
+        public String toString() {
+            return (first == null ? "" : ((firstIncluding ? "[" : "(") + first)) + ".." +
+                    (last == null ? "" : last + (lastIncluding ? "]" : ")"));
+        }
+
+    }
+
+    /**
+     * The path restriction type.
+     */
+    public enum PathRestriction {
+
+        /**
+         * A parent of this node
+         */
+        PARENT("/.."),
+
+        /**
+         * This exact node only.
+         */
+        EXACT(""),
+
+        /**
+         * All direct child nodes.
+         */
+        DIRECT_CHILDREN("/*"),
+
+        /**
+         * All direct and indirect child nodes.
+         */
+        ALL_CHILDREN("//*");
+
+        private final String name;
+
+        PathRestriction(String name) {
+            this.name = name;
+        }
+
+        @Override
+        public String toString() {
+            return name;
+        }
+
+    }
+
+}

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndex.java (from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndex.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndex.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndex.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndex.java&r1=1330882&r2=1330912&rev=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndex.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndex.java Thu Apr 26 15:54:48 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.query.index;
+package org.apache.jackrabbit.oak.spi;
 
 /**
  * Represents an index. The index should use the data in the filter if possible

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndexProvider.java (from r1330882, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndexProvider.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndexProvider.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndexProvider.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndexProvider.java&r1=1330882&r2=1330912&rev=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/QueryIndexProvider.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/QueryIndexProvider.java Thu Apr 26 15:54:48 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.query.index;
+package org.apache.jackrabbit.oak.spi;
 
 import java.util.List;
 import org.apache.jackrabbit.mk.api.MicroKernel;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java Thu Apr 26 15:54:48 2012
@@ -31,7 +31,7 @@ import org.apache.jackrabbit.mk.index.In
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.Result;
 import org.apache.jackrabbit.oak.api.ResultRow;
-import org.apache.jackrabbit.oak.query.index.QueryIndexProvider;
+import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
 import org.junit.Before;
 import org.junit.Test;
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java Thu Apr 26 15:54:48 2012
@@ -26,7 +26,7 @@ import java.util.Random;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
 import org.apache.jackrabbit.oak.query.ast.Operator;
-import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
+import org.apache.jackrabbit.oak.spi.Filter;
 import org.junit.Test;
 
 /**
@@ -39,7 +39,7 @@ public class FilterTest extends Abstract
         CoreValue one = vf.createValue("1");
         CoreValue two = vf.createValue("2");
 
-        Filter f = new Filter(null);
+        FilterImpl f = new FilterImpl(null);
         assertTrue(null == f.getPropertyRestriction("x"));
         f.restrictProperty("x", Operator.LESS_OR_EQUAL, two);
         assertEquals("..2]", f.getPropertyRestriction("x").toString());
@@ -52,7 +52,7 @@ public class FilterTest extends Abstract
         f.restrictProperty("x", Operator.EQUAL, two);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
+        f = new FilterImpl(null);
         f.restrictProperty("x", Operator.EQUAL, one);
         assertEquals("[1..1]", f.getPropertyRestriction("x").toString());
         f.restrictProperty("x", Operator.EQUAL, one);
@@ -64,13 +64,13 @@ public class FilterTest extends Abstract
         f.restrictProperty("x", Operator.GREATER_THAN, one);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
+        f = new FilterImpl(null);
         f.restrictProperty("x", Operator.EQUAL, one);
         assertEquals("[1..1]", f.getPropertyRestriction("x").toString());
         f.restrictProperty("x", Operator.LESS_THAN, one);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
+        f = new FilterImpl(null);
         f.restrictProperty("x", Operator.NOT_EQUAL, null);
         assertEquals("..", f.getPropertyRestriction("x").toString());
         f.restrictProperty("x", Operator.LESS_THAN, one);
@@ -101,13 +101,13 @@ public class FilterTest extends Abstract
         for (int i = 0; i < 10000; i++) {
             String p1 = paths.get(r.nextInt(paths.size()));
             String p2 = paths.get(r.nextInt(paths.size()));
-            PathRestriction r1 = PathRestriction.values()[r.nextInt(PathRestriction.values().length)];
-            PathRestriction r2 = PathRestriction.values()[r.nextInt(PathRestriction.values().length)];
-            Filter f1 = new Filter(null);
+            Filter.PathRestriction r1 = Filter.PathRestriction.values()[r.nextInt(Filter.PathRestriction.values().length)];
+            Filter.PathRestriction r2 = Filter.PathRestriction.values()[r.nextInt(Filter.PathRestriction.values().length)];
+            FilterImpl f1 = new FilterImpl(null);
             f1.restrictPath(p1, r1);
-            Filter f2 = new Filter(null);
+            FilterImpl f2 = new FilterImpl(null);
             f2.restrictPath(p2, r2);
-            Filter fc = new Filter(null);
+            FilterImpl fc = new FilterImpl(null);
             fc.restrictPath(p1, r1);
             fc.restrictPath(p2, r2);
             int tooMany = 0;
@@ -117,7 +117,7 @@ public class FilterTest extends Abstract
                 if (expected == got) {
                     // good
                 } else if (expected && !got) {
-                    fc = new Filter(null);
+                    fc = new FilterImpl(null);
                     fc.restrictPath(p1, r1);
                     fc.restrictPath(p2, r2);
                     fail("not matched: " + p1 + "/" + r1.name() + " && " + p2 + "/" + r2.name());
@@ -134,124 +134,124 @@ public class FilterTest extends Abstract
 
     @Test
     public void pathRestrictions() throws Exception {
-        Filter f = new Filter(null);
+        FilterImpl f = new FilterImpl(null);
         assertEquals("/", f.getPath());
-        assertEquals(PathRestriction.ALL_CHILDREN, f.getPathRestriction());
+        assertEquals(Filter.PathRestriction.ALL_CHILDREN, f.getPathRestriction());
 
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
-        f.restrictPath("/test2", PathRestriction.ALL_CHILDREN);
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
+        f.restrictPath("/test2", Filter.PathRestriction.ALL_CHILDREN);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
         assertEquals("/test", f.getPath());
-        assertEquals(PathRestriction.ALL_CHILDREN, f.getPathRestriction());
-        f.restrictPath("/test/x", PathRestriction.DIRECT_CHILDREN);
+        assertEquals(Filter.PathRestriction.ALL_CHILDREN, f.getPathRestriction());
+        f.restrictPath("/test/x", Filter.PathRestriction.DIRECT_CHILDREN);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
-        f.restrictPath("/test/x/y", PathRestriction.PARENT);
+        assertEquals(Filter.PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
+        f.restrictPath("/test/x/y", Filter.PathRestriction.PARENT);
         assertEquals("/test/x/y", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.DIRECT_CHILDREN);
-        f.restrictPath("/test/x/y", PathRestriction.PARENT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.DIRECT_CHILDREN);
+        f.restrictPath("/test/x/y", Filter.PathRestriction.PARENT);
         assertEquals("/test/x/y", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test/y", PathRestriction.DIRECT_CHILDREN);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test/y", Filter.PathRestriction.DIRECT_CHILDREN);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test/x/y", PathRestriction.PARENT);
-        f.restrictPath("/test/x", PathRestriction.EXACT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test/x/y", Filter.PathRestriction.PARENT);
+        f.restrictPath("/test/x", Filter.PathRestriction.EXACT);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.EXACT, f.getPathRestriction());
-        f.restrictPath("/test/y", PathRestriction.EXACT);
+        assertEquals(Filter.PathRestriction.EXACT, f.getPathRestriction());
+        f.restrictPath("/test/y", Filter.PathRestriction.EXACT);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
-        f.restrictPath("/test", PathRestriction.PARENT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
+        f.restrictPath("/test", Filter.PathRestriction.PARENT);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test/x", PathRestriction.PARENT);
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
+        f = new FilterImpl(null);
+        f.restrictPath("/test/x", Filter.PathRestriction.PARENT);
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test/x", PathRestriction.ALL_CHILDREN);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test/x", Filter.PathRestriction.ALL_CHILDREN);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
-        f.restrictPath("/test", PathRestriction.EXACT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
+        f.restrictPath("/test", Filter.PathRestriction.EXACT);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.DIRECT_CHILDREN);
-        f.restrictPath("/test/x", PathRestriction.EXACT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.DIRECT_CHILDREN);
+        f.restrictPath("/test/x", Filter.PathRestriction.EXACT);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.EXACT, f.getPathRestriction());
+        assertEquals(Filter.PathRestriction.EXACT, f.getPathRestriction());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.DIRECT_CHILDREN);
-        f.restrictPath("/test/x/y", PathRestriction.EXACT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.DIRECT_CHILDREN);
+        f.restrictPath("/test/x/y", Filter.PathRestriction.EXACT);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test/x", PathRestriction.PARENT);
-        f.restrictPath("/", PathRestriction.ALL_CHILDREN);
+        f = new FilterImpl(null);
+        f.restrictPath("/test/x", Filter.PathRestriction.PARENT);
+        f.restrictPath("/", Filter.PathRestriction.ALL_CHILDREN);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test/y", PathRestriction.EXACT);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test/y", Filter.PathRestriction.EXACT);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test", PathRestriction.DIRECT_CHILDREN);
+        f = new FilterImpl(null);
+        f.restrictPath("/test", Filter.PathRestriction.DIRECT_CHILDREN);
         assertEquals("/test", f.getPath());
-        assertEquals(PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
-        f.restrictPath("/", PathRestriction.ALL_CHILDREN);
+        assertEquals(Filter.PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
+        f.restrictPath("/", Filter.PathRestriction.ALL_CHILDREN);
         assertEquals("/test", f.getPath());
-        assertEquals(PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
+        assertEquals(Filter.PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
         assertEquals("/test", f.getPath());
-        assertEquals(PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
-        f.restrictPath("/test/x/y", PathRestriction.PARENT);
+        assertEquals(Filter.PathRestriction.DIRECT_CHILDREN, f.getPathRestriction());
+        f.restrictPath("/test/x/y", Filter.PathRestriction.PARENT);
         assertEquals("/test/x/y", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test2", PathRestriction.ALL_CHILDREN);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test2", Filter.PathRestriction.ALL_CHILDREN);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test/x", PathRestriction.EXACT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test/x", Filter.PathRestriction.EXACT);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.EXACT, f.getPathRestriction());
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
-        f.restrictPath("/test", PathRestriction.DIRECT_CHILDREN);
-        f.restrictPath("/test/x/y", PathRestriction.PARENT);
-        f.restrictPath("/test/y", PathRestriction.DIRECT_CHILDREN);
+        assertEquals(Filter.PathRestriction.EXACT, f.getPathRestriction());
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
+        f.restrictPath("/test", Filter.PathRestriction.DIRECT_CHILDREN);
+        f.restrictPath("/test/x/y", Filter.PathRestriction.PARENT);
+        f.restrictPath("/test/y", Filter.PathRestriction.DIRECT_CHILDREN);
         assertTrue(f.isAlwaysFalse());
 
-        f = new Filter(null);
-        f.restrictPath("/test/x/y", PathRestriction.PARENT);
+        f = new FilterImpl(null);
+        f.restrictPath("/test/x/y", Filter.PathRestriction.PARENT);
         assertEquals("/test/x/y", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test/x", PathRestriction.PARENT);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test/x", Filter.PathRestriction.PARENT);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test", PathRestriction.ALL_CHILDREN);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test", Filter.PathRestriction.ALL_CHILDREN);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test", PathRestriction.DIRECT_CHILDREN);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test", Filter.PathRestriction.DIRECT_CHILDREN);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test/x", PathRestriction.PARENT);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test/x", Filter.PathRestriction.PARENT);
         assertEquals("/test/x", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test", PathRestriction.PARENT);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test", Filter.PathRestriction.PARENT);
         assertEquals("/test", f.getPath());
-        assertEquals(PathRestriction.PARENT, f.getPathRestriction());
-        f.restrictPath("/test2", PathRestriction.EXACT);
+        assertEquals(Filter.PathRestriction.PARENT, f.getPathRestriction());
+        f.restrictPath("/test2", Filter.PathRestriction.EXACT);
         assertTrue(f.isAlwaysFalse());
 
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java?rev=1330912&r1=1330911&r2=1330912&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/TraversingCursorTest.java Thu Apr 26 15:54:48 2012
@@ -26,6 +26,7 @@ import java.util.Collections;
 import java.util.List;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.oak.spi.Cursor;
 import org.junit.Test;
 
 /**
@@ -52,7 +53,7 @@ public class TraversingCursorTest {
         String head = mk.getHeadRevision();
         head = mk.commit("/", "+ \"parents\": { \"p0\": {\"id\": \"0\"}, \"p1\": {\"id\": \"1\"}, \"p2\": {\"id\": \"2\"}}", head, "");
         head = mk.commit("/", "+ \"children\": { \"c1\": {\"p\": \"1\"}, \"c2\": {\"p\": \"1\"}, \"c3\": {\"p\": \"2\"}, \"c4\": {\"p\": \"3\"}}", head, "");
-        Filter f = new Filter(null);
+        FilterImpl f = new FilterImpl(null);
 
         f.setPath("/");
         List<String> paths = new ArrayList<String>();



Mime
View raw message