Class NodeTypeManagerImpl

    • Constructor Detail

      • NodeTypeManagerImpl

        public NodeTypeManagerImpl​(SessionContext context)
        Creates a new NodeTypeManagerImpl instance.
        Parameters:
        context - the session context
    • Method Detail

      • dispose

        public void dispose()
        Disposes this node type manager.
      • getRootNodeDefinition

        public org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl getRootNodeDefinition()
        Returns:
        the root node definition
      • getNodeDefinition

        public org.apache.jackrabbit.spi.commons.nodetype.NodeDefinitionImpl getNodeDefinition​(org.apache.jackrabbit.spi.QNodeDefinition def)
        Specified by:
        getNodeDefinition in class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
        Parameters:
        def - the QNodeDefinition
        Returns:
        the node definition
      • getPropertyDefinition

        public org.apache.jackrabbit.spi.commons.nodetype.PropertyDefinitionImpl getPropertyDefinition​(org.apache.jackrabbit.spi.QPropertyDefinition def)
        Specified by:
        getPropertyDefinition in class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
        Parameters:
        def - prop def
        Returns:
        the property definition
      • getNodeType

        public NodeTypeImpl getNodeType​(org.apache.jackrabbit.spi.Name name)
                                 throws NoSuchNodeTypeException
        Specified by:
        getNodeType in class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
        Parameters:
        name - node type name
        Returns:
        node type
        Throws:
        NoSuchNodeTypeException - if the nodetype does not exit
      • getNamePathResolver

        public org.apache.jackrabbit.spi.commons.conversion.NamePathResolver getNamePathResolver()
        Specified by:
        getNamePathResolver in class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
        See Also:
        AbstractNodeTypeManager.getNamePathResolver()
      • getNodeTypeRegistry

        public NodeTypeRegistry getNodeTypeRegistry()
        Returns:
        the node type registry
      • registerNodeTypes

        public NodeType[] registerNodeTypes​(InputStream in,
                                            String contentType,
                                            boolean reregisterExisting)
                                     throws IOException,
                                            RepositoryException
        Registers the node types defined in the given input stream depending on the content type specified for the stream. This will also register any namespaces identified in the input stream if they have not already been registered.
        Parameters:
        in - node type XML stream
        contentType - type of the input stream
        reregisterExisting - flag indicating whether node types should be reregistered if they already exist
        Returns:
        registered node types
        Throws:
        IOException - if the input stream could not be read or parsed
        RepositoryException - if the node types are invalid or another repository error occurs
      • nodeTypeRegistered

        public void nodeTypeRegistered​(org.apache.jackrabbit.spi.Name ntName)
        Called when a node type has been registered.
        Specified by:
        nodeTypeRegistered in interface NodeTypeRegistryListener
        Parameters:
        ntName - name of the node type that has been registered
      • nodeTypeReRegistered

        public void nodeTypeReRegistered​(org.apache.jackrabbit.spi.Name ntName)
        Called when a node type has been re-registered.
        Specified by:
        nodeTypeReRegistered in interface NodeTypeRegistryListener
        Parameters:
        ntName - name of the node type that has been registered
      • nodeTypesUnregistered

        public void nodeTypesUnregistered​(Collection<org.apache.jackrabbit.spi.Name> names)
        Called when a set of node types has been unregistered.
        Specified by:
        nodeTypesUnregistered in interface NodeTypeRegistryListener
        Parameters:
        names - names of the types that have been unregistered
      • registerNodeTypes

        public NodeTypeIterator registerNodeTypes​(NodeTypeDefinition[] definitions,
                                                  boolean allowUpdate)
                                           throws InvalidNodeTypeDefinitionException,
                                                  NodeTypeExistsException,
                                                  UnsupportedRepositoryOperationException,
                                                  RepositoryException
        Registers or updates the specified Collection of NodeTypeDefinition objects. This method is used to register or update a set of node types with mutual dependencies. Returns an iterator over the resulting NodeType objects.

        The effect of the method is "all or nothing"; if an error occurs, no node types are registered or updated.

        Throws an InvalidNodeTypeDefinitionException if a NodeTypeDefinition within the Collection is invalid or if the Collection contains an object of a type other than NodeTypeDefinition.

        Throws a NodeTypeExistsException if allowUpdate is false and a NodeTypeDefinition within the Collection specifies a node type name that is already registered.

        Throws an UnsupportedRepositoryOperationException if this implementation does not support node type registration.

        Specified by:
        registerNodeTypes in interface NodeTypeManager
        Parameters:
        definitions - a collection of NodeTypeDefinitions
        allowUpdate - a boolean
        Returns:
        the registered node types.
        Throws:
        InvalidNodeTypeDefinitionException - if a NodeTypeDefinition within the Collection is invalid or if the Collection contains an object of a type other than NodeTypeDefinition.
        NodeTypeExistsException - if allowUpdate is false and a NodeTypeDefinition within the Collection specifies a node type name that is already registered.
        UnsupportedRepositoryOperationException - if this implementation does not support node type registration.
        RepositoryException - if another error occurs.
        Since:
        JCR 2.0