Examples of FilterImpl


Examples of com.sogou.qadev.service.cynthia.bean.impl.FilterImpl

      while(rs.next()){
        UUID id = DataAccessFactory.getInstance().createUUID(rs.getObject("id").toString());
        String createUser = rs.getString("create_user");
        Timestamp createTime = rs.getTimestamp("create_time");

        Filter filter = new FilterImpl(id, createUser, createTime, null);
        filter.setName(rs.getString("name"));
        filter.setXml(rs.getString("xml"));
        filter.setAnd(rs.getBoolean("is_and"));
        filter.setPublic(rs.getBoolean("is_public"));
        filter.setVisible(rs.getBoolean("is_visible"));

        filterList.add(filter);
      }
    }
    catch(Exception e){
      e.printStackTrace();
    }
    finally{
      DbPoolConnection.getInstance().closeResultSet(rs);
      DbPoolConnection.getInstance().closeStatment(pstm);
      DbPoolConnection.getInstance().closeConn(conn);
    }

    Map<UUID, Boolean> templateAllowMap = new HashMap<UUID, Boolean>();
    Map<UUID, List<Template>> allTemplateTypeMap = new HashMap<UUID, List<Template>>();
    Map<UUID, Template> allTemplateMap = new HashMap<UUID, Template>();
    Map<UUID, Flow> allFlowMap = new HashMap<UUID, Flow>();
   
    Iterator<Filter> filterItr = filterList.iterator();
    while(filterItr.hasNext()){
      Filter filter = filterItr.next();

      Document xmlDoc = null;
      try{
        xmlDoc = XMLUtil.string2Document(filter.getXml(), "UTF-8");
      }
      catch(Exception e){
        e.printStackTrace();
        System.err.println("error filter id: " + filter.getId());
      }

      if(xmlDoc == null){
        filterItr.remove();
        continue;
View Full Code Here

Examples of org.apache.felix.framework.FilterImpl


    @Test
    public void matchByDependencyId() throws InvalidSyntaxException {
        Dictionary<String, ?> dictionary = DependencyProperties.getDependencyProperties(dependency);
        Filter filter = new FilterImpl("(dependency.id=foo)");
        assertThat(filter.match(dictionary));
    }
View Full Code Here

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

     * @param preparing whether a filter for the prepare phase should be made
     * @return the filter
     */
    @Override
    public Filter createFilter(boolean preparing) {
        FilterImpl f = new FilterImpl(this, query.getStatement());
        f.setPreparing(preparing);
        if (joinCondition != null) {
            joinCondition.restrict(f);
        }
        // rep:excerpt handling: create a (fake) restriction
        // "rep:excerpt is not null" to let the index know that
        // we will need the excerpt
        for (ColumnImpl c : query.getColumns()) {
            if (c.getSelector() == this) {
                if (c.getColumnName().equals("rep:excerpt")) {
                    f.restrictProperty("rep:excerpt", Operator.NOT_EQUAL, null);
                }
            }
        }
       
        // all conditions can be pushed to the selectors -
        // except in some cases to "outer joined" selectors,
        // but the exceptions are handled in the condition
        // itself.
        // An example where it *is* a problem:
        //  "select * from a left outer join b on a.x = b.y
        // where b.y is null" - in this case the selector b
        // must not use an index condition on "y is null"
        // (".. is null" must be written as "not .. is not null").
        if (queryConstraint != null) {
            queryConstraint.restrict(f);
            FullTextExpression ft = queryConstraint.getFullTextConstraint(this);
            f.setFullTextConstraint(ft);
        }

        return f;
    }
View Full Code Here

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

        NodeState indexRoot = root.getChildNode(INDEX_DEFINITIONS_NAME)
                .getChildNode(NAME);
        if (!indexRoot.exists()) {
            return newPathCursor(new ArrayList<String>());
        }
        Iterable<String> paths = STORE.query(new FilterImpl(), index + "("
                + uuid + ")", indexRoot, index, ImmutableSet.of(uuid));

        if (!"*".equals(name)) {
            paths = filter(paths, new Predicate<String>() {
                @Override
View Full Code Here

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

        store.merge(root, new EditorHook(new IndexUpdateProvider(
                new PropertyIndexEditorProvider())), PostCommitHook.EMPTY);

        NodeState rootState = store.getRoot();
        NodeTypeIndex index = new NodeTypeIndex();
        FilterImpl filter;

        filter = createFilter(rootState, JcrConstants.NT_FOLDER);
        assertEquals(2.0, index.getCost(filter, rootState), 0.0);
        checkCursor(index.query(filter, rootState), "/folder-1", "/folder-2");
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 + "]", null);
    }
View Full Code Here

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

                newAggregationFilter(filter), rootState),
                baseIndex.getNodeAggregator(), rootState);
    }

    private static Filter newAggregationFilter(Filter filter) {
        FilterImpl f = new FilterImpl(filter);
        // disables node type checks for now
        f.setMatchesAllTypes(true);

        // TODO OAK-828
        // FullTextExpression constraint = filter.getFullTextConstraint();
        // constraint = getFlatConstraint(constraint);
        // f.setFullTextConstraint(constraint);
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 SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictPath("/newnode", Filter.PathRestriction.EXACT);
        filter.restrictProperty("prop", Operator.EQUAL,
                PropertyValues.newString("val"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
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 SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        Cursor cursor = queryIndex.query(filter, indexed);
        assertNotNull(cursor);
        assertTrue("no results found", cursor.hasNext());
        IndexRow next = cursor.next();
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 SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(null, null);
        filter.restrictProperty("foo", Operator.EQUAL,
                PropertyValues.newString("bar"));
        filter.restrictFulltextCondition("bar");
        Cursor cursor = queryIndex.query(filter, indexed);

        Set<String> paths = newHashSet();
        while (cursor.hasNext()) {
            paths.add(cursor.next().getPath());
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.