Class ReadWriteNodeTypeManager
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager
-
- org.apache.jackrabbit.oak.plugins.nodetype.write.ReadWriteNodeTypeManager
-
- All Implemented Interfaces:
NodeTypeManager,DefinitionProvider,EffectiveNodeTypeProvider
public abstract class ReadWriteNodeTypeManager extends ReadOnlyNodeTypeManager
ReadWriteNodeTypeManagerextends theReadOnlyNodeTypeManagerwith support for operations that modify node types.registerNodeType(NodeTypeDefinition, boolean)registerNodeTypes(NodeTypeDefinition[], boolean)unregisterNodeType(String)unregisterNodeTypes(String[])- plus related template factory methods
refresh()callback to e.g. inform an associated session that it should refresh to make the changes visible.Subclass responsibility is to provide an implementation of
ReadOnlyNodeTypeManager.getTypes()for read only access to the tree where node types are stored in content andgetWriteRoot()for write access to the repository in order to modify node types stored in content. A subclass may also want to override the default implementation ofReadOnlyNodeTypeManagerfor the following methods:
-
-
Constructor Summary
Constructors Constructor Description ReadWriteNodeTypeManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeDefinitionTemplatecreateNodeDefinitionTemplate()Returns an emptyNodeDefinitionTemplatewhich can then be used to create a child node definition and attached to aNodeTypeTemplate.NodeTypeTemplatecreateNodeTypeTemplate()Returns an emptyNodeTypeTemplatewhich can then be used to define a node type and passed toNodeTypeManager.registerNodeType.NodeTypeTemplatecreateNodeTypeTemplate(NodeTypeDefinition ntd)Returns aNodeTypeTemplateholding the specified node type definition.PropertyDefinitionTemplatecreatePropertyDefinitionTemplate()Returns an emptyPropertyDefinitionTemplatewhich can then be used to create a property definition and attached to aNodeTypeTemplate.NodeTyperegisterNodeType(NodeTypeDefinition ntd, boolean allowUpdate)This implementation always throws aUnsupportedRepositoryOperationException.NodeTypeIteratorregisterNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)This implementation always throws aUnsupportedRepositoryOperationException.voidunregisterNodeType(String name)This implementation always throws aUnsupportedRepositoryOperationException.voidunregisterNodeTypes(String[] names)This implementation always throws aUnsupportedRepositoryOperationException.-
Methods inherited from class org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager
getAllNodeTypes, getDefinition, getDefinition, getDefinition, getEffectiveNodeType, getEffectiveNodeType, getInstance, getMixinNodeTypes, getNodeType, getPrimaryNodeTypes, getRootDefinition, hasNodeType, isNodeType, isNodeType, isNodeType
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.spi.nodetype.EffectiveNodeTypeProvider
isNodeType
-
-
-
-
Method Detail
-
createNodeTypeTemplate
public NodeTypeTemplate createNodeTypeTemplate()
Description copied from interface:NodeTypeManagerReturns an emptyNodeTypeTemplatewhich can then be used to define a node type and passed toNodeTypeManager.registerNodeType.- Specified by:
createNodeTypeTemplatein interfaceNodeTypeManager- Overrides:
createNodeTypeTemplatein classReadOnlyNodeTypeManager- Returns:
- A
NodeTypeTemplate.
-
createNodeTypeTemplate
public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws ConstraintViolationException
Description copied from interface:NodeTypeManagerReturns aNodeTypeTemplateholding the specified node type definition. This template can then be altered and passed toNodeTypeManager.registerNodeType.- Specified by:
createNodeTypeTemplatein interfaceNodeTypeManager- Overrides:
createNodeTypeTemplatein classReadOnlyNodeTypeManager- Parameters:
ntd- aNodeTypeDefinition.- Returns:
- A
NodeTypeTemplate. - Throws:
ConstraintViolationException
-
createNodeDefinitionTemplate
public NodeDefinitionTemplate createNodeDefinitionTemplate()
Description copied from interface:NodeTypeManagerReturns an emptyNodeDefinitionTemplatewhich can then be used to create a child node definition and attached to aNodeTypeTemplate.- Specified by:
createNodeDefinitionTemplatein interfaceNodeTypeManager- Overrides:
createNodeDefinitionTemplatein classReadOnlyNodeTypeManager- Returns:
- A
NodeDefinitionTemplate.
-
createPropertyDefinitionTemplate
public PropertyDefinitionTemplate createPropertyDefinitionTemplate()
Description copied from interface:NodeTypeManagerReturns an emptyPropertyDefinitionTemplatewhich can then be used to create a property definition and attached to aNodeTypeTemplate.- Specified by:
createPropertyDefinitionTemplatein interfaceNodeTypeManager- Overrides:
createPropertyDefinitionTemplatein classReadOnlyNodeTypeManager- Returns:
- A
PropertyDefinitionTemplate.
-
registerNodeType
public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws RepositoryException
Description copied from class:ReadOnlyNodeTypeManagerThis implementation always throws aUnsupportedRepositoryOperationException.- Specified by:
registerNodeTypein interfaceNodeTypeManager- Overrides:
registerNodeTypein classReadOnlyNodeTypeManager- Parameters:
ntd- anNodeTypeDefinition.allowUpdate- a boolean- Returns:
- the registered node type
- Throws:
InvalidNodeTypeDefinitionException- if theNodeTypeDefinitionis invalid.NodeTypeExistsException- ifallowUpdateisfalseand theNodeTypeDefinitionspecifies a node type name that is already registered.UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.
-
registerNodeTypes
public final NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate) throws RepositoryException
Description copied from class:ReadOnlyNodeTypeManagerThis implementation always throws aUnsupportedRepositoryOperationException.- Specified by:
registerNodeTypesin interfaceNodeTypeManager- Overrides:
registerNodeTypesin classReadOnlyNodeTypeManager- Parameters:
ntds- a collection ofNodeTypeDefinitionsallowUpdate- a boolean- Returns:
- the registered node types.
- Throws:
InvalidNodeTypeDefinitionException- if aNodeTypeDefinitionwithin theCollectionis invalid or if theCollectioncontains an object of a type other thanNodeTypeDefinition.NodeTypeExistsException- ifallowUpdateisfalseand aNodeTypeDefinitionwithin theCollectionspecifies a node type name that is already registered.UnsupportedRepositoryOperationException- if this implementation does not support node type registration.RepositoryException- if another error occurs.
-
unregisterNodeType
public void unregisterNodeType(String name) throws RepositoryException
Description copied from class:ReadOnlyNodeTypeManagerThis implementation always throws aUnsupportedRepositoryOperationException.- Specified by:
unregisterNodeTypein interfaceNodeTypeManager- Overrides:
unregisterNodeTypein classReadOnlyNodeTypeManager- Parameters:
name- aString.- Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.NoSuchNodeTypeException- if no registered node type exists with the specified name.RepositoryException- if another error occurs.
-
unregisterNodeTypes
public void unregisterNodeTypes(String[] names) throws RepositoryException
Description copied from class:ReadOnlyNodeTypeManagerThis implementation always throws aUnsupportedRepositoryOperationException.- Specified by:
unregisterNodeTypesin interfaceNodeTypeManager- Overrides:
unregisterNodeTypesin classReadOnlyNodeTypeManager- Parameters:
names- aStringarray- Throws:
UnsupportedRepositoryOperationException- if this implementation does not support node type registration.NoSuchNodeTypeException- if one of the names listed is not a registered node type.RepositoryException- if another error occurs.
-
-