Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition


    private void resolveNodeType(Set<Name> resolved, Name ntName) {
        if (!resolved.add(ntName)) {
            return;
        }
        QNodeTypeDefinition def = nodeTypeDefinitions.get(ntName);
        if (def != null) {
            for (Name supertype : def.getSupertypes()) {
                resolveNodeType(resolved, supertype);
            }
        }
    }
View Full Code Here


            }
            // refresh node type definitions map
            synchronized (nodeTypeDefinitions) {
                nodeTypeDefinitions.clear();
                for (Object ntDef : ntDefs) {
                    QNodeTypeDefinition def = (QNodeTypeDefinition) ntDef;
                    nodeTypeDefinitions.put(def.getName(), def);
                }
            }
            return ntDefs.iterator();
    }
View Full Code Here

    public NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException {
        synchronized (ntCache) {
            NodeTypeImpl nt = ntCache.get(name);
            if (nt == null) {
                EffectiveNodeType ent = entProvider().getEffectiveNodeType(name);
                QNodeTypeDefinition def = ntReg.getNodeTypeDefinition(name);
                nt = new NodeTypeImpl(ent, def, this, mgrProvider);
                ntCache.put(name, nt);
            }
            return nt;
        }
View Full Code Here

     */
    public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)
            throws RepositoryException {
        List<QNodeTypeDefinition> defs = new ArrayList<QNodeTypeDefinition>(ntds.length);
        for (NodeTypeDefinition definition : ntds) {
            QNodeTypeDefinition qdef = new QNodeTypeDefinitionImpl(definition, getNamePathResolver(), mgrProvider.getQValueFactory());
            if (!allowUpdate && hasNodeType(qdef.getName())) {
                throw new NodeTypeExistsException("NodeType " + definition.getName() + " already exists.");
            }
            defs.add(qdef);
        }

View Full Code Here

                break;
            case NodeTypeRecord.UNREGISTER:
                nodeTypeListener.externalUnregistered(coll);
                break;
            case NodeTypeRecord.REREGISTER:
                QNodeTypeDefinition ntd = (QNodeTypeDefinition) coll.iterator().next();
                nodeTypeListener.externalReregistered(ntd);
                break;
            }
        } catch (InvalidNodeTypeDefException e) {
            String msg = "Unable to deliver node type operation: " + e.getMessage();
View Full Code Here

    public NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException {
        synchronized (ntCache) {
            NodeTypeImpl nt = ntCache.get(name);
            if (nt == null) {
                EffectiveNodeType ent = ntReg.getEffectiveNodeType(name);
                QNodeTypeDefinition def = ntReg.getNodeTypeDef(name);
                nt = new NodeTypeImpl(ent, def, this, session, valueFactory, store);
                ntCache.put(name, nt);
            }
            return nt;
        }
View Full Code Here

        // registered node types which make circular dependencies possible
        List<QNodeTypeDefinition> addedDefs = new ArrayList<QNodeTypeDefinition>();
        List<QNodeTypeDefinition> modifiedDefs = new ArrayList<QNodeTypeDefinition>();
        for (NodeTypeDefinition definition : definitions) {
            // convert to QNodeTypeDefinition
            QNodeTypeDefinition def = toNodeTypeDef(definition);
            if (ntReg.isRegistered(def.getName())) {
              if (allowUpdate) {
                  modifiedDefs.add(def);
              } else {
                  throw new NodeTypeExistsException(definition.getName());
              }
View Full Code Here

     */
    protected VirtualNodeState createRootNodeState() throws RepositoryException {
        VirtualNodeState root = new VirtualNodeState(this, parentId, rootNodeId, NameConstants.REP_NODETYPES, null);
        Name[] ntNames = ntReg.getRegisteredNodeTypes();
        for (int i = 0; i < ntNames.length; i++) {
            QNodeTypeDefinition ntDef = ntReg.getNodeTypeDef(ntNames[i]);
            VirtualNodeState ntState = createNodeTypeState(root, ntDef);
            root.addChildNodeEntry(ntNames[i], ntState.getNodeId());
            // add as hard reference
            root.addStateReference(ntState);
        }
View Full Code Here

     * {@inheritDoc}
     */
    public void onNodeTypeAdded(Name ntName) throws RepositoryException {
        try {
            VirtualNodeState root = (VirtualNodeState) getRootState();
            QNodeTypeDefinition ntDef = ntReg.getNodeTypeDef(ntName);
            VirtualNodeState ntState = createNodeTypeState(root, ntDef);
            root.addChildNodeEntry(ntName, ntState.getNodeId());

            // add as hard reference
            root.addStateReference(ntState);
View Full Code Here

        validateNodeTypeDef(ntd, entCache, registeredNTDefs, nsReg, false);

        /**
         * build diff of current and new definition and determine type of change
         */
        QNodeTypeDefinition ntdOld = registeredNTDefs.get(name);
        NodeTypeDefDiff diff = NodeTypeDefDiff.create(ntdOld, ntd);
        if (!diff.isModified()) {
            // the definition has not been modified, there's nothing to do here...
            return getEffectiveNodeType(name);
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.QNodeTypeDefinition

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.