org.apache.jackrabbit.jcr2spi.nodetype
Class NodeTypeManagerImpl

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
      extended by org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeManagerImpl
All Implemented Interfaces:
NodeTypeManager, NodeTypeDefinitionProvider, NodeTypeRegistryListener

public class NodeTypeManagerImpl
extends AbstractNodeTypeManager
implements NodeTypeDefinitionProvider, NodeTypeRegistryListener

A NodeTypeManagerImpl implements a session dependant NodeTypeManager.


Constructor Summary
NodeTypeManagerImpl(NodeTypeRegistry ntReg, ManagerProvider mgrProvider)
          Creates a new NodeTypeManagerImpl instance.
 
Method Summary
 NodeTypeIterator getAllNodeTypes()
          
 NodeTypeIterator getMixinNodeTypes()
          
 NamePathResolver getNamePathResolver()
          Returns the NamePathResolver used to validate JCR names.
 NodeDefinition getNodeDefinition(QNodeDefinition def)
          Retrieve the NodeDefinition for the given QNodeDefinition.
 NodeTypeImpl getNodeType(Name name)
          Return the node type with the specified ntName.
 NodeType getNodeType(String nodeTypeName)
          
 QNodeTypeDefinition getNodeTypeDefinition(Name ntName)
           
 NodeTypeIterator getPrimaryNodeTypes()
          
 PropertyDefinition getPropertyDefinition(QPropertyDefinition def)
          Retrieve the PropertyDefinition for the given QPropertyDefinition.
 boolean hasNodeType(Name nodeTypeName)
           
 boolean hasNodeType(String name)
           
 void nodeTypeRegistered(Name ntName)
          Called when a node type has been registered.
 void nodeTypeReRegistered(Name ntName)
          Called when a node type has been re-registered.
 void nodeTypeUnregistered(Name ntName)
          Called when a node type has been deregistered.
 NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)
           
 String toString()
          Returns the the state of this instance in a human readable format.
 void unregisterNodeTypes(String[] names)
           
 
Methods inherited from class org.apache.jackrabbit.spi.commons.nodetype.AbstractNodeTypeManager
createNodeDefinitionTemplate, createNodeTypeTemplate, createNodeTypeTemplate, createPropertyDefinitionTemplate, registerNodeType, unregisterNodeType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeTypeManagerImpl

public NodeTypeManagerImpl(NodeTypeRegistry ntReg,
                           ManagerProvider mgrProvider)
                    throws RepositoryException
Creates a new NodeTypeManagerImpl instance.

Parameters:
ntReg - node type registry
mgrProvider - the manager provider
Throws:
RepositoryException - If an error occurs.
Method Detail

getNodeType

public NodeTypeImpl getNodeType(Name name)
                         throws NoSuchNodeTypeException
Description copied from class: AbstractNodeTypeManager
Return the node type with the specified ntName.

Specified by:
getNodeType in class AbstractNodeTypeManager
Parameters:
name - Name of the node type to be returned.
Returns:
the node type with the specified ntName.
Throws:
NoSuchNodeTypeException - If no such node type exists.
See Also:
AbstractNodeTypeManager.getNodeType(org.apache.jackrabbit.spi.Name)

getNamePathResolver

public NamePathResolver getNamePathResolver()
Description copied from class: AbstractNodeTypeManager
Returns the NamePathResolver used to validate JCR names.

Specified by:
getNamePathResolver in class AbstractNodeTypeManager
Returns:
the NamePathResolver used to convert JCR names/paths to internal onces and vice versa. The resolver may also be used to validate names passed to the various templates.
See Also:
AbstractNodeTypeManager.getNamePathResolver()

hasNodeType

public boolean hasNodeType(Name nodeTypeName)
Parameters:
nodeTypeName -
Returns:

getNodeDefinition

public NodeDefinition getNodeDefinition(QNodeDefinition def)
Retrieve the NodeDefinition for the given QNodeDefinition.

Specified by:
getNodeDefinition in class AbstractNodeTypeManager
Parameters:
def -
Returns:

getPropertyDefinition

public PropertyDefinition getPropertyDefinition(QPropertyDefinition def)
Retrieve the PropertyDefinition for the given QPropertyDefinition.

Specified by:
getPropertyDefinition in class AbstractNodeTypeManager
Parameters:
def -
Returns:

getNodeTypeDefinition

public QNodeTypeDefinition getNodeTypeDefinition(Name ntName)
                                          throws NoSuchNodeTypeException,
                                                 RepositoryException
Specified by:
getNodeTypeDefinition in interface NodeTypeDefinitionProvider
Throws:
NoSuchNodeTypeException
RepositoryException
See Also:
NodeTypeDefinitionProvider.getNodeTypeDefinition(org.apache.jackrabbit.spi.Name)

nodeTypeRegistered

public void nodeTypeRegistered(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(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

nodeTypeUnregistered

public void nodeTypeUnregistered(Name ntName)
Called when a node type has been deregistered.

Specified by:
nodeTypeUnregistered in interface NodeTypeRegistryListener
Parameters:
ntName - name of the node type that has been unregistered

getAllNodeTypes

public NodeTypeIterator getAllNodeTypes()
                                 throws RepositoryException

Specified by:
getAllNodeTypes in interface NodeTypeManager
Throws:
RepositoryException

getPrimaryNodeTypes

public NodeTypeIterator getPrimaryNodeTypes()
                                     throws RepositoryException

Specified by:
getPrimaryNodeTypes in interface NodeTypeManager
Throws:
RepositoryException

getMixinNodeTypes

public NodeTypeIterator getMixinNodeTypes()
                                   throws RepositoryException

Specified by:
getMixinNodeTypes in interface NodeTypeManager
Throws:
RepositoryException

getNodeType

public NodeType getNodeType(String nodeTypeName)
                     throws NoSuchNodeTypeException

Specified by:
getNodeType in interface NodeTypeManager
Throws:
NoSuchNodeTypeException

hasNodeType

public boolean hasNodeType(String name)
                    throws RepositoryException
Specified by:
hasNodeType in interface NodeTypeManager
Throws:
RepositoryException
See Also:
NodeTypeManager.hasNodeType(String)

registerNodeTypes

public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds,
                                          boolean allowUpdate)
                                   throws RepositoryException
Specified by:
registerNodeTypes in interface NodeTypeManager
Throws:
RepositoryException
See Also:
NodeTypeManager.registerNodeTypes(javax.jcr.nodetype.NodeTypeDefinition[], boolean)

unregisterNodeTypes

public void unregisterNodeTypes(String[] names)
                         throws RepositoryException
Specified by:
unregisterNodeTypes in interface NodeTypeManager
Throws:
RepositoryException
See Also:
NodeTypeManager.unregisterNodeTypes(String[])

toString

public String toString()
Returns the the state of this instance in a human readable format.

Overrides:
toString in class Object


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.