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)
           
 void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean allowUpdate)
          Registers the specified node type definitions.
 void removeListener(NodeTypeRegistryListener listener)
          Remove a NodeTypeRegistryListener
 void unregisterNodeTypes(Collection<Name> nodeTypeNames)
          Unregisters a collection of node types.
 

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

registerNodeTypes

void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs,
                       boolean allowUpdate)
                       throws NodeTypeExistsException,
                              InvalidNodeTypeDefinitionException,
                              RepositoryException
Registers the specified node type definitions. If allowUpdate is true existing node types will be updated, otherwise an NodeTypeExistsException is thrown.

Parameters:
ntDefs -
allowUpdate -
Throws:
NodeTypeExistsException
InvalidNodeTypeDefinitionException
RepositoryException

unregisterNodeTypes

void unregisterNodeTypes(Collection<Name> nodeTypeNames)
                         throws NoSuchNodeTypeException,
                                RepositoryException
Unregisters a collection of node types.

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


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