org.apache.jackrabbit.spi.commons.nodetype
Class NodeTypeStorageImpl

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.nodetype.NodeTypeStorageImpl
All Implemented Interfaces:
NodeTypeStorage

public class NodeTypeStorageImpl
extends Object
implements NodeTypeStorage

This implementation of NodeTypeStorage keeps a map of the registered QNodeTypeDefinition in memory.


Constructor Summary
NodeTypeStorageImpl()
           
 
Method Summary
 Iterator<QNodeTypeDefinition> getAllDefinitions()
          Returns an Iterator over all node type definitions registered.
 Iterator<QNodeTypeDefinition> getDefinitions(Name[] nodeTypeNames)
          This implementation returns an iterator over all registered QNodeTypeDefinitions if nodeTypeNames is null.
 void registerNodeTypes(QNodeTypeDefinition[] nodeTypeDefs, boolean allowUpdate)
          Add all QNodeTypeDefinitions provided to the store.
 void unregisterNodeTypes(Name[] nodeTypeNames)
          Remove all QNodeTypeDefinitions provided from the store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTypeStorageImpl

public NodeTypeStorageImpl()
Method Detail

getAllDefinitions

public Iterator<QNodeTypeDefinition> getAllDefinitions()
                                                throws RepositoryException
Description copied from interface: NodeTypeStorage
Returns an Iterator over all node type definitions registered.

Specified by:
getAllDefinitions in interface NodeTypeStorage
Returns:
Throws:
RepositoryException

getDefinitions

public Iterator<QNodeTypeDefinition> getDefinitions(Name[] nodeTypeNames)
                                             throws NoSuchNodeTypeException,
                                                    RepositoryException
This implementation returns an iterator over all registered QNodeTypeDefinitions if nodeTypeNames is null. Returns the QNodeTypeDefinitions for the given node type names. The implementation is free to return additional definitions e.g. dependencies.

Specified by:
getDefinitions in interface NodeTypeStorage
Returns:
Throws:
NoSuchNodeTypeException
RepositoryException

registerNodeTypes

public void registerNodeTypes(QNodeTypeDefinition[] nodeTypeDefs,
                              boolean allowUpdate)
                       throws RepositoryException
Description copied from interface: NodeTypeStorage
Add all QNodeTypeDefinitions provided to the store. If allowUpdate is true previously registered node QNodeTypeDefinitions will be overwritten.

Specified by:
registerNodeTypes in interface NodeTypeStorage
Parameters:
nodeTypeDefs - QNodeTypeDefinitions to add to the store
allowUpdate - Whether to overwrite existing QNodeTypeDefinitions
Throws:
RepositoryException
NodeTypeExistsException - If allowUpdate is true and a QNodeTypeDefinitions of that name already exists. In this case, none of the provided QNodeTypeDefinitions is registered.

unregisterNodeTypes

public void unregisterNodeTypes(Name[] nodeTypeNames)
                         throws NoSuchNodeTypeException,
                                RepositoryException
Description copied from interface: NodeTypeStorage
Remove all QNodeTypeDefinitions provided from the store.

Specified by:
unregisterNodeTypes in interface NodeTypeStorage
Parameters:
nodeTypeNames - QNodeTypeDefinitions to remove from the store
Throws:
NoSuchNodeTypeException - If any of the QNodeTypeDefinitions does not exist. In this case none of the provided is unregistered.
RepositoryException


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