Examples of NodeState


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

        if (isRoot() || !exists() || newParent.hasChildNode(newName)) {
            return false;
        } else {
            if (newParent.exists()) {
                annotateSourcePath();
                NodeState nodeState = getNodeState();
                newParent.setChildNode(newName, nodeState);
                remove();
                return true;
            } else {
                return false;
View Full Code Here

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

            return head.getValue(Type.STRING);
        }
    }

    private boolean isTransientlyAdded(String path) {
        NodeState node = rootBuilder.getBaseState();
        for (String name : PathUtils.elements(path)) {
            node = node.getChildNode(name);
        }
        return !node.exists();
    }
View Full Code Here

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

        @Override
        public Head update() {
            long rootRevision = rootHead().revision;
            if (revision != rootRevision) {
                // root revision changed: recursively re-get state from parent
                NodeState parentState = parent.head().getCurrentNodeState();
                NodeState newState = parentState.getChildNode(name);
                if (newState instanceof MutableNodeState) {
                    // transition state to ConnectedHead
                    return new ConnectedHead((MutableNodeState) newState);
                } else {
                    // update to match the latest revision
View Full Code Here

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

            definition.child(INDEX_CONTENT_NODE_NAME);

            // check uniqueness constraints when leaving the root
            if (keysToCheckForUniqueness != null
                    && !keysToCheckForUniqueness.isEmpty()) {
                NodeState indexMeta = definition.getNodeState();
                IndexStoreStrategy s = getStrategy(true);
                for (String key : keysToCheckForUniqueness) {
                    if (s.count(indexMeta, singleton(key), 2) > 1) {
                        throw new CommitFailedException(
                                CONSTRAINT, 30,
View Full Code Here

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

                addAll(orderedChildNames, node.getChildNodeNames());
            }

            int index = 0;
            for (String childName : orderedChildNames) {
                NodeState ace = node.getChildNode(childName);
                if (isACE.apply(ace)) {
                    AcEntry entry = new AcEntry(ace, accessControlledPath, index);
                    List<AcEntry> list = entries.get(entry.principalName);
                    if (list == null) {
                        list = new ArrayList<AcEntry>();
View Full Code Here

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

        });
        return relPaths;
    }

    private static boolean isLive(NodeState root) {
        NodeState def = getIndexDef(root);
        if (def == null) {
            return false;
        }
        String type = def.getString(PERSISTENCE_NAME);
        if (type == null || PERSISTENCE_OAK.equalsIgnoreCase(type)) {
            return getIndexDataNode(def) != null;
        }

        if (PERSISTENCE_FILE.equalsIgnoreCase(type)) {
            return def.getString(PERSISTENCE_PATH) != null;
        }

        return false;
    }
View Full Code Here

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

        return false;
    }

    private static Directory newDirectory(NodeState root) {
        NodeState def = getIndexDef(root);
        if (def == null) {
            return null;
        }

        String type = def.getString(PERSISTENCE_NAME);
        if (type == null || PERSISTENCE_OAK.equalsIgnoreCase(type)) {
            NodeState index = getIndexDataNode(def);
            if (index == null) {
                return null;
            }
            return new OakDirectory(new ReadOnlyBuilder(index));
        }
View Full Code Here

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

        return null;
    }

    private static NodeState getIndexDef(NodeState node) {
        NodeState state = node.getChildNode(INDEX_DEFINITIONS_NAME);
        for (ChildNodeEntry entry : state.getChildNodeEntries()) {
            NodeState ns = entry.getNodeState();
            if (TYPE_LUCENE.equals(ns.getString(TYPE_PROPERTY_NAME))) {
                return ns;
            }
        }
        return null;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NodeState

    public PageNode getChild(String name) {
        return getNode(name);
    }

    public NodeState getState() {
        return new NodeState(labels.getSimple(), icon, startPublicationDate == null ? -1 : startPublicationDate.getTime(),
                endPublicationDate == null ? -1 : endPublicationDate.getTime(), visibility,
                pageReference != null ? PageKey.parse(pageReference) : null);
    }
View Full Code Here

Examples of org.jclouds.compute.domain.NodeState

     */
    public Predicate<NodeMetadata> getNodePredicate(Exchange exchange) {
        final String nodeId = getNodeId(exchange);
        final String imageId = getImageId(exchange);
        final String group = getGroup(exchange);
        final NodeState queryState = getNodeState(exchange);

        Predicate<NodeMetadata> predicate = new Predicate<NodeMetadata>() {
            public boolean apply(NodeMetadata metadata) {
                if (nodeId != null && !nodeId.equals(metadata.getId())) {
                    return false;
                }
                if (imageId != null && !imageId.equals(metadata.getImageId())) {
                    return false;
                }
                if (queryState != null && !queryState.equals(metadata.getState())) {
                    return false;
                }
                if (group != null && !group.equals(metadata.getGroup())) {
                    return false;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.