Class NodeTypeStorageImpl
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.nodetype.NodeTypeStorageImpl
-
- All Implemented Interfaces:
NodeTypeStorage
public class NodeTypeStorageImpl extends Object implements NodeTypeStorage
This implementation ofNodeTypeStorage
keeps a map of the registeredQNodeTypeDefinition
in memory.
-
-
Constructor Summary
Constructors Constructor Description NodeTypeStorageImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<QNodeTypeDefinition>
getAllDefinitions()
Returns an Iterator over all node type definitions registered.Iterator<QNodeTypeDefinition>
getDefinitions(Name[] nodeTypeNames)
This implementation returns an iterator over all registeredQNodeTypeDefinition
s ifnodeTypeNames
isnull
.void
registerNodeTypes(QNodeTypeDefinition[] nodeTypeDefs, boolean allowUpdate)
Add allQNodeTypeDefinition
s provided to the store.void
unregisterNodeTypes(Name[] nodeTypeNames)
Remove allQNodeTypeDefinition
s provided from the store.
-
-
-
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 interfaceNodeTypeStorage
- Returns:
- Throws:
RepositoryException
-
getDefinitions
public Iterator<QNodeTypeDefinition> getDefinitions(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException
This implementation returns an iterator over all registeredQNodeTypeDefinition
s ifnodeTypeNames
isnull
. Returns theQNodeTypeDefinition
s for the given node type names. The implementation is free to return additional definitions e.g. dependencies.- Specified by:
getDefinitions
in interfaceNodeTypeStorage
- Returns:
- Throws:
NoSuchNodeTypeException
RepositoryException
-
registerNodeTypes
public void registerNodeTypes(QNodeTypeDefinition[] nodeTypeDefs, boolean allowUpdate) throws RepositoryException
Description copied from interface:NodeTypeStorage
Add allQNodeTypeDefinition
s provided to the store. IfallowUpdate
istrue
previously registered node QNodeTypeDefinitions will be overwritten.- Specified by:
registerNodeTypes
in interfaceNodeTypeStorage
- Parameters:
nodeTypeDefs
- QNodeTypeDefinitions to add to the storeallowUpdate
- Whether to overwrite existing QNodeTypeDefinitions- Throws:
RepositoryException
NodeTypeExistsException
- IfallowUpdate
istrue
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 allQNodeTypeDefinition
s provided from the store.- Specified by:
unregisterNodeTypes
in interfaceNodeTypeStorage
- 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
-
-