Package org.modeshape.jcr.cache

Examples of org.modeshape.jcr.cache.CachedNode


    }

    public NodeKey indexesKey() {
        if (indexesKey == null) {
            // This is idempotent, so no need to lock
            CachedNode systemNode = systemNode();
            ChildReference nodeTypesRef = systemNode.getChildReferences(system).getChild(ModeShapeLexicon.INDEXES);
            indexesKey = nodeTypesRef.getKey();
        }
        return indexesKey;
    }
View Full Code Here


    }

    public NodeKey namespacesKey() {
        if (namespacesKey == null) {
            // This is idempotent, so no need to lock
            CachedNode systemNode = systemNode();
            ChildReference namespacesRef = systemNode.getChildReferences(system).getChild(ModeShapeLexicon.NAMESPACES);
            namespacesKey = namespacesRef.getKey();
        }
        return namespacesKey;
    }
View Full Code Here

    }

    public NodeKey locksKey() {
        if (locksKey == null) {
            // This is idempotent, so no need to lock
            CachedNode systemNode = systemNode();
            ChildReference locksRef = systemNode.getChildReferences(system).getChild(ModeShapeLexicon.LOCKS);
            locksKey = locksRef.getKey();
        }
        return locksKey;
    }
View Full Code Here

    }

    public NodeKey versionStorageKey() {
        if (versionStorageKey == null) {
            // This is idempotent, so no need to lock
            CachedNode systemNode = systemNode();
            ChildReference locksRef = systemNode.getChildReferences(system).getChild(JcrLexicon.VERSION_STORAGE);
            versionStorageKey = locksRef.getKey();
        }
        return versionStorageKey;
    }
View Full Code Here

            // Update the properties ...
            nodeTypeNode.setProperties(system, properties);
            // make sure each new supertype of the existing node is present *before* the existing node in the parent nodeTypes
            // this because node type validation is a top-down process, expecting the parents before the children
            for (NodeType superType : supertypes) {
                CachedNode superTypeNode = system.getNode(((JcrNodeType)superType).key());
                if (superTypeNode instanceof MutableCachedNode && ((MutableCachedNode)superTypeNode).isNew()) {
                    nodeTypes.reorderChild(system, superTypeNode.getKey(), nodeTypeNode.getKey());
                }
            }
        } else {
            // We have to create the node type node ...
            nodeTypeNode = nodeTypes.createChild(system, key, name, properties);
View Full Code Here

            }
        }

        Collection<IndexColumnDefinition> columnDefns = new LinkedList<>();
        for (ChildReference ref : indexDefn.getChildReferences(system)) {
            CachedNode indexColumnDefn = system.getNode(ref);
            IndexColumnDefinition defn = readIndexColumnDefinition(indexColumnDefn);
            columnDefns.add(defn);
        }

        WorkspaceMatchRule rule = RepositoryIndexDefinition.workspaceMatchRule(workspacesRule);
View Full Code Here

     *        {@link IndexDefinition#isEnabled() enabled}; may be null if not known and all index definitions will be
     *        {@link IndexDefinition#isEnabled() enabled}
     * @return the index definitions as read from the system storage
     */
    public List<IndexDefinition> readAllIndexDefinitions( Set<String> providerNames ) {
        CachedNode indexes = indexesNode();
        List<IndexDefinition> defns = new ArrayList<>();
        for (ChildReference ref : indexes.getChildReferences(system)) {
            CachedNode provider = system.getNode(ref);
            Name providerName = provider.getName(system);
            for (ChildReference indexRef : provider.getChildReferences(system)) {
                CachedNode indexDefn = system.getNode(indexRef);
                IndexDefinition defn = readIndexDefinition(indexDefn, providerName);
                if (providerNames.contains(defn.getProviderName())) {
                    defns.add(defn);
                } else {
                    // There is no provider by this name, so mark it as not enabled ...
View Full Code Here

     * Read from system storage all of the node type definitions.
     *
     * @return the node types as read from the system storage
     */
    public List<NodeTypeDefinition> readAllNodeTypes() {
        CachedNode nodeTypes = nodeTypesNode();
        List<NodeTypeDefinition> defns = new ArrayList<NodeTypeDefinition>();
        for (ChildReference ref : nodeTypes.getChildReferences(system)) {
            CachedNode nodeType = system.getNode(ref);
            defns.add(readNodeTypeDefinition(nodeType));
        }
        return defns;
    }
View Full Code Here

                defn.setDeclaredSuperTypeNames(supertypeNames);
            }

            // Read the children ...
            for (ChildReference ref : nodeType.getChildReferences(system)) {
                CachedNode itemDefn = system.getNode(ref);
                Name primaryType = names.create(first(itemDefn, JcrLexicon.PRIMARY_TYPE));
                if (JcrNtLexicon.PROPERTY_DEFINITION.equals(primaryType)) {
                    PropertyDefinition propDefn = readPropertyDefinition(itemDefn);
                    assert propDefn != null;
                    defn.getPropertyDefinitionTemplates().add(propDefn);
View Full Code Here

        Property property = node.getProperty(propertyName, system);
        return property != null ? property.getFirstValue() : defaultValue;
    }

    public Collection<Namespace> readAllNamespaces() {
        CachedNode namespaces = namespacesNode();
        List<Namespace> results = new ArrayList<Namespace>();
        // Add in the empty namespace ...
        results.add(new BasicNamespace("", ""));
        // Now read in the persisted namespaces ...
        for (ChildReference ref : namespaces.getChildReferences(system)) {
            CachedNode namespace = system.getNode(ref);
            String prefix = prefixFor(ref.getSegment());
            String uri = strings.create(first(namespace, ModeShapeLexicon.URI));
            results.add(new BasicNamespace(prefix, uri));
        }
        return results;
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.cache.CachedNode

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.