Package org.apache.jackrabbit.jcr2spi
Class NodeImpl
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.ItemImpl
-
- org.apache.jackrabbit.jcr2spi.NodeImpl
-
- All Implemented Interfaces:
Item
,Node
,ItemStateLifeCycleListener
- Direct Known Subclasses:
VersionHistoryImpl
,VersionImpl
public class NodeImpl extends ItemImpl implements Node
NodeImpl
...
-
-
Field Summary
-
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
Constructors Modifier Constructor Description protected
NodeImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[] listeners)
-
Method Summary
-
Methods inherited from class org.apache.jackrabbit.jcr2spi.ItemImpl
checkIsWritable, checkStatus, getAncestor, getDepth, getItemManager, getItemState, getParent, getPath, getSession, isModified, isNew, isSame, isWritable, refresh, remove, save, statusChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getParent, getPath, getSession, isModified, isNew, isSame, refresh, remove, save
-
-
-
-
Constructor Detail
-
NodeImpl
protected NodeImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[] listeners)
-
-
Method Detail
-
getName
public String getName() throws RepositoryException
- Specified by:
getName
in interfaceItem
- Specified by:
getName
in classItemImpl
- Throws:
RepositoryException
- See Also:
Item.getName()
-
accept
public void accept(ItemVisitor visitor) throws RepositoryException
Implementation ofItem.accept(javax.jcr.ItemVisitor)
for nodes.- Specified by:
accept
in interfaceItem
- Specified by:
accept
in classItemImpl
- Parameters:
visitor
-- Throws:
RepositoryException
- See Also:
Item.accept(javax.jcr.ItemVisitor)
-
isNode
public boolean isNode()
Returns true- Specified by:
isNode
in interfaceItem
- Specified by:
isNode
in classItemImpl
- Returns:
- true
- See Also:
Item.isNode()
-
addNode
public Node addNode(String relPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
- Specified by:
addNode
in interfaceNode
- Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
- See Also:
Node.addNode(String)
-
addNode
public Node addNode(String relPath, String primaryNodeTypeName) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException
- Specified by:
addNode
in interfaceNode
- Throws:
ItemExistsException
PathNotFoundException
NoSuchNodeTypeException
LockException
VersionException
ConstraintViolationException
RepositoryException
- See Also:
Node.addNode(String, String)
-
orderBefore
public void orderBefore(String srcChildRelPath, String destChildRelPath) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException
- Specified by:
orderBefore
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
RepositoryException
- See Also:
Node.orderBefore(String, String)
-
setProperty
public Property setProperty(String name, Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, Value)
-
setProperty
public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, javax.jcr.Value, int)
-
setProperty
public Property setProperty(String name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, Value[])
-
setProperty
public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, Value[], int)
-
setProperty
public Property setProperty(String name, String[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, String[])
-
setProperty
public Property setProperty(String name, String[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, String[], int)
-
setProperty
public Property setProperty(String name, String value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, String)
-
setProperty
public Property setProperty(String name, String value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, String, int)
-
setProperty
public Property setProperty(String name, InputStream value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, InputStream)
-
setProperty
public Property setProperty(String name, Binary value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.setProperty(String, Binary)
-
setProperty
public Property setProperty(String name, boolean value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, boolean)
-
setProperty
public Property setProperty(String name, double value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, double)
-
setProperty
public Property setProperty(String name, BigDecimal value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.setProperty(String, BigDecimal)
-
setProperty
public Property setProperty(String name, long value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, long)
-
setProperty
public Property setProperty(String name, Calendar value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, Calendar)
-
setProperty
public Property setProperty(String name, Node value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
- See Also:
Node.setProperty(String, Node)
-
getNode
public Node getNode(String relPath) throws PathNotFoundException, RepositoryException
- Specified by:
getNode
in interfaceNode
- Throws:
PathNotFoundException
RepositoryException
- See Also:
Node.getNode(String)
-
getNodes
public NodeIterator getNodes() throws RepositoryException
- Specified by:
getNodes
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getNodes()
-
getNodes
public NodeIterator getNodes(String namePattern) throws RepositoryException
- Specified by:
getNodes
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getNodes(String)
-
getNodes
public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
- Specified by:
getNodes
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getNodes(String[])
-
getProperty
public Property getProperty(String relPath) throws PathNotFoundException, RepositoryException
- Specified by:
getProperty
in interfaceNode
- Throws:
PathNotFoundException
RepositoryException
- See Also:
Node.getProperty(String)
-
getProperties
public PropertyIterator getProperties() throws RepositoryException
- Specified by:
getProperties
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getProperties()
-
getProperties
public PropertyIterator getProperties(String namePattern) throws RepositoryException
- Specified by:
getProperties
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getProperties(String)
-
getProperties
public PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
- Specified by:
getProperties
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getProperties(String)
-
getPrimaryItem
public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException
- Specified by:
getPrimaryItem
in interfaceNode
- Throws:
ItemNotFoundException
RepositoryException
- See Also:
Node.getPrimaryItem()
-
getUUID
public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getUUID
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Node.getUUID()
-
getIdentifier
public String getIdentifier() throws RepositoryException
- Specified by:
getIdentifier
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getIdentifier()
-
getIndex
public int getIndex() throws RepositoryException
- Specified by:
getIndex
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getIndex()
-
getReferences
public PropertyIterator getReferences() throws RepositoryException
- Specified by:
getReferences
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getReferences()
-
getReferences
public PropertyIterator getReferences(String name) throws RepositoryException
- Specified by:
getReferences
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getReferences(String)
-
getWeakReferences
public PropertyIterator getWeakReferences() throws RepositoryException
- Specified by:
getWeakReferences
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getWeakReferences()
-
getWeakReferences
public PropertyIterator getWeakReferences(String name) throws RepositoryException
- Specified by:
getWeakReferences
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getWeakReferences()
-
hasNode
public boolean hasNode(String relPath) throws RepositoryException
- Specified by:
hasNode
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.hasNode(String)
-
hasProperty
public boolean hasProperty(String relPath) throws RepositoryException
- Specified by:
hasProperty
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.hasProperty(String)
-
hasNodes
public boolean hasNodes() throws RepositoryException
- Specified by:
hasNodes
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.hasNodes()
-
hasProperties
public boolean hasProperties() throws RepositoryException
- Specified by:
hasProperties
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.hasProperties()
-
getPrimaryNodeType
public NodeType getPrimaryNodeType() throws RepositoryException
- Specified by:
getPrimaryNodeType
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getPrimaryNodeType()
-
setPrimaryType
public void setPrimaryType(String nodeTypeName) throws RepositoryException
- Specified by:
setPrimaryType
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.setPrimaryType(String)
-
getMixinNodeTypes
public NodeType[] getMixinNodeTypes() throws RepositoryException
- Specified by:
getMixinNodeTypes
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getMixinNodeTypes()
-
isNodeType
public boolean isNodeType(String nodeTypeName) throws RepositoryException
- Specified by:
isNodeType
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.isNodeType(String)
-
addMixin
public void addMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
- Specified by:
addMixin
in interfaceNode
- Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
- See Also:
Node.addMixin(String)
-
removeMixin
public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
- Specified by:
removeMixin
in interfaceNode
- Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
- See Also:
Node.removeMixin(String)
-
canAddMixin
public boolean canAddMixin(String mixinName) throws RepositoryException
- Specified by:
canAddMixin
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.canAddMixin(String)
-
getDefinition
public NodeDefinition getDefinition() throws RepositoryException
- Specified by:
getDefinition
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getDefinition()
-
checkin
public Version checkin() throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException
- Specified by:
checkin
in interfaceNode
- Throws:
VersionException
UnsupportedRepositoryOperationException
InvalidItemStateException
LockException
RepositoryException
- See Also:
Node.checkin()
-
checkout
public void checkout() throws UnsupportedRepositoryOperationException, LockException, RepositoryException
- Specified by:
checkout
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
LockException
RepositoryException
- See Also:
Node.checkout()
-
doneMerge
public void doneMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
doneMerge
in interfaceNode
- Throws:
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Node.doneMerge(Version)
-
cancelMerge
public void cancelMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
cancelMerge
in interfaceNode
- Throws:
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Node.cancelMerge(Version)
-
update
public void update(String srcWorkspaceName) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
update
in interfaceNode
- Throws:
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.update(String)
-
merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, VersionException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
merge
in interfaceNode
- Throws:
NoSuchWorkspaceException
AccessDeniedException
VersionException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.merge(String, boolean)
-
merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort, boolean isShallow) throws RepositoryException
TODO: Issue 728 of the pfd... this method is a leftover and will be removed in the final version. -> change to package protected then- Throws:
RepositoryException
-
getCorrespondingNodePath
public String getCorrespondingNodePath(String workspaceName) throws ItemNotFoundException, NoSuchWorkspaceException, AccessDeniedException, RepositoryException
- Specified by:
getCorrespondingNodePath
in interfaceNode
- Throws:
ItemNotFoundException
NoSuchWorkspaceException
AccessDeniedException
RepositoryException
- See Also:
Node.getCorrespondingNodePath(String)
-
isCheckedOut
public boolean isCheckedOut() throws RepositoryException
- Specified by:
isCheckedOut
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.isCheckedOut()
-
restore
public void restore(String versionName, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
restore
in interfaceNode
- Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.restore(String, boolean)
-
restore
public void restore(Version version, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, RepositoryException
- Specified by:
restore
in interfaceNode
- Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
RepositoryException
- See Also:
Node.restore(Version, boolean)
-
restore
public void restore(Version version, String relPath, boolean removeExisting) throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
-
restoreByLabel
public void restoreByLabel(String versionLabel, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
restoreByLabel
in interfaceNode
- Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.restoreByLabel(String, boolean)
-
getVersionHistory
public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getVersionHistory
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Node.getVersionHistory()
-
getBaseVersion
public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getBaseVersion
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Node.getBaseVersion()
-
lock
public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
- Specified by:
lock
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException
- See Also:
Node.lock(boolean, boolean)
-
lock
public Lock lock(boolean isDeep, boolean isSessionScoped, long timeoutHint, String ownerHint) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
-
getLock
public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
- Specified by:
getLock
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
RepositoryException
- See Also:
Node.getLock()
-
unlock
public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
- Specified by:
unlock
in interfaceNode
- Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException
- See Also:
Node.unlock()
-
holdsLock
public boolean holdsLock() throws RepositoryException
- Specified by:
holdsLock
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.holdsLock()
-
isLocked
public boolean isLocked() throws RepositoryException
- Specified by:
isLocked
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.isLocked()
-
followLifecycleTransition
public void followLifecycleTransition(String transition) throws RepositoryException
- Specified by:
followLifecycleTransition
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.followLifecycleTransition(String)
-
getAllowedLifecycleTransistions
public String[] getAllowedLifecycleTransistions() throws RepositoryException
- Specified by:
getAllowedLifecycleTransistions
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getAllowedLifecycleTransistions()
-
getSharedSet
public NodeIterator getSharedSet() throws RepositoryException
- Specified by:
getSharedSet
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getSharedSet()
-
removeShare
public void removeShare() throws RepositoryException
- Specified by:
removeShare
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.removeShare()
-
removeSharedSet
public void removeSharedSet() throws RepositoryException
- Specified by:
removeSharedSet
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.removeSharedSet()
-
getNode
protected Node getNode(Name nodeName, int index) throws PathNotFoundException, RepositoryException
- Parameters:
nodeName
-index
-- Returns:
- Throws:
PathNotFoundException
RepositoryException
-
getProperty
protected Property getProperty(Name qName) throws PathNotFoundException, RepositoryException
- Parameters:
qName
-- Returns:
- Throws:
PathNotFoundException
RepositoryException
-
-