Package org.apache.jackrabbit.oak.jcr.state.ChangeTree

Examples of org.apache.jackrabbit.oak.jcr.state.ChangeTree.NodeDelta


    }

    public TransientNodeState getNodeState(Path path) {
        TransientNodeState state = cache == null ? null : cache.get(path);
        if (state == null) {
            NodeDelta delta = transientSpace.getNodeDelta(path);
            if (delta == null) {
                return null;
            }
            state = new TransientNodeState(sessionContext, delta);
            if (cache != null) {
View Full Code Here


    /**
     * @return {@code true} iff this node has been transiently added.
     */
    public boolean isNew() {
        NodeDelta delta = getNodeDelta();
        return delta.isTransient() && !delta.isRemoved();
    }
View Full Code Here

     * @param name The name of the new node.
     * @return the added node
     * @throws javax.jcr.ItemExistsException if a node with that name exists already.
     */
    public TransientNodeState addNode(String name) throws ItemExistsException {
        NodeDelta child = getNodeDelta().addNode(name);
        return getNodeState(child);
    }
View Full Code Here

                    protected Iterator<? extends ChildNodeEntry> getPage(long pos, int size) {
                        return getPersistentNodeState().getChildNodeEntries(pos, size).iterator();
                    }
                });

        final NodeDelta delta = getNodeDelta();

        Iterator<ChildNodeEntry> unmodifiedEntries = Iterators.filter(persistedEntries,
            new Predicate<ChildNodeEntry>() {
                @Override
                public boolean evaluate(ChildNodeEntry entry) {
                    return !delta.isNodeModified(entry.getName());
                }
            });

        Iterator<TransientNodeState> unmodifiedStates = Iterators.map(unmodifiedEntries,
            new Function1<ChildNodeEntry, TransientNodeState>() {
                @Override
                public TransientNodeState apply(ChildNodeEntry entry) {
                    return getNodeState(delta.getNode(entry.getName()));
                }
            });

        Iterator<TransientNodeState> modifiedStates = Iterators.map(toIterable(delta.getNodes()).iterator(),
            new Function1<NodeDelta, TransientNodeState>() {
                @Override
                public TransientNodeState apply(NodeDelta delta) {
                    return getNodeState(delta);
                }
View Full Code Here

    /**
     * @return Iterator of all property states of this instance.
     */
    public Iterator<PropertyState> getProperties() {
        Iterable<? extends PropertyState> propertyStates = getPersistentNodeState().getProperties();
        final NodeDelta delta = getNodeDelta();

        Iterator<PropertyState> propertyEntries =
            Iterators.filter(propertyStates.iterator(),
                new Predicate<PropertyState>() {
                    @Override
                    public boolean evaluate(PropertyState state) {
                        return !state.getName().startsWith(":") && !delta.hasProperty(state.getName());
                    }
                });

        Iterator<PropertyState> modifiedProperties = delta.getPropertyStates();
        return Iterators.chain(propertyEntries, Iterators.toIterable(modifiedProperties).iterator());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.jcr.state.ChangeTree.NodeDelta

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.