public class NodeTypeRegistryImpl extends Object implements NodeTypeRegistry, EffectiveNodeTypeProvider
NodeTypeRegistry
...Modifier and Type | Method and Description |
---|---|
void |
addListener(NodeTypeRegistryListener listener)
Add a
NodeTypeRegistryListener |
static NodeTypeRegistryImpl |
create(NodeTypeStorage storage,
NamespaceRegistry nsRegistry)
Create a new
NodeTypeRegistry |
void |
dispose()
Clears all caches.
|
EffectiveNodeType |
getEffectiveNodeType(Name ntName)
Build the
EffectiveNodeType from the given
NodeType name. |
EffectiveNodeType |
getEffectiveNodeType(Name[] ntNames)
Build the
EffectiveNodeType from the given array of
NodeType 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 a
NodeTypeRegistryListener |
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.
|
public static NodeTypeRegistryImpl create(NodeTypeStorage storage, NamespaceRegistry nsRegistry)
NodeTypeRegistry
storage
- nsRegistry
- NodeTypeRegistry
objectpublic void dispose()
public void addListener(NodeTypeRegistryListener listener)
NodeTypeRegistry
NodeTypeRegistryListener
addListener
in interface NodeTypeRegistry
listener
- the new listener to be informed on (un)registration
of node typesNodeTypeRegistry.addListener(NodeTypeRegistryListener)
public void removeListener(NodeTypeRegistryListener listener)
NodeTypeRegistry
NodeTypeRegistryListener
removeListener
in interface NodeTypeRegistry
listener
- an existing listenerNodeTypeRegistry.removeListener(NodeTypeRegistryListener)
public Name[] getRegisteredNodeTypes() throws RepositoryException
NodeTypeRegistry
getRegisteredNodeTypes
in interface NodeTypeRegistry
RepositoryException
NodeTypeRegistry.getRegisteredNodeTypes()
public boolean isRegistered(Name nodeTypeName)
isRegistered
in interface NodeTypeRegistry
NodeTypeRegistry.isRegistered(Name)
public void registerNodeTypes(Collection<QNodeTypeDefinition> ntDefs, boolean allowUpdate) throws NodeTypeExistsException, InvalidNodeTypeDefinitionException, RepositoryException
NodeTypeRegistry
allowUpdate
is true
existing node types will be updated, otherwise
an NodeTypeExistsException
is thrown.registerNodeTypes
in interface NodeTypeRegistry
NodeTypeExistsException
InvalidNodeTypeDefinitionException
RepositoryException
NodeTypeRegistry.registerNodeTypes(Collection, boolean)
public void unregisterNodeTypes(Collection<Name> nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException
NodeTypeRegistry
unregisterNodeTypes
in interface NodeTypeRegistry
nodeTypeNames
- a collection of Name
objects denoting the
node types to be unregisteredNoSuchNodeTypeException
- if any of the specified names does not
denote a registered node type.RepositoryException
- if another error occursNodeTypeRegistry.unregisterNodeTypes(Collection)
public QNodeTypeDefinition getNodeTypeDefinition(Name nodeTypeName) throws NoSuchNodeTypeException
NodeTypeRegistry
getNodeTypeDefinition
in interface NodeTypeRegistry
nodeTypeName
- name of node type whose definition should be returned.NoSuchNodeTypeException
- if a node type with the given name
does not existNodeTypeRegistry.getNodeTypeDefinition(Name)
public EffectiveNodeType getEffectiveNodeType(Name ntName) throws NoSuchNodeTypeException
EffectiveNodeTypeProvider
EffectiveNodeType
from the given
NodeType
name.getEffectiveNodeType
in interface EffectiveNodeTypeProvider
NoSuchNodeTypeException
EffectiveNodeTypeProvider.getEffectiveNodeType(Name)
public EffectiveNodeType getEffectiveNodeType(Name[] ntNames) throws ConstraintViolationException, NoSuchNodeTypeException
EffectiveNodeTypeProvider
EffectiveNodeType
from the given array of
NodeType
names.getEffectiveNodeType
in interface EffectiveNodeTypeProvider
ConstraintViolationException
NoSuchNodeTypeException
EffectiveNodeTypeProvider.getEffectiveNodeType(Name[])
public EffectiveNodeType getEffectiveNodeType(Name[] ntNames, Map<Name,QNodeTypeDefinition> ntdMap) throws ConstraintViolationException, NoSuchNodeTypeException
getEffectiveNodeType
in interface EffectiveNodeTypeProvider
ConstraintViolationException
NoSuchNodeTypeException
EffectiveNodeTypeProvider.getEffectiveNodeType(Name[], Map)
public EffectiveNodeType getEffectiveNodeType(QNodeTypeDefinition ntd, Map<Name,QNodeTypeDefinition> ntdMap) throws ConstraintViolationException, NoSuchNodeTypeException
EffectiveNodeTypeProvider
getEffectiveNodeType
in interface EffectiveNodeTypeProvider
ConstraintViolationException
NoSuchNodeTypeException
EffectiveNodeTypeProvider.getEffectiveNodeType(QNodeTypeDefinition, Map)
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.