|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.jcr.JcrNodeTypeManager
@Immutable public class JcrNodeTypeManager
Local implementation of @{link NodeTypeManager}. This class handles translation between Name
s and String
s based
on the namespace registry from the session's execution context in order to support transient namespace remappings. All
NodeType
s returned by this implementation are wrapped with the execution context of the session to allow proper ongoing
handling of names. This implies that reference equality is not a safe test for node type equivalence.
RepositoryNodeTypeManager
Method Summary | |
---|---|
NodeDefinitionTemplate |
createNodeDefinitionTemplate()
Returns an empty PropertyDefinitionTemplate which can then be used to create a property definition and attached to
a NodeTypeTemplate . |
NodeTypeTemplate |
createNodeTypeTemplate()
Returns an empty NodeTypeTemplate which can then be used to define a node type and passed to
registerNodeType(NodeTypeDefinition, boolean) |
PropertyDefinitionTemplate |
createPropertyDefinitionTemplate()
Returns an empty PropertyDefinitionTemplate which can then be used to create a property definition and attached to
a NodeTypeTemplate . |
javax.jcr.nodetype.NodeTypeIterator |
getAllNodeTypes()
|
javax.jcr.nodetype.NodeTypeIterator |
getMixinNodeTypes()
|
org.jboss.dna.jcr.JcrNodeType |
getNodeType(String nodeTypeName)
|
javax.jcr.nodetype.NodeTypeIterator |
getPrimaryNodeTypes()
|
boolean |
isDerivedFrom(String[] testTypeNames,
String primaryTypeName,
String[] mixinNames)
Determine if any of the test type names are equal to or have been derived from the primary type or any of the mixins. |
javax.jcr.nodetype.NodeType |
registerNodeType(NodeTypeDefinition template,
boolean allowUpdate)
Registers a new node type or updates an existing node type using the specified definition and returns the resulting NodeType object. |
javax.jcr.nodetype.NodeTypeIterator |
registerNodeTypes(Collection<NodeTypeDefinition> templates,
boolean allowUpdates)
Registers or updates the specified Collection of NodeTypeDefinition objects. |
javax.jcr.nodetype.NodeTypeIterator |
registerNodeTypes(JcrNodeTypeSource source)
Registers the node types from the given JcrNodeTypeSource . |
void |
unregisterNodeType(Collection<String> nodeTypeNames)
Allows the collection of node types to be unregistered if they are not referenced by other node types as supertypes, default primary types of child nodes, or required primary types of child nodes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public javax.jcr.nodetype.NodeTypeIterator getAllNodeTypes()
getAllNodeTypes
in interface javax.jcr.nodetype.NodeTypeManager
NodeTypeManager.getAllNodeTypes()
public javax.jcr.nodetype.NodeTypeIterator getMixinNodeTypes()
getMixinNodeTypes
in interface javax.jcr.nodetype.NodeTypeManager
NodeTypeManager.getMixinNodeTypes()
public org.jboss.dna.jcr.JcrNodeType getNodeType(String nodeTypeName) throws javax.jcr.nodetype.NoSuchNodeTypeException, javax.jcr.RepositoryException
getNodeType
in interface javax.jcr.nodetype.NodeTypeManager
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException
NodeTypeManager.getNodeType(java.lang.String)
public javax.jcr.nodetype.NodeTypeIterator getPrimaryNodeTypes()
getPrimaryNodeTypes
in interface javax.jcr.nodetype.NodeTypeManager
NodeTypeManager.getPrimaryNodeTypes()
public javax.jcr.nodetype.NodeType registerNodeType(NodeTypeDefinition template, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
NodeType
object.
Typically, the object passed to this method will be a NodeTypeTemplate
(a subclass of NodeTypeDefinition
)
acquired from createNodeTypeTemplate()
and then filled-in with definition information.
template
- the new node type to registerallowUpdate
- must be false
; DNA does not allow updating node types at this time
newly created node type
InvalidNodeTypeDefinitionException
- if the NodeTypeDefinition
is invalid
NodeTypeExistsException
- if allowUpdate
is false and the NodeTypeDefinition
specifies a node type
name that already exists
javax.jcr.UnsupportedRepositoryOperationException
- if allowUpdate
is true; DNA does not allow updating node types at
this time.
javax.jcr.AccessDeniedException
- if the current session does not have the register type permission
.
javax.jcr.RepositoryException
- if another error occurspublic javax.jcr.nodetype.NodeTypeIterator registerNodeTypes(Collection<NodeTypeDefinition> templates, boolean allowUpdates) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
NodeTypeDefinition
objects. This method is used to register or
update a set of node types with mutual dependencies. Returns an iterator over the resulting NodeType
objects.
The effect of the method is "all or nothing"; if an error occurs, no node types are registered or updated.
templates
- the new node types to registerallowUpdates
- must be false
; DNA does not allow updating node types at this time
newly created node types
InvalidNodeTypeDefinitionException
- if a NodeTypeDefinition
within the collection is invalid
NodeTypeExistsException
- if allowUpdate
is false and a NodeTypeDefinition
within the collection
specifies a node type name that already exists
javax.jcr.UnsupportedRepositoryOperationException
- if allowUpdate
is true; DNA does not allow updating node types at
this time.
javax.jcr.AccessDeniedException
- if the current session does not have the register type permission
.
javax.jcr.RepositoryException
- if another error occurspublic javax.jcr.nodetype.NodeTypeIterator registerNodeTypes(JcrNodeTypeSource source) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
JcrNodeTypeSource
. This method is used to register or update a set of node
types with mutual dependencies. Returns an iterator over the resulting NodeType
objects.
The effect of the method is "all or nothing"; if an error occurs, no node types are registered or updated.
source
- the new node types to register
newly created node types
InvalidNodeTypeDefinitionException
- if a NodeTypeDefinition
within the collection is invalid
NodeTypeExistsException
- if allowUpdate
is false and a NodeTypeDefinition
within the collection
specifies a node type name that already exists
javax.jcr.UnsupportedRepositoryOperationException
- if allowUpdate
is true; DNA does not allow updating node types at
this time.
javax.jcr.AccessDeniedException
- if the current session does not have the register type permission
.
javax.jcr.RepositoryException
- if another error occurspublic void unregisterNodeType(Collection<String> nodeTypeNames) throws javax.jcr.nodetype.NoSuchNodeTypeException, InvalidNodeTypeDefinitionException, javax.jcr.RepositoryException
NOTE: This method does not check to see if any of the node types are currently being used. Unregistering a node type that is being used will cause the system to become unstable
nodeTypeNames
- the names of the node types to be unregistered
javax.jcr.nodetype.NoSuchNodeTypeException
- if any of the node type names do not correspond to a registered node type
InvalidNodeTypeDefinitionException
- if any of the node types with the given names cannot be unregistered because
they are the supertype, one of the required primary types, or a default primary type of a node type that is not
being unregistered.
javax.jcr.RepositoryException
- if any other error occurspublic NodeTypeTemplate createNodeTypeTemplate() throws javax.jcr.RepositoryException
NodeTypeTemplate
which can then be used to define a node type and passed to
registerNodeType(NodeTypeDefinition, boolean)
NodeTypeTemplate
which can then be used to define a node type and passed to
registerNodeType(NodeTypeDefinition, boolean)
.
javax.jcr.RepositoryException
- if another error occurspublic NodeDefinitionTemplate createNodeDefinitionTemplate() throws javax.jcr.RepositoryException
PropertyDefinitionTemplate
which can then be used to create a property definition and attached to
a NodeTypeTemplate
.
PropertyDefinitionTemplate
which can then be used to create a property definition and attached to
a NodeTypeTemplate
.
javax.jcr.RepositoryException
- if another error occurspublic PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws javax.jcr.RepositoryException
PropertyDefinitionTemplate
which can then be used to create a property definition and attached to
a NodeTypeTemplate
.
PropertyDefinitionTemplate
which can then be used to create a property definition and attached to
a NodeTypeTemplate
.
javax.jcr.RepositoryException
- if another error occurspublic boolean isDerivedFrom(String[] testTypeNames, String primaryTypeName, String[] mixinNames) throws javax.jcr.RepositoryException
testTypeNames
- the names of the types or mixins being tested against (never null
)primaryTypeName
- the primary type name (never null
)mixinNames
- the mixin names (may be null
)
true
if at least one test type name is equal to or derived from the primary type or one of the mixins
javax.jcr.RepositoryException
- if there is an exception obtaining node types
IllegalArgumentException
- if testTypeNames
is null
or empty or if
primaryTypeName
is null
or zero length
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |