Package org.apache.jackrabbit.commons.iterator

Examples of org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter


            NodeState state = data.getNodeState();
            for (NodeId parentId : state.getSharedSet()) {
                list.add(itemMgr.getNode(getNodeId(), parentId));
            }
        }
        return new NodeIteratorAdapter(list);
    }
View Full Code Here


            try {
                Node root = getSession().getNode(sr);
                Set<Node> matchSet = new HashSet<Node>();
                collectNodes(value, Collections.singleton(propertyName), ntName, root.getNodes(), matchSet, true, 1);

                NodeIterator it = new NodeIteratorAdapter(matchSet);
                if (it.hasNext()) {
                    return it.nextNode();
                }
            } catch (PathNotFoundException e) {
                // should not get here
                log.warn("Error while retrieving node " + sr);
            }
View Full Code Here

        if (getSession().nodeExists(sr)) {
            try {
                Node root = getSession().getNode(sr);
                Set<Node> matchSet = new HashSet<Node>();
                collectNodes(value, propertyNames, ntName, root.getNodes(), matchSet, exact, maxSize);
                return new NodeIteratorAdapter(matchSet);
            } catch (PathNotFoundException e) {
                // should not get here
                log.warn("Error while retrieving node " + sr);
            }
        } // else: searchRoot does not exist yet -> omit the search
View Full Code Here

                Node root = getSession().getNode(sr);
                Map<String, Node> matchingNodes = new HashMap<String, Node>();
                collectNodes(value, path, pred, root.getNodes(), matchingNodes, exact, maxSize);

                return new NodeIteratorAdapter(matchingNodes.values());
            } catch (PathNotFoundException e) {
                // should not get here
                log.warn("Error while retrieving node " + sr);
            }
        } // else: searchRoot does not exist yet -> omit the search
View Full Code Here

     * @param nodes the expected nodes in the result set.
     * @throws RepositoryException if an error occurs while reading from the result.
     */
    protected void checkResult(RowIterator result, Node[] nodes)
            throws RepositoryException {
        checkResult(new NodeIteratorAdapter(result) {
            public Object next() throws NoSuchElementException {
                Row next = (Row) super.next();
                try {
                    return superuser.getItem(next.getValue("jcr:path").getString());
                } catch (RepositoryException e) {
View Full Code Here

        };
        final PrefetchIterator<NodeImpl<? extends NodeDelegate>> prefIt = new  PrefetchIterator<NodeImpl<? extends NodeDelegate>>(
                nodeIterator,
                PREFETCH_MIN, PREFETCH_TIMEOUT, PREFETCH_MAX,
                result.getSize());
        return new NodeIteratorAdapter(prefIt) {
            @Override
            public long getSize() {
                return prefIt.size();
            }
        };
View Full Code Here

        };
        final PrefetchIterator<NodeImpl<? extends NodeDelegate>> prefIt = new  PrefetchIterator<NodeImpl<? extends NodeDelegate>>(
                nodeIterator,
                PREFETCH_MIN, PREFETCH_TIMEOUT, PREFETCH_MAX,
                result.getSize());
        return new NodeIteratorAdapter(prefIt) {
            @Override
            public long getSize() {
                return prefIt.size();
            }
        };
View Full Code Here

            NodeState state = data.getNodeState();
            for (NodeId parentId : state.getSharedSet()) {
                list.add(itemMgr.getNode(getNodeId(), parentId));
            }
        }
        return new NodeIteratorAdapter(list);
    }
View Full Code Here

     * @param nodes the expected nodes in the result set.
     * @throws RepositoryException if an error occurs while reading from the result.
     */
    protected void checkResult(RowIterator result, Node[] nodes)
            throws RepositoryException {
        checkResult(new NodeIteratorAdapter(result) {
            public Object next() throws NoSuchElementException {
                Row next = (Row) super.next();
                try {
                    return superuser.getItem(next.getValue("jcr:path").getString());
                } catch (RepositoryException e) {
View Full Code Here

    public NodeIterator getNodes() throws RepositoryException {
        return perform(new NodeOperation<NodeIterator>(dlg) {
            @Override
            public NodeIterator perform() throws RepositoryException {
                Iterator<NodeDelegate> children = node.getChildren();
                return new NodeIteratorAdapter(nodeIterator(children)) {
                    private long size = -2;
                    @Override
                    public long getSize() {
                        if (size == -2) {
                            try {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter

Copyright © 2018 www.massapicom. 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.