Package org.apache.jackrabbit.oak.spi.state

Examples of org.apache.jackrabbit.oak.spi.state.NodeStateBuilder


        return getNodeState().getProperties();
    }

    @Override
    public TreeImpl getChild(String name) {
        NodeStateBuilder childBuilder = builder.getChildBuilder(name);
        if (childBuilder == null) {
            return null;
        }
        else {
            NodeState childBaseState = baseState == null
View Full Code Here


                        getNodeState().getChildNodeEntries().iterator();

                return Iterators.map(childEntries, new Function1<ChildNodeEntry, Tree>() {
                    @Override
                    public Tree apply(ChildNodeEntry entry) {
                        NodeStateBuilder childBuilder = builder.getChildBuilder(entry.getName());
                        return new TreeImpl(store, childBuilder.getNodeState(), childBuilder, TreeImpl.this, entry.getName(), listener);
                    }
                });
            }
        };
    }
View Full Code Here

    }

    @Override
    public void touchFile(String name) throws IOException {
        NodeState file = getDirectory().getChildNode(name);
        NodeStateBuilder builder = store.getBuilder(file);
        builder.setProperty(
                "jcr:lastModified",
                factory.createValue(System.currentTimeMillis()));
        directoryBuilder.setNode(name, builder.getNodeState());
        directory = null;
    }
View Full Code Here

            if (data.length > size) {
                data = new byte[size];
                System.arraycopy(buffer, 0, data, 0, size);
            }

            NodeStateBuilder fileBuilder =
                    store.getBuilder(getDirectory().getChildNode(name));
            fileBuilder.setProperty(
                    "jcr:lastModified",
                    factory.createValue(System.currentTimeMillis()));
            fileBuilder.setProperty(
                    "jcr:data",
                    factory.createValue(new ByteArrayInputStream(data)));

            directoryBuilder.setNode(name, fileBuilder.getNodeState());
            directory = null;
        }
View Full Code Here

    }

    @Override
    public Tree addChild(String name) {
        if (!hasChild(name)) {
            NodeStateBuilder builder = getNodeStateBuilder();
            builder.setNode(name, EMPTY_NODE);
            updateParentState(builder.getNodeState());
        }

        TreeImpl child = getChild(name);
        assert child != null;
        return child;
View Full Code Here

    }

    @Override
    public boolean removeChild(String name) {
        if (hasChild(name)) {
            NodeStateBuilder builder = getNodeStateBuilder();
            builder.removeNode(name);
            children.remove(name);
            updateParentState(builder.getNodeState());
            return true;
        }
        else {
            return false;
        }
View Full Code Here

        }
    }

    @Override
    public PropertyState setProperty(String name, CoreValue value) {
        NodeStateBuilder builder = getNodeStateBuilder();
        builder.setProperty(name, value);
        updateParentState(builder.getNodeState());
        PropertyState property = getProperty(name);
        assert property != null;
        return property;
    }
View Full Code Here

        return property;
    }

    @Override
    public PropertyState setProperty(String name, List<CoreValue> values) {
        NodeStateBuilder builder = getNodeStateBuilder();
        builder.setProperty(name, values);
        updateParentState(builder.getNodeState());
        PropertyState property = getProperty(name);
        assert property != null;
        return property;
    }
View Full Code Here

        return property;
    }

    @Override
    public void removeProperty(String name) {
        NodeStateBuilder builder = getNodeStateBuilder();
        builder.removeProperty(name);
        updateParentState(builder.getNodeState());
    }
View Full Code Here

            return nodeStateBuilder.getNodeState();
        }
    }

    protected void updateParentState(NodeState childState) {
        NodeStateBuilder parentBuilder = parent.getNodeStateBuilder();
        parentBuilder.setNode(name, childState);
        parent.updateParentState(parentBuilder.getNodeState());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.state.NodeStateBuilder

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.