Package org.apache.jackrabbit.mk.model

Examples of org.apache.jackrabbit.mk.model.ChildNodeEntry


        }

        return new AbstractRangeIterator<String>(getEntries(offset, count), 0, -1) {
            @Override
            protected String doNext() {
                ChildNodeEntry cne = (ChildNodeEntry) it.next();
                return cne.getName();
            }
        };
    }
View Full Code Here


    @Override
    public ChildNodeEntry rename(String oldName, String newName) {
        if (oldName.equals(newName)) {
            return get(oldName);
        }
        ChildNodeEntry old = remove(oldName);
        if (old == null) {
            return null;
        }
        add(new ChildNodeEntry(newName, old.getId()));
        return old;
    }
View Full Code Here

        }
        // todo optimize
        return new AbstractFilteringIterator<ChildNodeEntry>(getEntries(0, -1)) {
            @Override
            protected boolean include(ChildNodeEntry entry) {
                ChildNodeEntry namesake = other.get(entry.getName());
                return (namesake != null && !namesake.getId().equals(entry.getId()));
            }
        };
    }
View Full Code Here

        IndexEntry ie = index[hash];
        if (ie == null) {
            return null;
        }
        if (ie instanceof ChildNodeEntry) {
            ChildNodeEntry cne = (ChildNodeEntry) ie;
            return cne.getName().equals(name) ? cne : null;
        }
        ChildNodeEntries container = ((ContainerEntry) ie).getContainer();
        if (container != null) {
            return container.get(name);
        }
View Full Code Here

            index[hash] = new NodeEntry(entry.getName(), entry.getId());
            count++;
            return null;
        }
        if (ie instanceof ChildNodeEntry) {
            ChildNodeEntry existing = (ChildNodeEntry) ie;
            if (existing.getName().equals(entry.getName())) {
                index[hash] = new NodeEntry(entry.getName(), entry.getId());
                return existing;
            } else {
                ContainerEntry ce = createContainerEntry();
                ce.getContainer().add(existing);
                ce.getContainer().add(entry);
                index[hash] = ce;
                count++;
                return null;
            }
        }
        ContainerEntry ce = (ContainerEntry) ie;
        ChildNodeEntries container = ce.getContainer();
        ChildNodeEntry existing = container.add(entry);
        if (entry.equals(existing)) {
            // no-op
            return existing;
        }
        ce.setDirty(container);
View Full Code Here

        IndexEntry ie = index[hash];
        if (ie == null) {
            return null;
        }
        if (ie instanceof ChildNodeEntry) {
            ChildNodeEntry existing = (ChildNodeEntry) ie;
            if (existing.getName().equals(name)) {
                index[hash] = null;
                count--;
                return existing;
            } else {
                return null;
            }
        }
        ContainerEntry ce = (ContainerEntry) ie;
        ChildNodeEntries container = ce.getContainer();
        ChildNodeEntry existing = container.remove(name);
        if (existing == null) {
            return null;
        }
        if (container.getCount() == 0) {
            index[hash] = null;
        } else if (container.getCount() == 1) {
            // inline single remaining entry
            ChildNodeEntry remaining = container.getEntries(0, 1).next();
            index[hash] = new NodeEntry(remaining.getName(), remaining.getId());
        } else {
            ce.setDirty(container);
        }
        count--;
        return existing;
View Full Code Here

                continue;
            }
           
            // optimization for simple child node entries
            if (ie1 instanceof ChildNodeEntry && ie2 instanceof ChildNodeEntry) {
                ChildNodeEntry cne1 = (ChildNodeEntry) ie1;
                ChildNodeEntry cne2 = (ChildNodeEntry) ie2;
               
                if (cne2.getName().equals(cne1.getName())) {
                    added.add(cne2);
                }
                continue;
            }
           
View Full Code Here

                continue;
            }

            // optimization for simple child node entries
            if (ie1 instanceof ChildNodeEntry && ie2 instanceof ChildNodeEntry) {
                ChildNodeEntry cne1 = (ChildNodeEntry) ie1;
                ChildNodeEntry cne2 = (ChildNodeEntry) ie2;
               
                if (cne1.getName().equals(cne2.getName()) && !cne1.getId().equals(cne2.getId())) {
                    modified.add(cne1);
                    continue;
                }
            }
               
View Full Code Here

        }
        markedNodes++;
       
        Iterator<ChildNodeEntry> iter = node.getChildNodeEntries(0, -1);
        while (iter.hasNext()) {
            ChildNodeEntry c = iter.next();
            markNode(getNode(c.getId()));
        }
    }
View Full Code Here

            throw new IllegalArgumentException("illegal path");
        }

        StoredNode node = rs.getRootNode(revId);
        for (String name : PathUtils.elements(path)) {
            ChildNodeEntry cne = node.getChildNodeEntry(name);
            if (cne == null) {
                throw new NotFoundException();
            }
            node = rs.getNode(cne.getId()) ;
        }
        return node;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.model.ChildNodeEntry

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.