org.apache.jackrabbit.jcr2spi.nodetype
Interface NodeTypeRegistry

All Known Implementing Classes:
NodeTypeRegistryImpl

public interface NodeTypeRegistry

NodeTypeRegistry...


Method Summary
 void addListener(NodeTypeRegistryListener listener)
          Add a NodeTypeRegistryListener
 QNodeTypeDefinition getNodeTypeDefinition(Name nodeTypeName)
          Returns the node type definition of the node type with the given name.
 Name[] getRegisteredNodeTypes()
          Returns the names of all registered node types.
 boolean isRegistered(Name ntName)
           
 EffectiveNodeType registerNodeType(QNodeTypeDefinition ntDef)
          Validates the NodeTypeDef and returns a registered EffectiveNodeType instance.
 void registerNodeTypes(Collection ntDefs)
          Same as registerNodeType(QNodeTypeDefinition) except that a collection of NodeTypeDefs is registered instead of just one.
 void removeListener(NodeTypeRegistryListener listener)
          Remove a NodeTypeRegistryListener
 EffectiveNodeType reregisterNodeType(QNodeTypeDefinition ntd)
           
 void unregisterNodeType(Name nodeTypeName)
           
 void unregisterNodeTypes(Collection nodeTypeNames)
          Same as unregisterNodeType(Name) except that a set of node types is unregistered instead of just one.
 

Method Detail

getNodeTypeDefinition

QNodeTypeDefinition getNodeTypeDefinition(Name nodeTypeName)
                                          throws NoSuchNodeTypeException
Returns the node type definition of the node type with the given name.

Parameters:
nodeTypeName - name of node type whose definition should be returned.
Returns:
the node type definition of the node type with the given name.
Throws:
NoSuchNodeTypeException - if a node type with the given name does not exist

addListener

void addListener(NodeTypeRegistryListener listener)
Add a NodeTypeRegistryListener

Parameters:
listener - the new listener to be informed on (un)registration of node types

removeListener

void removeListener(NodeTypeRegistryListener listener)
Remove a NodeTypeRegistryListener

Parameters:
listener - an existing listener

isRegistered

boolean isRegistered(Name ntName)
Parameters:
ntName -
Returns:

getRegisteredNodeTypes

Name[] getRegisteredNodeTypes()
                              throws RepositoryException
Returns the names of all registered node types. That includes primary and mixin node types.

Returns:
the names of all registered node types.
Throws:
RepositoryException

registerNodeType

EffectiveNodeType registerNodeType(QNodeTypeDefinition ntDef)
                                   throws InvalidNodeTypeDefException,
                                          RepositoryException
Validates the NodeTypeDef and returns a registered EffectiveNodeType instance.

The validation includes the following checks:

Parameters:
ntDef - the definition of the new node type
Returns:
an EffectiveNodeType instance
Throws:
InvalidNodeTypeDefException
RepositoryException
InvalidNodeTypeDefException

registerNodeTypes

void registerNodeTypes(Collection ntDefs)
                       throws InvalidNodeTypeDefException,
                              RepositoryException
Same as registerNodeType(QNodeTypeDefinition) except that a collection of NodeTypeDefs is registered instead of just one.

This method can be used to register a set of node types that have dependencies on each other.

Note that in the case an exception is thrown, some node types might have been nevertheless successfully registered.

Parameters:
ntDefs - a collection of NodeTypeDefs
Throws:
InvalidNodeTypeDefException
RepositoryException
InvalidNodeTypeDefException

unregisterNodeType

void unregisterNodeType(Name nodeTypeName)
                        throws NoSuchNodeTypeException,
                               RepositoryException
Parameters:
nodeTypeName -
Throws:
NoSuchNodeTypeException
RepositoryException

unregisterNodeTypes

void unregisterNodeTypes(Collection nodeTypeNames)
                         throws NoSuchNodeTypeException,
                                RepositoryException
Same as unregisterNodeType(Name) except that a set of node types is unregistered instead of just one.

This method can be used to unregister a set of node types that depend on each other.

Parameters:
nodeTypeNames - a collection of Name objects denoting the node types to be unregistered
Throws:
NoSuchNodeTypeException - if any of the specified names does not denote a registered node type.
RepositoryException - if another error occurs
See Also:
unregisterNodeType(Name)

reregisterNodeType

EffectiveNodeType reregisterNodeType(QNodeTypeDefinition ntd)
                                     throws NoSuchNodeTypeException,
                                            InvalidNodeTypeDefException,
                                            RepositoryException
Parameters:
ntd -
Returns:
Throws:
NoSuchNodeTypeException
InvalidNodeTypeDefException
RepositoryException
InvalidNodeTypeDefException


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