Examples of FilterImpl


Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

            c.setProperty("foo", "azerty");
        }
        NodeState after = builder.getNodeState();
        NodeState indexed = HOOK.processCommit(before, after);

        FilterImpl f = createFilter(indexed, NT_BASE);

        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        double cost = lookup.getCost(f, "foo",
                PropertyValues.newString("azerty"));
        double traversal = new TraversingIndex().getCost(f, indexed);
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

        }
        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after);

        FilterImpl f = createFilter(indexed, NT_BASE);

        // Query the index
        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        assertEquals(ImmutableSet.of("a", "b"), find(lookup, "foo", "abc", f));
        assertEquals(ImmutableSet.of("b"), find(lookup, "foo", "def", f));
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

        NodeState after = builder.getNodeState();

        // Add an index
        NodeState indexed = HOOK.processCommit(before, after);

        FilterImpl f = createFilter(indexed, NT_BASE);

        // Query the index
        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        assertEquals(ImmutableSet.of("a", "b"), find(lookup, "foo", "abc", f));
        assertEquals(ImmutableSet.of("b"), find(lookup, "foo", "def", f));
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

                .setProperty("foo", Arrays.asList("abc", "def"), Type.STRINGS);
        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after);

        FilterImpl f = createFilter(indexed, NT_UNSTRUCTURED);

        // Query the index
        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        assertEquals(ImmutableSet.of("a", "b"), find(lookup, "foo", "abc", f));
        assertEquals(ImmutableSet.of("b"), find(lookup, "foo", "def", f));
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

    private static FilterImpl createFilter(NodeState root, String nodeTypeName) {
        NodeState system = root.getChildNode(JCR_SYSTEM);
        NodeState types = system.getChildNode(JCR_NODE_TYPES);
        NodeState type = types.getChildNode(nodeTypeName);
        SelectorImpl selector = new SelectorImpl(type, nodeTypeName);
        return new FilterImpl(selector, "SELECT * FROM [" + nodeTypeName + "]");
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

        NodeState after = builder.getNodeState();

        // Add an index
        NodeState indexed = HOOK.processCommit(before, after);

        FilterImpl f = createFilter(after, NT_UNSTRUCTURED);

        // Query the index
        PropertyIndexLookup lookup = new PropertyIndexLookup(indexed);
        assertEquals(ImmutableSet.of("a", "b"), find(lookup, "foo", "abc", f));
        assertEquals(ImmutableSet.of("b"), find(lookup, "foo", "def", f));
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after);

        QueryIndex queryIndex = new LuceneIndex(analyzer, null);
        FilterImpl filter = createFilter(NT_BASE);
        filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertTrue(cursor.hasNext());
        assertEquals("/", cursor.next().getPath());
        assertFalse(cursor.hasNext());
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after);

        QueryIndex queryIndex = new LuceneIndex(analyzer, null);
        FilterImpl filter = createFilter(NT_BASE);
        // filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);

        assertTrue(cursor.hasNext());
        assertEquals("/a/b/c", cursor.next().getPath());
View Full Code Here

Examples of org.apache.jackrabbit.oak.query.index.FilterImpl

        NodeState after = builder.getNodeState();

        NodeState indexed = HOOK.processCommit(before, after);

        QueryIndex queryIndex = new LuceneIndex(analyzer, null);
        FilterImpl filter = createFilter(NT_BASE);
        // filter.restrictPath("/", Filter.PathRestriction.EXACT);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);

        assertTrue(cursor.hasNext());
        assertEquals("/a", cursor.next().getPath());
View Full Code Here

Examples of org.eclipse.osgi.framework.internal.core.FilterImpl

        return false;
      String platformFilter = description.getPlatformFilter();
      if (platformFilter != null) {
        try {
          // add any new platform filter propery keys this bundle is using
          FilterImpl filter = FilterImpl.newInstance(platformFilter);
          addPlatformPropertyKeys(filter.getAttributes());
        } catch (InvalidSyntaxException e) {
          // ignore this is handled in another place
        }
      }
      NativeCodeSpecification nativeCode = description.getNativeCodeSpecification();
      if (nativeCode != null) {
        NativeCodeDescription[] suppliers = nativeCode.getPossibleSuppliers();
        for (int i = 0; i < suppliers.length; i++) {
          FilterImpl filter = (FilterImpl) suppliers[i].getFilter();
          if (filter != null)
            addPlatformPropertyKeys(filter.getAttributes());
        }
      }
      resolved = false;
      getDelta().recordBundleAdded((BundleDescriptionImpl) description);
      if (getSystemBundle().equals(description.getSymbolicName()))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.