Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeInfo


    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
        // TODO: implement batch read properly:
        // currently: missing 'value/values' property PropertyInfo cannot be built
        // currently: missing prop-names with child-NodeInfo
        List<ItemInfo> l = new ArrayList<ItemInfo>();
        NodeInfo nInfo = getNodeInfo(sessionInfo, nodeId);
        l.add(nInfo);
        // at least add propertyInfos for the meta-props already known from the
        // nodeInfo.
        l.addAll(buildPropertyInfos(nInfo));
        return l.iterator();
View Full Code Here


        } catch (NameException e) {
            // ignore. should never occur
        }
        int depth = batchReadConfig.getDepth(ntName);
        if (depth == BatchReadConfig.DEPTH_DEFAULT) {
            NodeInfo info;
            try {
                info = new NodeInfoImpl(node, idFactory, sInfo.getNamePathResolver());
            } catch (NameException e) {
                throw new RepositoryException(e);
            }
View Full Code Here

    @Override
    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, NodeId nodeId)
            throws ItemNotFoundException, RepositoryException {

        roundTripCount++;
        NodeInfo nodeInfo = itemInfoStore.getNodeInfo(nodeId);
        return iteratorChain(singleton(nodeInfo), getBatch());
    }
View Full Code Here

        if (create) {
            createTestNode(path);
            testPath  = path;
        }

        NodeInfo nInfo = rs.getNodeInfo(si, getNodeId(path));
        //System.out.println("NodeInfo: " + nInfo.getPath().getNameElement().getName());
        assertEquals(testName, nInfo.getPath().getNameElement().getName());

        Iterator<? extends ItemInfo > it = rs.getItemInfos(si, getNodeId(path));
        assertTrue(it.hasNext());
        nInfo = (NodeInfo) it.next();
        //System.out.println("ItemInfo: " + nInfo.getPath().getNameElement().getName());
        assertEquals(testName, nInfo.getPath().getNameElement().getName());
    }
View Full Code Here

         Name testName = resolver.getQName("test");
         testPath = "/test";
         createTestNode("/test");
         createTestNode("/test");

         NodeInfo nInfo = rs.getNodeInfo(si, getNodeId("/test[2]"));
         //System.out.println("NodeInfo: " + nInfo.getPath().getNameElement().getName());
         assertEquals(testName, nInfo.getPath().getNameElement().getName());

         Iterator<? extends ItemInfo> it = rs.getItemInfos(si, getNodeId("/test[2]"));
         assertTrue(it.hasNext());
         nInfo = (NodeInfo) it.next();
         //System.out.println("ItemInfo: " + nInfo.getPath().getNameElement().getName());
         assertEquals(testName, nInfo.getPath().getNameElement().getName());

         removeTestNode("/test[2]");
     }
View Full Code Here

    public NodeState createNodeState(NodeId nodeId, NodeEntry entry) throws ItemNotFoundException,
            RepositoryException {

        try {
            Entry<NodeInfo> cached = cache.getNodeInfo(nodeId);
            NodeInfo info;
            if (isUpToDate(cached, entry)) {
                info = cached.info;
            } else {
                // otherwise retreive item info from service and cache the whole batch
                Iterator<? extends ItemInfo> infos = service.getItemInfos(sessionInfo, nodeId);
View Full Code Here

        try {
            // Get item info from cache
            Iterator<? extends ItemInfo> infos = null;
            Entry<NodeInfo> cached = cache.getNodeInfo(nodeId);
            NodeInfo info;
            if (cached == null) {
                // or from service if not in cache
                infos = service.getItemInfos(sessionInfo, nodeId);
                info = first(infos, null, 0);
                if (info == null) {
View Full Code Here

    }

    public void object() throws IOException {
        if (name != null) {
            try {
                NodeInfo current = getCurrentNodeInfo();
                Path relPath = pFactory.create(name, index);
                NodeId id = idFactory.createNodeId(current.getId(), relPath);
                Path currentPath = current.getPath();
                Path p = pFactory.create(currentPath, relPath, true);
                NodeInfo nInfo = new NodeInfoImpl(id, p);
                nodeInfos.push(nInfo);
                itemInfos.add(nInfo);
            } catch (RepositoryException e) {
                throw new IOException(e.getMessage());
            }
View Full Code Here

    public void endObject() throws IOException {
        try {
            NodeInfoImpl nInfo = (NodeInfoImpl) nodeInfos.pop();
            nInfo.resolveUUID(idFactory);
            NodeInfo parent = getCurrentNodeInfo();
            if (parent != null) {
                if (nInfo.getPath().getAncestor(1).equals(parent.getPath())) {
                    ChildInfo ci = new ChildInfoImpl(nInfo.getName(), nInfo.getUniqueID(), nInfo.getIndex());
                    ((NodeInfoImpl) parent).addChildInfo(ci);
                } else {
                    log.debug("NodeInfo '"+ nInfo.getPath() + "' out of hierarchy. Parent path = " + parent.getPath());
                }
            }
            if (!nInfo.isCompleted()) {
                log.debug("Incomplete NodeInfo '"+ nInfo.getPath() + "' -> Only present as ChildInfo with its parent.");
                itemInfos.remove(nInfo);
View Full Code Here

    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
        // TODO: implement batch read properly:
        // currently: missing 'value/values' property PropertyInfo cannot be built
        // currently: missing prop-names with child-NodeInfo
        List<ItemInfo> l = new ArrayList<ItemInfo>();
        NodeInfo nInfo = getNodeInfo(sessionInfo, nodeId);
        l.add(nInfo);
        // at least add propertyInfos for the meta-props already known from the
        // nodeInfo.
        l.addAll(buildPropertyInfos(nInfo));
        return l.iterator();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.NodeInfo

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.