Class NodeTypeRegistryImpl
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeRegistryImpl
-
- All Implemented Interfaces:
EffectiveNodeTypeProvider
,NodeTypeRegistry
public class NodeTypeRegistryImpl extends Object implements NodeTypeRegistry, EffectiveNodeTypeProvider
ANodeTypeRegistry
...
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(NodeTypeRegistryListener listener)
Add aNodeTypeRegistryListener
static NodeTypeRegistryImpl
create(NodeTypeStorage storage, NamespaceRegistry nsRegistry)
Create a newNodeTypeRegistry
void
dispose()
Clears all caches.EffectiveNodeType
getEffectiveNodeType(Name ntName)
Build theEffectiveNodeType
from the givenNodeType
name.EffectiveNodeType
getEffectiveNodeType(Name[] ntNames)
Build theEffectiveNodeType
from the given array ofNodeType
names.EffectiveNodeType
getEffectiveNodeType(Name[] ntNames, Map<Name,QNodeTypeDefinition> ntdMap)
EffectiveNodeType
getEffectiveNodeType(QNodeTypeDefinition ntd, Map<Name,QNodeTypeDefinition> ntdMap)
Builds an effective node type representation from the given node type definition.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 nodeTypeName)
void
registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean allowUpdate)
Registers the specified node type definitions.void
removeListener(NodeTypeRegistryListener listener)
Remove aNodeTypeRegistryListener
String
toString()
Returns the the state of this instance in a human readable format.void
unregisterNodeTypes(Collection<Name> nodeTypeNames)
Unregisters a collection of node types.
-
-
-
Method Detail
-
create
public static NodeTypeRegistryImpl create(NodeTypeStorage storage, NamespaceRegistry nsRegistry)
Create a newNodeTypeRegistry
- Parameters:
storage
-nsRegistry
-- Returns:
NodeTypeRegistry
object
-
dispose
public void dispose()
Clears all caches.
-
addListener
public void addListener(NodeTypeRegistryListener listener)
Description copied from interface:NodeTypeRegistry
Add aNodeTypeRegistryListener
- Specified by:
addListener
in interfaceNodeTypeRegistry
- Parameters:
listener
- the new listener to be informed on (un)registration of node types- See Also:
NodeTypeRegistry.addListener(NodeTypeRegistryListener)
-
removeListener
public void removeListener(NodeTypeRegistryListener listener)
Description copied from interface:NodeTypeRegistry
Remove aNodeTypeRegistryListener
- Specified by:
removeListener
in interfaceNodeTypeRegistry
- Parameters:
listener
- an existing listener- See Also:
NodeTypeRegistry.removeListener(NodeTypeRegistryListener)
-
getRegisteredNodeTypes
public Name[] getRegisteredNodeTypes() throws RepositoryException
Description copied from interface:NodeTypeRegistry
Returns the names of all registered node types. That includes primary and mixin node types.- Specified by:
getRegisteredNodeTypes
in interfaceNodeTypeRegistry
- Returns:
- the names of all registered node types.
- Throws:
RepositoryException
- See Also:
NodeTypeRegistry.getRegisteredNodeTypes()
-
isRegistered
public boolean isRegistered(Name nodeTypeName)
- Specified by:
isRegistered
in interfaceNodeTypeRegistry
- Returns:
- See Also:
NodeTypeRegistry.isRegistered(Name)
-
registerNodeTypes
public void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean allowUpdate) throws NodeTypeExistsException, InvalidNodeTypeDefinitionException, RepositoryException
Description copied from interface:NodeTypeRegistry
Registers the specified node type definitions. IfallowUpdate
istrue
existing node types will be updated, otherwise anNodeTypeExistsException
is thrown.- Specified by:
registerNodeTypes
in interfaceNodeTypeRegistry
- Throws:
NodeTypeExistsException
InvalidNodeTypeDefinitionException
RepositoryException
- See Also:
NodeTypeRegistry.registerNodeTypes(Collection, boolean)
-
unregisterNodeTypes
public void unregisterNodeTypes(Collection<Name> nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException
Description copied from interface:NodeTypeRegistry
Unregisters a collection of node types.- Specified by:
unregisterNodeTypes
in interfaceNodeTypeRegistry
- Parameters:
nodeTypeNames
- a collection ofName
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:
NodeTypeRegistry.unregisterNodeTypes(Collection)
-
getNodeTypeDefinition
public QNodeTypeDefinition getNodeTypeDefinition(Name nodeTypeName) throws NoSuchNodeTypeException
Description copied from interface:NodeTypeRegistry
Returns the node type definition of the node type with the given name.- Specified by:
getNodeTypeDefinition
in interfaceNodeTypeRegistry
- 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- See Also:
NodeTypeRegistry.getNodeTypeDefinition(Name)
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(Name ntName) throws NoSuchNodeTypeException
Description copied from interface:EffectiveNodeTypeProvider
Build theEffectiveNodeType
from the givenNodeType
name.- Specified by:
getEffectiveNodeType
in interfaceEffectiveNodeTypeProvider
- Returns:
- Throws:
NoSuchNodeTypeException
- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(Name)
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(Name[] ntNames) throws ConstraintViolationException, NoSuchNodeTypeException
Description copied from interface:EffectiveNodeTypeProvider
Build theEffectiveNodeType
from the given array ofNodeType
names.- Specified by:
getEffectiveNodeType
in interfaceEffectiveNodeTypeProvider
- Returns:
- Throws:
ConstraintViolationException
NoSuchNodeTypeException
- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(Name[])
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(Name[] ntNames, Map<Name,QNodeTypeDefinition> ntdMap) throws ConstraintViolationException, NoSuchNodeTypeException
- Specified by:
getEffectiveNodeType
in interfaceEffectiveNodeTypeProvider
- Returns:
- Throws:
ConstraintViolationException
NoSuchNodeTypeException
- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(Name[], Map)
-
getEffectiveNodeType
public EffectiveNodeType getEffectiveNodeType(QNodeTypeDefinition ntd, Map<Name,QNodeTypeDefinition> ntdMap) throws ConstraintViolationException, NoSuchNodeTypeException
Description copied from interface:EffectiveNodeTypeProvider
Builds an effective node type representation from the given node type definition. Whereas all referenced node types must exist (i.e. must be present in the specified map), the definition itself is not required to be registered.- Specified by:
getEffectiveNodeType
in interfaceEffectiveNodeTypeProvider
- Returns:
- Throws:
ConstraintViolationException
NoSuchNodeTypeException
- See Also:
EffectiveNodeTypeProvider.getEffectiveNodeType(QNodeTypeDefinition, Map)
-
-