public class NodeImpl extends ItemImpl implements javax.jcr.Node, JackrabbitNode
NodeImpl
implements the Node
interface.Modifier and Type | Field and Description |
---|---|
protected static short |
CREATED |
id, itemMgr, sessionContext, stateMgr, STATUS_DESTROYED, STATUS_INVALIDATED, STATUS_MODIFIED, STATUS_NORMAL
Modifier | Constructor and Description |
---|---|
protected |
NodeImpl(ItemManager itemMgr,
SessionContext sessionContext,
AbstractNodeData data)
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(javax.jcr.ItemVisitor visitor) |
void |
addMixin(Name mixinName)
Same as
Node.addMixin(String) except that it takes a
Name instead of a String . |
void |
addMixin(String mixinName)
Wrapper around
addMixin(Name) . |
NodeImpl |
addNode(Name nodeName,
Name nodeTypeName,
NodeId id)
Same as
except that
this method takes Name arguments instead of
String s and has an additional uuid argument. |
javax.jcr.Node |
addNode(String relPath) |
javax.jcr.Node |
addNode(String relPath,
String nodeTypeName) |
javax.jcr.Node |
addNodeWithUuid(String relPath,
String uuid)
Adds a node with the given UUID.
|
javax.jcr.Node |
addNodeWithUuid(String relPath,
String nodeTypeName,
String uuid)
Adds a node with the given node type and UUID.
|
void |
assignLifecyclePolicy(javax.jcr.Node policy,
String state)
Assigns the given lifecycle policy to this node and sets the
current state to the one given.
|
boolean |
canAddMixin(String mixinName) |
void |
cancelMerge(javax.jcr.version.Version version)
Deprecated.
|
javax.jcr.version.Version |
checkin()
Deprecated.
|
javax.jcr.version.Version |
checkin(Calendar created)
Deprecated.
|
protected void |
checkLock()
Deprecated.
|
void |
checkout()
Deprecated.
|
protected void |
checkSetProperty()
Checks various pre-conditions that are common to all
setProperty() methods. |
NodeImpl |
clone(NodeImpl src,
Name name)
Create a child node that is a clone of a shareable node.
|
protected NodeImpl |
createChildNode(Name name,
NodeTypeImpl nodeType,
NodeId id) |
protected PropertyImpl |
createChildProperty(Name name,
int type,
PropertyDefinitionImpl def)
Creates a new property with the given name and
type hint and
property definition. |
void |
doneMerge(javax.jcr.version.Version version)
Deprecated.
|
void |
followLifecycleTransition(String transition)
Transitions this node through its lifecycle to the given target state.
|
String[] |
getAllowedLifecycleTransistions()
Returns all allowed transitions from the current lifecycle state of
this node.
|
protected NodeDefinitionImpl |
getApplicableChildNodeDefinition(Name nodeName,
Name nodeTypeName)
Returns the applicable child node definition for a child node with the
specified name and node type.
|
protected PropertyDefinitionImpl |
getApplicablePropertyDefinition(Name propertyName,
int type,
boolean multiValued,
boolean exactTypeMatch)
Returns the applicable property definition for a property with the
specified name and type.
|
javax.jcr.version.Version |
getBaseVersion()
Deprecated.
|
String |
getCorrespondingNodePath(String workspaceName) |
javax.jcr.nodetype.NodeDefinition |
getDefinition() |
EffectiveNodeType |
getEffectiveNodeType()
Returns the effective (i.e.
|
String |
getIdentifier() |
int |
getIndex() |
javax.jcr.lock.Lock |
getLock() |
javax.jcr.nodetype.NodeType[] |
getMixinNodeTypes() |
Set<Name> |
getMixinTypeNames()
Returns the
Name s of this node's mixin types. |
String |
getName() |
NodeImpl |
getNode(Name name)
Returns the child node of
this node with the specified
name . |
NodeImpl |
getNode(Name name,
int index)
Returns the child node of
this node with the specified
name . |
javax.jcr.Node |
getNode(String relPath) |
NodeId |
getNodeId()
Returns the identifier of this
Node . |
javax.jcr.NodeIterator |
getNodes() |
javax.jcr.NodeIterator |
getNodes(String namePattern) |
javax.jcr.NodeIterator |
getNodes(String[] nameGlobs) |
protected PropertyImpl |
getOrCreateProperty(Name name,
int type,
boolean multiValued,
boolean exactTypeMatch,
BitSet status) |
protected PropertyImpl |
getOrCreateProperty(String name,
int type,
boolean multiValued,
boolean exactTypeMatch,
BitSet status) |
protected ItemState |
getOrCreateTransientItemState() |
javax.jcr.Node |
getParent() |
NodeId |
getParentId()
Helper method, returning the parent id this node is attached to.
|
javax.jcr.Item |
getPrimaryItem() |
javax.jcr.nodetype.NodeType |
getPrimaryNodeType() |
Name |
getPrimaryNodeTypeName()
Returns the name of the primary node type as exposed on the node state
without retrieving the node type.
|
Path |
getPrimaryPath()
Returns the primary path to this
Item . |
javax.jcr.PropertyIterator |
getProperties() |
javax.jcr.PropertyIterator |
getProperties(String namePattern) |
javax.jcr.PropertyIterator |
getProperties(String[] nameGlobs) |
PropertyImpl |
getProperty(Name name)
Returns the property of
this node with the specified
name . |
javax.jcr.Property |
getProperty(String relPath) |
Name |
getQName()
Same as
except that
this method returns a Name instead of a
String . |
javax.jcr.PropertyIterator |
getReferences() |
javax.jcr.PropertyIterator |
getReferences(String name) |
javax.jcr.NodeIterator |
getSharedSet()
Returns an iterator over all nodes that are in the shared set of this
node.
|
String |
getUUID() |
javax.jcr.version.VersionHistory |
getVersionHistory()
Deprecated.
|
javax.jcr.PropertyIterator |
getWeakReferences() |
javax.jcr.PropertyIterator |
getWeakReferences(String name) |
boolean |
hasNode(Name name)
Indicates whether a child node with the specified
name exists. |
boolean |
hasNode(Name name,
int index)
Indicates whether a child node with the specified
name exists. |
boolean |
hasNode(String relPath) |
boolean |
hasNodes() |
protected boolean |
hasPendingChanges()
Determines if there are pending unsaved changes either on this
node or on any node or property in the subtree below it.
|
boolean |
hasProperties() |
boolean |
hasProperty(Name name)
Indicates whether a property with the specified
name exists. |
boolean |
hasProperty(String relPath) |
boolean |
holdsLock() |
protected javax.jcr.Property |
internalSetProperty(Name name,
InternalValue value)
Sets the internal value of a property without checking any constraints.
|
protected javax.jcr.Property |
internalSetProperty(Name name,
InternalValue[] values)
Sets the internal value of a property without checking any constraints.
|
protected javax.jcr.Property |
internalSetProperty(Name name,
InternalValue[] values,
int type)
Sets the internal value of a property without checking any constraints.
|
boolean |
isAccessControllable()
Test if this node is access controlled.
|
boolean |
isCheckedOut() |
boolean |
isLocked() |
boolean |
isNode() |
boolean |
isNodeType(Name ntName)
Same as
Node.isNodeType(String) except that it takes a
Name instead of a String . |
boolean |
isNodeType(String nodeTypeName) |
javax.jcr.lock.Lock |
lock(boolean isDeep,
boolean isSessionScoped) |
protected void |
makePersistent() |
javax.jcr.NodeIterator |
merge(String srcWorkspace,
boolean bestEffort)
Deprecated.
|
protected void |
onRedefine(QNodeDefinition def) |
protected void |
onRemove(NodeId parentId) |
void |
orderBefore(Path.Element srcName,
Path.Element dstName)
Same as
except that
this method takes a Path.Element arguments instead of
String s. |
void |
orderBefore(String srcName,
String destName) |
protected void |
removeChildNode(NodeId childId) |
protected void |
removeChildProperty(Name propName) |
void |
removeMixin(Name mixinName)
Same as
Node.removeMixin(String) except that it takes a
Name instead of a String . |
void |
removeMixin(String mixinName)
Wrapper around
removeMixin(Name) . |
void |
removeShare()
A special kind of
remove() that removes this node, but does
not remove any other node in the shared set of this node. |
void |
removeSharedSet()
A special kind of
remove() that removes this node and every
other node in the shared set of this node. |
void |
rename(String newName) |
protected void |
renameChildNode(Name oldName,
int index,
NodeId id,
Name newName)
Deprecated.
use #renameChildNode(NodeId, Name, boolean)
|
protected void |
renameChildNode(NodeId id,
Name newName,
boolean replace) |
NodeImpl |
replaceChildNode(NodeId id,
Name nodeName,
Name nodeTypeName,
Name[] mixinNames)
Replaces the child node with the specified
id
by a new child node with the same id and specified nodeName ,
nodeTypeName and mixinNames . |
protected NodeId |
resolveRelativeNodePath(String relPath)
Returns the id of the node at
relPath or null
if no node exists at relPath . |
protected PropertyId |
resolveRelativePropertyPath(String relPath)
Returns the id of the property at
relPath or null
if no property exists at relPath . |
void |
restore(String versionName,
boolean removeExisting)
Deprecated.
|
void |
restore(javax.jcr.version.Version version,
boolean removeExisting)
Deprecated.
|
void |
restore(javax.jcr.version.Version version,
String relPath,
boolean removeExisting)
Deprecated.
|
void |
restoreByLabel(String versionLabel,
boolean removeExisting)
Deprecated.
|
protected void |
restoreTransient(NodeState transientState) |
void |
setMixins(String[] mixinNames) |
void |
setPrimaryType(String nodeTypeName) |
PropertyImpl |
setProperty(Name name,
javax.jcr.Value value)
Same as
except that
this method takes a Name name argument instead of a
String . |
PropertyImpl |
setProperty(Name name,
javax.jcr.Value[] values,
int type)
Same as
except
that this method takes a Name name argument instead of a
String . |
protected PropertyImpl |
setProperty(Name name,
javax.jcr.Value[] values,
int type,
boolean enforceType)
Implementation for
setProperty() using a Value
array. |
javax.jcr.Property |
setProperty(String name,
BigDecimal value) |
javax.jcr.Property |
setProperty(String name,
javax.jcr.Binary value) |
javax.jcr.Property |
setProperty(String name,
boolean value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
Calendar value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
double value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
InputStream value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
long value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
javax.jcr.Node value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
String value)
Wrapper around
setProperty(String, Value) |
javax.jcr.Property |
setProperty(String name,
String[] strings)
Wrapper around
setProperty(Name, Value[], int, boolean) |
javax.jcr.Property |
setProperty(String name,
String[] values,
int type)
Wrapper around
setProperty(Name, Value[], int, boolean) |
javax.jcr.Property |
setProperty(String name,
String value,
int type)
Wrapper around
setProperty(String, Value, int) |
javax.jcr.Property |
setProperty(String name,
javax.jcr.Value value)
Wrapper around
SetPropertyOperation |
javax.jcr.Property |
setProperty(String name,
javax.jcr.Value[] values)
Wrapper around
setProperty(Name, Value[], int, boolean) |
javax.jcr.Property |
setProperty(String name,
javax.jcr.Value[] values,
int type)
Wrapper around
setProperty(Name, Value[], int, boolean) |
javax.jcr.Property |
setProperty(String name,
javax.jcr.Value value,
int type)
Wrapper around
SetPropertyOperation |
String |
toString()
Return a string representation of this node for diagnostic purposes.
|
void |
unlock() |
void |
update(String srcWorkspaceName) |
getAncestor, getDepth, getId, getPath, getQName, getSession, getType, getValueFactory, getValues, isModified, isNew, isSame, isTransactionalNew, isTransient, itemSanityCheck, perform, refresh, remove, safeGetJCRPath, sanityCheck, save, setRemoved
protected static final short CREATED
protected NodeImpl(ItemManager itemMgr, SessionContext sessionContext, AbstractNodeData data)
itemMgr
- the ItemManager
that created this Node
instancesessionContext
- the component context of the associated sessiondata
- the node dataprotected PropertyId resolveRelativePropertyPath(String relPath) throws javax.jcr.RepositoryException
relPath
or null
if no property exists at relPath
.
Note that access rights are not checked.
relPath
- relative path of a (possible) propertyrelPath
or
null
if no property exists at relPath
javax.jcr.RepositoryException
- if relPath
is not a valid
relative pathprotected NodeId resolveRelativeNodePath(String relPath) throws javax.jcr.RepositoryException
relPath
or null
if no node exists at relPath
.
Note that access rights are not checked.
relPath
- relative path of a (possible) noderelPath
or
null
if no node exists at relPath
javax.jcr.RepositoryException
- if relPath
is not a valid
relative pathprotected boolean hasPendingChanges() throws javax.jcr.RepositoryException
true
if there are pending unsaved changes,
false
otherwise.javax.jcr.RepositoryException
- if an error occurredprotected ItemState getOrCreateTransientItemState() throws javax.jcr.RepositoryException
getOrCreateTransientItemState
in class ItemImpl
javax.jcr.RepositoryException
protected PropertyImpl getOrCreateProperty(String name, int type, boolean multiValued, boolean exactTypeMatch, BitSet status) throws javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
name
- type
- multiValued
- exactTypeMatch
- status
- javax.jcr.nodetype.ConstraintViolationException
- if no applicable property definition
could be foundjavax.jcr.RepositoryException
- if another error occursprotected PropertyImpl getOrCreateProperty(Name name, int type, boolean multiValued, boolean exactTypeMatch, BitSet status) throws javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
name
- type
- multiValued
- exactTypeMatch
- status
- javax.jcr.nodetype.ConstraintViolationException
- if no applicable property definition
could be foundjavax.jcr.RepositoryException
- if another error occursprotected PropertyImpl createChildProperty(Name name, int type, PropertyDefinitionImpl def) throws javax.jcr.RepositoryException
type
hint and
property definition. If the given property definition is not of type
UNDEFINED
, then it takes precedence over the
type
hint.name
- the name of the property to create.type
- the type hint.def
- the associated property definition.javax.jcr.RepositoryException
- if the property cannot be created.protected NodeImpl createChildNode(Name name, NodeTypeImpl nodeType, NodeId id) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void renameChildNode(Name oldName, int index, NodeId id, Name newName) throws javax.jcr.RepositoryException
oldName
- index
- id
- newName
- javax.jcr.RepositoryException
protected void renameChildNode(NodeId id, Name newName, boolean replace) throws javax.jcr.RepositoryException
id
- newName
- replace
- javax.jcr.RepositoryException
protected void removeChildProperty(Name propName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void removeChildNode(NodeId childId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void onRedefine(QNodeDefinition def) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void onRemove(NodeId parentId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public Set<Name> getMixinTypeNames()
Name
s of this node's mixin types.Name
s of this node's mixin types.public EffectiveNodeType getEffectiveNodeType() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursprotected NodeDefinitionImpl getApplicableChildNodeDefinition(Name nodeName, Name nodeTypeName) throws javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
nodeName
- nodeTypeName
- javax.jcr.nodetype.ConstraintViolationException
- if no applicable child node definition
could be foundjavax.jcr.RepositoryException
- if another error occursprotected PropertyDefinitionImpl getApplicablePropertyDefinition(Name propertyName, int type, boolean multiValued, boolean exactTypeMatch) throws javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
propertyName
- type
- multiValued
- exactTypeMatch
- javax.jcr.nodetype.ConstraintViolationException
- if no applicable property definition
could be foundjavax.jcr.RepositoryException
- if another error occursprotected void makePersistent() throws javax.jcr.RepositoryException
makePersistent
in class ItemImpl
javax.jcr.RepositoryException
protected void restoreTransient(NodeState transientState) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void addMixin(Name mixinName) throws javax.jcr.RepositoryException
Node.addMixin(String)
except that it takes a
Name
instead of a String
.javax.jcr.RepositoryException
Node.addMixin(String)
public void removeMixin(Name mixinName) throws javax.jcr.RepositoryException
Node.removeMixin(String)
except that it takes a
Name
instead of a String
.javax.jcr.RepositoryException
Node.removeMixin(String)
public boolean isNodeType(Name ntName) throws javax.jcr.RepositoryException
Node.isNodeType(String)
except that it takes a
Name
instead of a String
.ntName
- name of node typetrue
if this node is of the specified node type;
otherwise false
javax.jcr.RepositoryException
protected void checkSetProperty() throws javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
setProperty()
methods. The checks performed are:
Property.setValue()
methods.javax.jcr.version.VersionException
- if this node is not checked-outjavax.jcr.lock.LockException
- if this node is locked by somebody elsejavax.jcr.RepositoryException
- if another error occursNode.setProperty(java.lang.String, javax.jcr.Value)
protected javax.jcr.Property internalSetProperty(Name name, InternalValue value) throws javax.jcr.ValueFormatException, javax.jcr.RepositoryException
Note that no type conversion is being performed, i.e. it's the caller's responsibility to make sure that the type of the given value is compatible with the specified property's definition.
name
- value
- javax.jcr.ValueFormatException
javax.jcr.RepositoryException
protected javax.jcr.Property internalSetProperty(Name name, InternalValue[] values) throws javax.jcr.ValueFormatException, javax.jcr.RepositoryException
Note that no type conversion is being performed, i.e. it's the caller's responsibility to make sure that the type of the given values is compatible with the specified property's definition.
name
- values
- javax.jcr.ValueFormatException
javax.jcr.RepositoryException
protected javax.jcr.Property internalSetProperty(Name name, InternalValue[] values, int type) throws javax.jcr.ValueFormatException, javax.jcr.RepositoryException
Note that no type conversion is being performed, i.e. it's the caller's responsibility to make sure that the type of the given values is compatible with the specified property's definition.
name
- values
- type
- javax.jcr.ValueFormatException
javax.jcr.RepositoryException
public NodeImpl getNode(Name name) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
this
node with the specified
name
.name
- The name of the child node to retrieve.name
.javax.jcr.ItemNotFoundException
- If no child node exists with the
specified name.javax.jcr.RepositoryException
- If another error occurs.public NodeImpl getNode(Name name, int index) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
this
node with the specified
name
.name
- The name of the child node to retrieve.index
- The index of the child node to retrieve (in the case of same-name siblings).name
.javax.jcr.ItemNotFoundException
- If no child node exists with the
specified name.javax.jcr.RepositoryException
- If another error occurs.public boolean hasNode(Name name) throws javax.jcr.RepositoryException
name
exists.
Returns true
if the child node exists and false
otherwise.name
- The name of the child node.true
if the child node exists; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.public boolean hasNode(Name name, int index) throws javax.jcr.RepositoryException
name
exists.
Returns true
if the child node exists and false
otherwise.name
- The name of the child node.index
- The index of the child node (in the case of same-name siblings).true
if the child node exists; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.public PropertyImpl getProperty(Name name) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
this
node with the specified
name
.name
- The name of the property to retrieve.name
.javax.jcr.ItemNotFoundException
- If no property exists with the
specified name.javax.jcr.RepositoryException
- If another error occurs.public boolean hasProperty(Name name) throws javax.jcr.RepositoryException
name
exists.
Returns true
if the property exists and false
otherwise.name
- The name of the property.true
if the property exists; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.public NodeImpl addNode(Name nodeName, Name nodeTypeName, NodeId id) throws javax.jcr.RepositoryException
Node.addNode(String, String)
except that
this method takes Name
arguments instead of
String
s and has an additional uuid
argument.
Important Notice: This method is for internal use only! Passing already assigned uuid's might lead to unexpected results and data corruption in the worst case.
nodeName
- name of the new nodenodeTypeName
- name of the new node's node type or null
if it should be determined automaticallyid
- id of the new node or null
if a new
id should be assignedjavax.jcr.RepositoryException
- if the node can not addedpublic PropertyImpl setProperty(Name name, javax.jcr.Value[] values, int type) throws javax.jcr.ValueFormatException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
Node.setProperty(String, Value[], int)
except
that this method takes a Name
name argument instead of a
String
.name
- values
- type
- javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
public PropertyImpl setProperty(Name name, javax.jcr.Value value) throws javax.jcr.RepositoryException
Node.setProperty(String, Value)
except that
this method takes a Name
name argument instead of a
String
.javax.jcr.RepositoryException
public Name getQName() throws javax.jcr.RepositoryException
ItemImpl
Item.getName()
except that
this method returns a Name
instead of a
String
.getQName
in class ItemImpl
Name
javax.jcr.RepositoryException
- if an error occurs.ItemImpl.getQName()
public NodeId getNodeId()
Node
.Node
public Name getPrimaryNodeTypeName()
public boolean isAccessControllable() throws javax.jcr.RepositoryException
"rep:AccessControllable"
and if it has a child node named
AccessControlConstants.N_POLICY
.true
if this node is access controlled and has a
rep:policy child; false
otherwise.javax.jcr.RepositoryException
- if an error occurspublic void orderBefore(Path.Element srcName, Path.Element dstName) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.ItemNotFoundException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
Node.orderBefore(String, String)
except that
this method takes a Path.Element
arguments instead of
String
s.srcName
- dstName
- javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.ItemNotFoundException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public NodeImpl replaceChildNode(NodeId id, Name nodeName, Name nodeTypeName, Name[] mixinNames) throws javax.jcr.ItemNotFoundException, javax.jcr.nodetype.NoSuchNodeTypeException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
id
by a new child node with the same id and specified nodeName
,
nodeTypeName
and mixinNames
.id
- id of the child node to be replacednodeName
- name of the new nodenodeTypeName
- name of the new node's node typemixinNames
- name of the new node's mixin typesjavax.jcr.ItemNotFoundException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public NodeImpl clone(NodeImpl src, Name name) throws javax.jcr.ItemExistsException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
src
- shareable source nodename
- name of new nodejavax.jcr.ItemExistsException
- if there already is a child node with the
name given and the definition does not allow creating another onejavax.jcr.version.VersionException
- if this node is not checked outjavax.jcr.nodetype.ConstraintViolationException
- if no definition is found in this
node that would allow creating the child nodejavax.jcr.lock.LockException
- if this node is lockedjavax.jcr.RepositoryException
- if some other error occurspublic boolean isNode()
public String getName() throws javax.jcr.RepositoryException
public void accept(javax.jcr.ItemVisitor visitor) throws javax.jcr.RepositoryException
public javax.jcr.Node getParent() throws javax.jcr.RepositoryException
public javax.jcr.Node addNode(String relPath) throws javax.jcr.RepositoryException
addNode
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Node addNode(String relPath, String nodeTypeName) throws javax.jcr.RepositoryException
addNode
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Node addNodeWithUuid(String relPath, String uuid) throws javax.jcr.RepositoryException
relPath
- path of the new nodeuuid
- UUID of the new node,
or null
for a random new UUIDjavax.jcr.RepositoryException
- if the node can not be addedNode.addNode(String)
public javax.jcr.Node addNodeWithUuid(String relPath, String nodeTypeName, String uuid) throws javax.jcr.RepositoryException
relPath
- path of the new nodenodeTypeName
- name of the new node's node type,
or null
for automatic type assignmentuuid
- UUID of the new node,
or null
for a random new UUIDjavax.jcr.RepositoryException
- if the node can not be addedNode.addNode(String, String)
public void orderBefore(String srcName, String destName) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.ItemNotFoundException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
orderBefore
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.ItemNotFoundException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, javax.jcr.Value[] values) throws javax.jcr.RepositoryException
setProperty(Name, Value[], int, boolean)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, javax.jcr.Value[] values, int type) throws javax.jcr.RepositoryException
setProperty(Name, Value[], int, boolean)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, String[] strings) throws javax.jcr.RepositoryException
setProperty(Name, Value[], int, boolean)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, String[] values, int type) throws javax.jcr.RepositoryException
setProperty(Name, Value[], int, boolean)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, String value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, String value, int type) throws javax.jcr.RepositoryException
setProperty(String, Value, int)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, javax.jcr.Value value, int type) throws javax.jcr.RepositoryException
SetPropertyOperation
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, javax.jcr.Value value) throws javax.jcr.RepositoryException
SetPropertyOperation
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, InputStream value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, boolean value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, double value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, long value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, Calendar value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, javax.jcr.Node value) throws javax.jcr.RepositoryException
setProperty(String, Value)
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
protected PropertyImpl setProperty(Name name, javax.jcr.Value[] values, int type, boolean enforceType) throws javax.jcr.RepositoryException
setProperty()
using a Value
array. The type of the returned property is enforced based on the
enforceType
flag. If set to true
, the returned
property is of the passed type if it didn't exist before. If set to
false
, then the returned property may be of some other type,
but still must be based on an existing property definition for the given
name and multi-valued flag. The resulting type is taken from that
definition and the implementation tries to convert the passed values to
that type. If that fails, then a ValueFormatException
is thrown.name
- the name of the property to set.values
- the values to set. If null
the property
is removed.type
- the target type of the values to set.enforceType
- if the target type is enforced.Property
object set, or null
if
this method was used to remove a property (by setting its value
to null
).javax.jcr.ValueFormatException
- if a value cannot be converted to
the specified type or if the
property already exists and is not
multi-valued.javax.jcr.version.VersionException
- if this node is read-only due to a
checked-in node and this implementation
performs this validation immediately.javax.jcr.lock.LockException
- if a lock prevents the setting of
the property and this implementation
performs this validation immediately.javax.jcr.nodetype.ConstraintViolationException
- if the change would violate a
node-type or other constraint and
this implementation performs this
validation immediately.javax.jcr.RepositoryException
- if another error occurs.public javax.jcr.Node getNode(String relPath) throws javax.jcr.RepositoryException
getNode
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.NodeIterator getNodes() throws javax.jcr.RepositoryException
getNodes
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getProperties() throws javax.jcr.RepositoryException
getProperties
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Property getProperty(String relPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
getProperty
in interface javax.jcr.Node
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
public boolean hasNode(String relPath) throws javax.jcr.RepositoryException
hasNode
in interface javax.jcr.Node
javax.jcr.RepositoryException
public boolean hasNodes() throws javax.jcr.RepositoryException
hasNodes
in interface javax.jcr.Node
javax.jcr.RepositoryException
public boolean hasProperties() throws javax.jcr.RepositoryException
hasProperties
in interface javax.jcr.Node
javax.jcr.RepositoryException
public boolean isNodeType(String nodeTypeName) throws javax.jcr.RepositoryException
isNodeType
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.nodetype.NodeType getPrimaryNodeType() throws javax.jcr.RepositoryException
getPrimaryNodeType
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.nodetype.NodeType[] getMixinNodeTypes() throws javax.jcr.RepositoryException
getMixinNodeTypes
in interface javax.jcr.Node
javax.jcr.RepositoryException
public void addMixin(String mixinName) throws javax.jcr.RepositoryException
addMixin(Name)
.addMixin
in interface javax.jcr.Node
javax.jcr.RepositoryException
public void removeMixin(String mixinName) throws javax.jcr.RepositoryException
removeMixin(Name)
.removeMixin
in interface javax.jcr.Node
javax.jcr.RepositoryException
public boolean canAddMixin(String mixinName) throws javax.jcr.nodetype.NoSuchNodeTypeException, javax.jcr.RepositoryException
canAddMixin
in interface javax.jcr.Node
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException
public boolean hasProperty(String relPath) throws javax.jcr.RepositoryException
hasProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getReferences() throws javax.jcr.RepositoryException
getReferences
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.nodetype.NodeDefinition getDefinition() throws javax.jcr.RepositoryException
getDefinition
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.NodeIterator getNodes(String namePattern) throws javax.jcr.RepositoryException
getNodes
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getProperties(String namePattern) throws javax.jcr.RepositoryException
getProperties
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.Item getPrimaryItem() throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
getPrimaryItem
in interface javax.jcr.Node
javax.jcr.ItemNotFoundException
javax.jcr.RepositoryException
public String getUUID() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
getUUID
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
public String getCorrespondingNodePath(String workspaceName) throws javax.jcr.ItemNotFoundException, javax.jcr.NoSuchWorkspaceException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
getCorrespondingNodePath
in interface javax.jcr.Node
javax.jcr.ItemNotFoundException
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public int getIndex() throws javax.jcr.RepositoryException
getIndex
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.NodeIterator getSharedSet() throws javax.jcr.RepositoryException
getSharedSet
in interface javax.jcr.Node
NodeIterator
javax.jcr.RepositoryException
- if an error occurs.public void removeSharedSet() throws javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
remove()
that removes this node and every
other node in the shared set of this node.
This removal must be done atomically, i.e., if one of the nodes cannot be
removed, the function throws the exception remove()
would
have thrown in that case, and none of the nodes are removed.
If this node is not shared this method removes only this node.
removeSharedSet
in interface javax.jcr.Node
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
removeShare()
,
Item.remove()
public void removeShare() throws javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
remove()
that removes this node, but does
not remove any other node in the shared set of this node.
All of the exceptions defined for remove()
apply to this
function. In addition, a RepositoryException
is thrown if
this node cannot be removed without removing another node in the shared
set of this node.
If this node is not shared this method removes only this node.
removeShare
in interface javax.jcr.Node
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
removeSharedSet()
,
Item.remove()
public NodeId getParentId()
public Path getPrimaryPath() throws javax.jcr.RepositoryException
Item
.
Overridden to return a different path for shareable nodes.
TODO SN: copies functionality in that is already available in
HierarchyManagerImpl, namely composing a path by
concatenating the parent path + this node's name and index:
rather use hierarchy manager to do thisgetPrimaryPath
in class ItemImpl
Item
javax.jcr.RepositoryException
public boolean isCheckedOut() throws javax.jcr.RepositoryException
isCheckedOut
in interface javax.jcr.Node
javax.jcr.RepositoryException
public void update(String srcWorkspaceName) throws javax.jcr.RepositoryException
update
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public javax.jcr.version.Version checkin() throws javax.jcr.RepositoryException
VersionManager.checkin(String)
insteadcheckin
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public javax.jcr.version.Version checkin(Calendar created) throws javax.jcr.RepositoryException
VersionManagerImpl.checkin(String, Calendar)
insteadjavax.jcr.RepositoryException
@Deprecated public void checkout() throws javax.jcr.RepositoryException
VersionManager.checkout(String)
insteadcheckout
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public javax.jcr.NodeIterator merge(String srcWorkspace, boolean bestEffort) throws javax.jcr.RepositoryException
VersionManager.merge(String, String, boolean)
insteadmerge
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public void cancelMerge(javax.jcr.version.Version version) throws javax.jcr.RepositoryException
VersionManager.cancelMerge(String, Version)
insteadcancelMerge
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public void doneMerge(javax.jcr.version.Version version) throws javax.jcr.RepositoryException
VersionManager.doneMerge(String, Version)
insteaddoneMerge
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public void restore(String versionName, boolean removeExisting) throws javax.jcr.RepositoryException
VersionManager.restore(String, String, boolean)
insteadrestore
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public void restore(javax.jcr.version.Version version, boolean removeExisting) throws javax.jcr.RepositoryException
VersionManager.restore(String, Version, boolean)
insteadrestore
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public void restore(javax.jcr.version.Version version, String relPath, boolean removeExisting) throws javax.jcr.RepositoryException
VersionManager.restore(String, Version, boolean)
insteadrestore
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public void restoreByLabel(String versionLabel, boolean removeExisting) throws javax.jcr.RepositoryException
VersionManager.restoreByLabel(String, String, boolean)
insteadrestoreByLabel
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public javax.jcr.version.VersionHistory getVersionHistory() throws javax.jcr.RepositoryException
VersionManager.getVersionHistory(String)
insteadgetVersionHistory
in interface javax.jcr.Node
javax.jcr.RepositoryException
@Deprecated public javax.jcr.version.Version getBaseVersion() throws javax.jcr.RepositoryException
VersionManager.getBaseVersion(String)
insteadgetBaseVersion
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.AccessDeniedException, javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
lock
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
public javax.jcr.lock.Lock getLock() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
getLock
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public void unlock() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.AccessDeniedException, javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
unlock
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
public boolean holdsLock() throws javax.jcr.RepositoryException
holdsLock
in interface javax.jcr.Node
javax.jcr.RepositoryException
public boolean isLocked() throws javax.jcr.RepositoryException
isLocked
in interface javax.jcr.Node
javax.jcr.RepositoryException
protected void checkLock() throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
javax.jcr.lock.LockException
- if this node is locked by somebody elsejavax.jcr.RepositoryException
- if some other error occurspublic String getIdentifier() throws javax.jcr.RepositoryException
getIdentifier
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getReferences(String name) throws javax.jcr.RepositoryException
getReferences
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getWeakReferences() throws javax.jcr.RepositoryException
getWeakReferences
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getWeakReferences(String name) throws javax.jcr.RepositoryException
getWeakReferences
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.NodeIterator getNodes(String[] nameGlobs) throws javax.jcr.RepositoryException
getNodes
in interface javax.jcr.Node
javax.jcr.RepositoryException
public javax.jcr.PropertyIterator getProperties(String[] nameGlobs) throws javax.jcr.RepositoryException
getProperties
in interface javax.jcr.Node
javax.jcr.RepositoryException
public void setPrimaryType(String nodeTypeName) throws javax.jcr.nodetype.NoSuchNodeTypeException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
setPrimaryType
in interface javax.jcr.Node
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, BigDecimal value) throws javax.jcr.ValueFormatException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
setProperty
in interface javax.jcr.Node
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
public javax.jcr.Property setProperty(String name, javax.jcr.Binary value) throws javax.jcr.ValueFormatException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
setProperty
in interface javax.jcr.Node
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
public String[] getAllowedLifecycleTransistions() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
The lifecycle policy node referenced by the "jcr:lifecyclePolicy" property is expected to contain a "transitions" node with a list of child nodes, one for each transition. These transition nodes must have single-valued string "from" and "to" properties that identify the allowed source and target states of each transition.
Note that future versions of Apache Jackrabbit may well use different lifecycle policy implementations.
getAllowedLifecycleTransistions
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
- if this node does not have the mix:lifecycle mixin node typejavax.jcr.RepositoryException
- if a repository error occurspublic void followLifecycleTransition(String transition) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.InvalidLifecycleTransitionException, javax.jcr.RepositoryException
followLifecycleTransition
in interface javax.jcr.Node
transition
- target lifecycle statejavax.jcr.UnsupportedRepositoryOperationException
- if this node does not have the mix:lifecycle mixin node typejavax.jcr.InvalidLifecycleTransitionException
- if the given target state is not among the allowed
transitions from the current lifecycle state of this nodejavax.jcr.RepositoryException
- if a repository error occursgetAllowedLifecycleTransistions()
public void assignLifecyclePolicy(javax.jcr.Node policy, String state) throws javax.jcr.RepositoryException
Note that currently no special checks are made against the given arguments, and that you will need to explicitly persist these changes by calling save().
Note that future versions of Apache Jackrabbit may well use different lifecycle policy implementations.
policy
- lifecycle policy nodestate
- current lifecycle statejavax.jcr.RepositoryException
- if a repository error occurspublic void rename(String newName) throws javax.jcr.RepositoryException
rename
in interface JackrabbitNode
javax.jcr.RepositoryException
public void setMixins(String[] mixinNames) throws javax.jcr.nodetype.NoSuchNodeTypeException, javax.jcr.version.VersionException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
setMixins
in interface JackrabbitNode
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.