|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.ItemImpl
org.apache.jackrabbit.core.NodeImpl
public class NodeImpl
NodeImpl
implements the Node
interface.
Field Summary | |
---|---|
protected static short |
CREATED
|
Fields inherited from class org.apache.jackrabbit.core.ItemImpl |
---|
id, itemMgr, rep, session, stateMgr, STATUS_DESTROYED, STATUS_INVALIDATED, STATUS_MODIFIED, STATUS_NORMAL |
Fields inherited from interface javax.jcr.Node |
---|
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS |
Constructor Summary | |
---|---|
protected |
NodeImpl(ItemManager itemMgr,
SessionImpl session,
AbstractNodeData data)
Protected constructor. |
Method Summary | |
---|---|
void |
accept(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)
|
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. |
Node |
addNode(String relPath)
|
Node |
addNode(String relPath,
String nodeTypeName)
|
Node |
addNodeWithUuid(String relPath,
String uuid)
Adds a node with the given UUID. |
Node |
addNodeWithUuid(String relPath,
String nodeTypeName,
String uuid)
Adds a node with the given node type and UUID. |
void |
assignLifecyclePolicy(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(Version version)
Deprecated. |
Version |
checkin()
Deprecated. |
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(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. |
Version |
getBaseVersion()
Deprecated. |
String |
getCorrespondingNodePath(String workspaceName)
|
NodeDefinition |
getDefinition()
|
EffectiveNodeType |
getEffectiveNodeType()
Returns the effective (i.e. |
String |
getIdentifier()
|
int |
getIndex()
|
Lock |
getLock()
|
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 . |
Node |
getNode(String relPath)
|
NodeId |
getNodeId()
Returns the identifier of this Node . |
NodeIterator |
getNodes()
|
NodeIterator |
getNodes(String namePattern)
|
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()
|
Node |
getParent()
|
Item |
getPrimaryItem()
|
NodeType |
getPrimaryNodeType()
|
Path |
getPrimaryPath()
Returns the primary path to this Item . |
PropertyIterator |
getProperties()
|
PropertyIterator |
getProperties(String namePattern)
|
PropertyIterator |
getProperties(String[] nameGlobs)
|
PropertyImpl |
getProperty(Name name)
Returns the property of this node with the specified
name . |
Property |
getProperty(String relPath)
|
Name |
getQName()
Same as except that
this method returns a Name instead of a
String . |
PropertyIterator |
getReferences()
|
PropertyIterator |
getReferences(String name)
|
NodeIterator |
getSharedSet()
Returns an iterator over all nodes that are in the shared set of this node. |
String |
getUUID()
|
VersionHistory |
getVersionHistory()
Deprecated. |
PropertyIterator |
getWeakReferences()
|
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 Property |
internalSetProperty(Name name,
InternalValue value)
Sets the internal value of a property without checking any constraints. |
protected Property |
internalSetProperty(Name name,
InternalValue[] values)
Sets the internal value of a property without checking any constraints. |
protected Property |
internalSetProperty(Name name,
InternalValue[] values,
int type)
Sets the internal value of a property without checking any constraints. |
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)
|
Lock |
lock(boolean isDeep,
boolean isSessionScoped)
|
protected void |
makePersistent()
|
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(Name nodeName,
int index)
|
protected void |
removeChildProperty(Name propName)
|
protected void |
removeChildProperty(String propName)
|
void |
removeMixin(Name mixinName)
Same as Node.removeMixin(String) except that it takes a
Name instead of a String . |
void |
removeMixin(String mixinName)
|
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. |
protected void |
renameChildNode(Name oldName,
int index,
NodeId id,
Name newName)
|
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(Version version,
boolean removeExisting)
Deprecated. |
void |
restore(Version version,
String relPath,
boolean removeExisting)
Deprecated. |
void |
restoreByLabel(String versionLabel,
boolean removeExisting)
Deprecated. |
protected void |
restoreTransient(NodeState transientState)
|
void |
setPrimaryType(String nodeTypeName)
|
PropertyImpl |
setProperty(Name name,
Value value)
Same as except that
this method takes a Name name argument instead of a
String . |
PropertyImpl |
setProperty(Name name,
Value[] values)
Same as except that
this method takes a Name name argument instead of a
String . |
PropertyImpl |
setProperty(Name name,
Value[] values,
int type)
Same as except
that this method takes a Name name argument instead of a
String . |
protected PropertyImpl |
setProperty(Name name,
Value[] values,
int type,
boolean enforceType)
Implementation for setProperty() using a Value
array. |
protected PropertyImpl |
setProperty(Name name,
Value value,
boolean enforceType)
Implementation for setProperty() using a single Value . |
Property |
setProperty(String name,
BigDecimal value)
|
Property |
setProperty(String name,
Binary value)
|
Property |
setProperty(String name,
boolean value)
|
Property |
setProperty(String name,
Calendar value)
|
Property |
setProperty(String name,
double value)
|
Property |
setProperty(String name,
InputStream value)
|
Property |
setProperty(String name,
long value)
|
Property |
setProperty(String name,
Node value)
|
Property |
setProperty(String name,
String value)
|
Property |
setProperty(String name,
String[] values)
|
Property |
setProperty(String name,
String[] values,
int type)
|
Property |
setProperty(String name,
String value,
int type)
|
Property |
setProperty(String name,
Value value)
|
Property |
setProperty(String name,
Value[] values)
|
Property |
setProperty(String name,
Value[] values,
int type)
|
Property |
setProperty(String name,
Value value,
int type)
|
String |
toString()
Return a string representation of this node for diagnostic purposes. |
void |
unlock()
|
void |
update(String srcWorkspaceName)
|
Methods inherited from class org.apache.jackrabbit.core.ItemImpl |
---|
getAncestor, getDepth, getId, getPath, getSession, internalRemove, isModified, isNew, isSame, isTransactionalNew, isTransient, refresh, remove, safeGetJCRPath, sanityCheck, save, setRemoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.jcr.Item |
---|
getAncestor, getDepth, getPath, getSession, isModified, isNew, isSame, refresh, remove, save |
Field Detail |
---|
protected static final short CREATED
Constructor Detail |
---|
protected NodeImpl(ItemManager itemMgr, SessionImpl session, AbstractNodeData data)
itemMgr
- the ItemManager
that created this Node
instancesession
- the Session
through which this Node
is acquireddata
- the node dataMethod Detail |
---|
protected PropertyId resolveRelativePropertyPath(String relPath) throws RepositoryException
relPath
or null
if no property exists at relPath
.
Note that access rights are not checked.
relPath
- relative path of a (possible) property
relPath
or
null
if no property exists at relPath
RepositoryException
- if relPath
is not a valid
relative pathprotected NodeId resolveRelativeNodePath(String relPath) throws RepositoryException
relPath
or null
if no node exists at relPath
.
Note that access rights are not checked.
relPath
- relative path of a (possible) node
relPath
or
null
if no node exists at relPath
RepositoryException
- if relPath
is not a valid
relative pathprotected boolean hasPendingChanges() throws RepositoryException
true
if there are pending unsaved changes,
false
otherwise.
RepositoryException
- if an error occurredprotected ItemState getOrCreateTransientItemState() throws RepositoryException
getOrCreateTransientItemState
in class ItemImpl
RepositoryException
protected PropertyImpl getOrCreateProperty(String name, int type, boolean multiValued, boolean exactTypeMatch, BitSet status) throws ConstraintViolationException, RepositoryException
name
- type
- multiValued
- exactTypeMatch
- status
-
ConstraintViolationException
- if no applicable property definition
could be found
RepositoryException
- if another error occursprotected PropertyImpl getOrCreateProperty(Name name, int type, boolean multiValued, boolean exactTypeMatch, BitSet status) throws ConstraintViolationException, RepositoryException
name
- type
- multiValued
- exactTypeMatch
- status
-
ConstraintViolationException
- if no applicable property definition
could be found
RepositoryException
- if another error occursprotected PropertyImpl createChildProperty(Name name, int type, PropertyDefinitionImpl def) throws RepositoryException
type
hint and
property definition. If the given property definition is not of type
UNDEFINED
, then it takes precendence over the
type
hint.
name
- the name of the property to create.type
- the type hint.def
- the associated property definition.
RepositoryException
- if the property cannot be created.protected NodeImpl createChildNode(Name name, NodeTypeImpl nodeType, NodeId id) throws RepositoryException
RepositoryException
protected void renameChildNode(Name oldName, int index, NodeId id, Name newName) throws RepositoryException
RepositoryException
protected void removeChildProperty(String propName) throws RepositoryException
RepositoryException
protected void removeChildProperty(Name propName) throws RepositoryException
RepositoryException
protected void removeChildNode(Name nodeName, int index) throws RepositoryException
RepositoryException
protected void onRedefine(QNodeDefinition def) throws RepositoryException
RepositoryException
protected void onRemove(NodeId parentId) throws RepositoryException
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 RepositoryException
RepositoryException
- if an error occursprotected NodeDefinitionImpl getApplicableChildNodeDefinition(Name nodeName, Name nodeTypeName) throws ConstraintViolationException, RepositoryException
nodeName
- nodeTypeName
-
ConstraintViolationException
- if no applicable child node definition
could be found
RepositoryException
- if another error occursprotected PropertyDefinitionImpl getApplicablePropertyDefinition(Name propertyName, int type, boolean multiValued, boolean exactTypeMatch) throws ConstraintViolationException, RepositoryException
propertyName
- type
- multiValued
- exactTypeMatch
-
ConstraintViolationException
- if no applicable property definition
could be found
RepositoryException
- if another error occursprotected void makePersistent() throws InvalidItemStateException
makePersistent
in class ItemImpl
InvalidItemStateException
protected void restoreTransient(NodeState transientState) throws RepositoryException
RepositoryException
public void addMixin(Name mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
Node.addMixin(String)
except that it takes a
Name
instead of a String
.
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
Node.addMixin(String)
public void removeMixin(Name mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
Node.removeMixin(String)
except that it takes a
Name
instead of a String
.
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
Node.removeMixin(String)
public boolean isNodeType(Name ntName) throws RepositoryException
Node.isNodeType(String)
except that it takes a
Name
instead of a String
.
ntName
- name of node type
true
if this node is of the specified node type;
otherwise false
RepositoryException
protected void checkSetProperty() throws VersionException, LockException, RepositoryException
setProperty()
methods. The checks performed are:
Property.setValue()
methods.
VersionException
- if this node is not checked-out
LockException
- if this node is locked by somebody else
RepositoryException
- if another error occursNode.setProperty(java.lang.String, javax.jcr.Value)
protected Property internalSetProperty(Name name, InternalValue value) throws ValueFormatException, RepositoryException
name
- value
-
ValueFormatException
RepositoryException
protected Property internalSetProperty(Name name, InternalValue[] values) throws ValueFormatException, RepositoryException
name
- values
-
ValueFormatException
RepositoryException
protected Property internalSetProperty(Name name, InternalValue[] values, int type) throws ValueFormatException, RepositoryException
name
- values
- type
-
ValueFormatException
RepositoryException
public NodeImpl getNode(Name name) throws ItemNotFoundException, RepositoryException
this
node with the specified
name
.
name
- The name of the child node to retrieve.
name
.
ItemNotFoundException
- If no child node exists with the
specified name.
RepositoryException
- If another error occurs.public NodeImpl getNode(Name name, int index) throws ItemNotFoundException, 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
.
ItemNotFoundException
- If no child node exists with the
specified name.
RepositoryException
- If another error occurs.public boolean hasNode(Name name) throws 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.
RepositoryException
- If an unspecified error occurs.public boolean hasNode(Name name, int index) throws 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.
RepositoryException
- If an unspecified error occurs.public PropertyImpl getProperty(Name name) throws ItemNotFoundException, RepositoryException
this
node with the specified
name
.
name
- The name of the property to retrieve.
name
.
ItemNotFoundException
- If no property exists with the
specified name.
RepositoryException
- If another error occurs.public boolean hasProperty(Name name) throws 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.
RepositoryException
- If an unspecified error occurs.public NodeImpl addNode(Name nodeName, Name nodeTypeName, NodeId id) throws 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 assigned
RepositoryException
- if the node can not addedpublic PropertyImpl setProperty(Name name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
Node.setProperty(String, Value[])
except that
this method takes a Name
name argument instead of a
String
.
name
- values
-
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public PropertyImpl setProperty(Name name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
Node.setProperty(String, Value[], int)
except
that this method takes a Name
name argument instead of a
String
.
name
- values
- type
-
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public PropertyImpl setProperty(Name name, Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
Node.setProperty(String, Value)
except that
this method takes a Name
name argument instead of a
String
.
name
- value
-
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Name getQName() throws RepositoryException
ItemImpl
Item.getName()
except that
this method returns a Name
instead of a
String
.
getQName
in class ItemImpl
Name
RepositoryException
- if an error occurs.ItemImpl.getQName()
public NodeId getNodeId()
Node
.
Node
public void orderBefore(Path.Element srcName, Path.Element dstName) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException
Node.orderBefore(String, String)
except that
this method takes a Path.Element
arguments instead of
String
s.
srcName
- dstName
-
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
RepositoryException
public NodeImpl replaceChildNode(NodeId id, Name nodeName, Name nodeTypeName, Name[] mixinNames) throws ItemNotFoundException, NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, 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 types
ItemNotFoundException
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
public NodeImpl clone(NodeImpl src, Name name) throws ItemExistsException, VersionException, ConstraintViolationException, LockException, RepositoryException
src
- shareable source nodename
- name of new node
ItemExistsException
- if there already is a child node with the
name given and the definition does not allow creating another one
VersionException
- if this node is not checked out
ConstraintViolationException
- if no definition is found in this
node that would allow creating the child node
LockException
- if this node is locked
RepositoryException
- if some other error occurspublic boolean isNode()
isNode
in interface Item
isNode
in class ItemImpl
public String getName() throws RepositoryException
getName
in interface Item
getName
in class ItemImpl
RepositoryException
public void accept(ItemVisitor visitor) throws RepositoryException
accept
in interface Item
accept
in class ItemImpl
RepositoryException
public Node getParent() throws ItemNotFoundException, AccessDeniedException, RepositoryException
getParent
in interface Item
getParent
in class ItemImpl
ItemNotFoundException
AccessDeniedException
RepositoryException
public Node addNode(String relPath) throws RepositoryException
addNode
in interface Node
RepositoryException
public Node addNode(String relPath, String nodeTypeName) throws RepositoryException
addNode
in interface Node
RepositoryException
public Node addNodeWithUuid(String relPath, String uuid) throws RepositoryException
relPath
- path of the new nodeuuid
- UUID of the new node,
or null
for a random new UUID
RepositoryException
- if the node can not be addedNode.addNode(String)
public Node addNodeWithUuid(String relPath, String nodeTypeName, String uuid) throws 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 UUID
RepositoryException
- if the node can not be addedNode.addNode(String, String)
public void orderBefore(String srcName, String destName) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException
orderBefore
in interface Node
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
RepositoryException
public Property setProperty(String name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, String[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, String[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, String value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, String value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, InputStream value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, boolean value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, double value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, long value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, Calendar value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, Node value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
protected PropertyImpl setProperty(Name name, Value value, boolean enforceType) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty()
using a single Value
. 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 single-valued flag. The resulting type is taken from that
definition and the implementation tries to convert the passed value to
that type. If that fails, then a ValueFormatException
is thrown.
name
- the name of the property to set.value
- the value to set. If null
the property is
removed.enforceType
- if the type of value
is enforced.
Property
object set, or null
if
this method was used to remove a property (by setting its value
to null
).
ValueFormatException
- if value
cannot be
converted to the specified type or
if the property already exists and
is multi-valued.
VersionException
- if this node is read-only due to a
checked-in node and this implementation
performs this validation immediately.
LockException
- if a lock prevents the setting of
the property and this implementation
performs this validation immediately.
ConstraintViolationException
- if the change would violate a
node-type or other constraint and
this implementation performs this
validation immediately.
RepositoryException
- if another error occurs.protected PropertyImpl setProperty(Name name, Value[] values, int type, boolean enforceType) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, 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
).
ValueFormatException
- if a value cannot be converted to
the specified type or if the
property already exists and is not
multi-valued.
VersionException
- if this node is read-only due to a
checked-in node and this implementation
performs this validation immediately.
LockException
- if a lock prevents the setting of
the property and this implementation
performs this validation immediately.
ConstraintViolationException
- if the change would violate a
node-type or other constraint and
this implementation performs this
validation immediately.
RepositoryException
- if another error occurs.public Node getNode(String relPath) throws PathNotFoundException, RepositoryException
getNode
in interface Node
PathNotFoundException
RepositoryException
public NodeIterator getNodes() throws RepositoryException
getNodes
in interface Node
RepositoryException
public PropertyIterator getProperties() throws RepositoryException
getProperties
in interface Node
RepositoryException
public Property getProperty(String relPath) throws PathNotFoundException, RepositoryException
getProperty
in interface Node
PathNotFoundException
RepositoryException
public boolean hasNode(String relPath) throws RepositoryException
hasNode
in interface Node
RepositoryException
public boolean hasNodes() throws RepositoryException
hasNodes
in interface Node
RepositoryException
public boolean hasProperties() throws RepositoryException
hasProperties
in interface Node
RepositoryException
public boolean isNodeType(String nodeTypeName) throws RepositoryException
isNodeType
in interface Node
RepositoryException
public NodeType getPrimaryNodeType() throws RepositoryException
getPrimaryNodeType
in interface Node
RepositoryException
public NodeType[] getMixinNodeTypes() throws RepositoryException
getMixinNodeTypes
in interface Node
RepositoryException
public void addMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
addMixin
in interface Node
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
removeMixin
in interface Node
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
public boolean canAddMixin(String mixinName) throws NoSuchNodeTypeException, RepositoryException
canAddMixin
in interface Node
NoSuchNodeTypeException
RepositoryException
public boolean hasProperty(String relPath) throws RepositoryException
hasProperty
in interface Node
RepositoryException
public PropertyIterator getReferences() throws RepositoryException
getReferences
in interface Node
RepositoryException
public NodeDefinition getDefinition() throws RepositoryException
getDefinition
in interface Node
RepositoryException
public NodeIterator getNodes(String namePattern) throws RepositoryException
getNodes
in interface Node
RepositoryException
public PropertyIterator getProperties(String namePattern) throws RepositoryException
getProperties
in interface Node
RepositoryException
public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException
getPrimaryItem
in interface Node
ItemNotFoundException
RepositoryException
public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException
getUUID
in interface Node
UnsupportedRepositoryOperationException
RepositoryException
public String getCorrespondingNodePath(String workspaceName) throws ItemNotFoundException, NoSuchWorkspaceException, AccessDeniedException, RepositoryException
getCorrespondingNodePath
in interface Node
ItemNotFoundException
NoSuchWorkspaceException
AccessDeniedException
RepositoryException
public int getIndex() throws RepositoryException
getIndex
in interface Node
RepositoryException
public NodeIterator getSharedSet() throws RepositoryException
getSharedSet
in interface Node
NodeIterator
RepositoryException
- if an error occurs.public void removeSharedSet() throws VersionException, LockException, ConstraintViolationException, 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 Node
VersionException
LockException
ConstraintViolationException
RepositoryException
removeShare()
,
Item.remove()
public void removeShare() throws VersionException, LockException, ConstraintViolationException, 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 Node
VersionException
LockException
ConstraintViolationException
RepositoryException
removeSharedSet()
,
Item.remove()
public Path getPrimaryPath() throws 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 this
getPrimaryPath
in class ItemImpl
Item
RepositoryException
public boolean isCheckedOut() throws RepositoryException
isCheckedOut
in interface Node
RepositoryException
public void update(String srcWorkspaceName) throws RepositoryException
update
in interface Node
RepositoryException
@Deprecated public Version checkin() throws RepositoryException
VersionManager.checkin(String)
instead
checkin
in interface Node
RepositoryException
@Deprecated public Version checkin(Calendar created) throws RepositoryException
VersionManagerImpl.checkin(String, Calendar)
instead
RepositoryException
@Deprecated public void checkout() throws RepositoryException
VersionManager.checkout(String)
instead
checkout
in interface Node
RepositoryException
@Deprecated public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws RepositoryException
VersionManager.merge(String, String, boolean)
instead
merge
in interface Node
RepositoryException
@Deprecated public void cancelMerge(Version version) throws RepositoryException
VersionManager.cancelMerge(String, Version)
instead
cancelMerge
in interface Node
RepositoryException
@Deprecated public void doneMerge(Version version) throws RepositoryException
VersionManager.doneMerge(String, Version)
instead
doneMerge
in interface Node
RepositoryException
@Deprecated public void restore(String versionName, boolean removeExisting) throws RepositoryException
VersionManager.restore(String, String, boolean)
instead
restore
in interface Node
RepositoryException
@Deprecated public void restore(Version version, boolean removeExisting) throws RepositoryException
VersionManager.restore(String, Version, boolean)
instead
restore
in interface Node
RepositoryException
@Deprecated public void restore(Version version, String relPath, boolean removeExisting) throws RepositoryException
VersionManager.restore(String, Version, boolean)
instead
restore
in interface Node
RepositoryException
@Deprecated public void restoreByLabel(String versionLabel, boolean removeExisting) throws RepositoryException
VersionManager.restoreByLabel(String, String, boolean)
instead
restoreByLabel
in interface Node
RepositoryException
@Deprecated public VersionHistory getVersionHistory() throws RepositoryException
VersionManager.getVersionHistory(String)
instead
getVersionHistory
in interface Node
RepositoryException
@Deprecated public Version getBaseVersion() throws RepositoryException
VersionManager.getBaseVersion(String)
instead
getBaseVersion
in interface Node
RepositoryException
public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
lock
in interface Node
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException
public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
getLock
in interface Node
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
RepositoryException
public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
unlock
in interface Node
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException
public boolean holdsLock() throws RepositoryException
holdsLock
in interface Node
RepositoryException
public boolean isLocked() throws RepositoryException
isLocked
in interface Node
RepositoryException
protected void checkLock() throws LockException, RepositoryException
LockException
- if this node is locked by somebody else
RepositoryException
- if some other error occurspublic String getIdentifier() throws RepositoryException
getIdentifier
in interface Node
RepositoryException
public PropertyIterator getReferences(String name) throws RepositoryException
getReferences
in interface Node
RepositoryException
public PropertyIterator getWeakReferences() throws RepositoryException
getWeakReferences
in interface Node
RepositoryException
public PropertyIterator getWeakReferences(String name) throws RepositoryException
getWeakReferences
in interface Node
RepositoryException
public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
getNodes
in interface Node
RepositoryException
public PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
getProperties
in interface Node
RepositoryException
public void setPrimaryType(String nodeTypeName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
setPrimaryType
in interface Node
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
public Property setProperty(String name, BigDecimal value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public Property setProperty(String name, Binary value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
setProperty
in interface Node
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
public String[] getAllowedLifecycleTransistions() throws UnsupportedRepositoryOperationException, 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 Node
UnsupportedRepositoryOperationException
- if this node does not have the mix:lifecycle mixin node type
RepositoryException
- if a repository error occurspublic void followLifecycleTransition(String transition) throws UnsupportedRepositoryOperationException, InvalidLifecycleTransitionException, RepositoryException
followLifecycleTransition
in interface Node
transition
- target lifecycle state
UnsupportedRepositoryOperationException
- if this node does not have the mix:lifecycle mixin node type
InvalidLifecycleTransitionException
- if the given target state is not among the allowed
transitions from the current lifecycle state of this node
RepositoryException
- if a repository error occursgetAllowedLifecycleTransistions()
public void assignLifecyclePolicy(Node policy, String state) throws 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 state
RepositoryException
- if a repository error occurspublic String toString()
toString
in class ItemImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |