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 protectedNodeImpl(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:
getNamein interfaceItem- Specified by:
getNamein 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:
acceptin interfaceItem- Specified by:
acceptin classItemImpl- Parameters:
visitor-- Throws:
RepositoryException- See Also:
Item.accept(javax.jcr.ItemVisitor)
-
isNode
public boolean isNode()
Returns true- Specified by:
isNodein interfaceItem- Specified by:
isNodein classItemImpl- Returns:
- true
- See Also:
Item.isNode()
-
addNode
public Node addNode(String relPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
- Specified by:
addNodein interfaceNode- Throws:
ItemExistsExceptionPathNotFoundExceptionVersionExceptionConstraintViolationExceptionLockExceptionRepositoryException- See Also:
Node.addNode(String)
-
addNode
public Node addNode(String relPath, String primaryNodeTypeName) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException
- Specified by:
addNodein interfaceNode- Throws:
ItemExistsExceptionPathNotFoundExceptionNoSuchNodeTypeExceptionLockExceptionVersionExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.addNode(String, String)
-
orderBefore
public void orderBefore(String srcChildRelPath, String destChildRelPath) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException
- Specified by:
orderBeforein interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionVersionExceptionConstraintViolationExceptionItemNotFoundExceptionLockExceptionRepositoryException- See Also:
Node.orderBefore(String, String)
-
setProperty
public Property setProperty(String name, Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, Value)
-
setProperty
public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- 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:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, Value[])
-
setProperty
public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, Value[], int)
-
setProperty
public Property setProperty(String name, String[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, String[])
-
setProperty
public Property setProperty(String name, String[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, String[], int)
-
setProperty
public Property setProperty(String name, String value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, String)
-
setProperty
public Property setProperty(String name, String value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, String, int)
-
setProperty
public Property setProperty(String name, InputStream value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, InputStream)
-
setProperty
public Property setProperty(String name, Binary value) throws RepositoryException
- Specified by:
setPropertyin 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:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, boolean)
-
setProperty
public Property setProperty(String name, double value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, double)
-
setProperty
public Property setProperty(String name, BigDecimal value) throws RepositoryException
- Specified by:
setPropertyin 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:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, long)
-
setProperty
public Property setProperty(String name, Calendar value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, Calendar)
-
setProperty
public Property setProperty(String name, Node value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
ValueFormatExceptionVersionExceptionLockExceptionConstraintViolationExceptionRepositoryException- See Also:
Node.setProperty(String, Node)
-
getNode
public Node getNode(String relPath) throws PathNotFoundException, RepositoryException
- Specified by:
getNodein interfaceNode- Throws:
PathNotFoundExceptionRepositoryException- See Also:
Node.getNode(String)
-
getNodes
public NodeIterator getNodes() throws RepositoryException
- Specified by:
getNodesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getNodes()
-
getNodes
public NodeIterator getNodes(String namePattern) throws RepositoryException
- Specified by:
getNodesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getNodes(String)
-
getNodes
public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
- Specified by:
getNodesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getNodes(String[])
-
getProperty
public Property getProperty(String relPath) throws PathNotFoundException, RepositoryException
- Specified by:
getPropertyin interfaceNode- Throws:
PathNotFoundExceptionRepositoryException- See Also:
Node.getProperty(String)
-
getProperties
public PropertyIterator getProperties() throws RepositoryException
- Specified by:
getPropertiesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getProperties()
-
getProperties
public PropertyIterator getProperties(String namePattern) throws RepositoryException
- Specified by:
getPropertiesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getProperties(String)
-
getProperties
public PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
- Specified by:
getPropertiesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getProperties(String)
-
getPrimaryItem
public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException
- Specified by:
getPrimaryItemin interfaceNode- Throws:
ItemNotFoundExceptionRepositoryException- See Also:
Node.getPrimaryItem()
-
getUUID
public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getUUIDin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
Node.getUUID()
-
getIdentifier
public String getIdentifier() throws RepositoryException
- Specified by:
getIdentifierin interfaceNode- Throws:
RepositoryException- See Also:
Node.getIdentifier()
-
getIndex
public int getIndex() throws RepositoryException- Specified by:
getIndexin interfaceNode- Throws:
RepositoryException- See Also:
Node.getIndex()
-
getReferences
public PropertyIterator getReferences() throws RepositoryException
- Specified by:
getReferencesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getReferences()
-
getReferences
public PropertyIterator getReferences(String name) throws RepositoryException
- Specified by:
getReferencesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getReferences(String)
-
getWeakReferences
public PropertyIterator getWeakReferences() throws RepositoryException
- Specified by:
getWeakReferencesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getWeakReferences()
-
getWeakReferences
public PropertyIterator getWeakReferences(String name) throws RepositoryException
- Specified by:
getWeakReferencesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getWeakReferences()
-
hasNode
public boolean hasNode(String relPath) throws RepositoryException
- Specified by:
hasNodein interfaceNode- Throws:
RepositoryException- See Also:
Node.hasNode(String)
-
hasProperty
public boolean hasProperty(String relPath) throws RepositoryException
- Specified by:
hasPropertyin interfaceNode- Throws:
RepositoryException- See Also:
Node.hasProperty(String)
-
hasNodes
public boolean hasNodes() throws RepositoryException- Specified by:
hasNodesin interfaceNode- Throws:
RepositoryException- See Also:
Node.hasNodes()
-
hasProperties
public boolean hasProperties() throws RepositoryException- Specified by:
hasPropertiesin interfaceNode- Throws:
RepositoryException- See Also:
Node.hasProperties()
-
getPrimaryNodeType
public NodeType getPrimaryNodeType() throws RepositoryException
- Specified by:
getPrimaryNodeTypein interfaceNode- Throws:
RepositoryException- See Also:
Node.getPrimaryNodeType()
-
setPrimaryType
public void setPrimaryType(String nodeTypeName) throws RepositoryException
- Specified by:
setPrimaryTypein interfaceNode- Throws:
RepositoryException- See Also:
Node.setPrimaryType(String)
-
getMixinNodeTypes
public NodeType[] getMixinNodeTypes() throws RepositoryException
- Specified by:
getMixinNodeTypesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getMixinNodeTypes()
-
isNodeType
public boolean isNodeType(String nodeTypeName) throws RepositoryException
- Specified by:
isNodeTypein interfaceNode- Throws:
RepositoryException- See Also:
Node.isNodeType(String)
-
addMixin
public void addMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
- Specified by:
addMixinin interfaceNode- Throws:
NoSuchNodeTypeExceptionVersionExceptionConstraintViolationExceptionLockExceptionRepositoryException- See Also:
Node.addMixin(String)
-
removeMixin
public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException
- Specified by:
removeMixinin interfaceNode- Throws:
NoSuchNodeTypeExceptionVersionExceptionConstraintViolationExceptionLockExceptionRepositoryException- See Also:
Node.removeMixin(String)
-
canAddMixin
public boolean canAddMixin(String mixinName) throws RepositoryException
- Specified by:
canAddMixinin interfaceNode- Throws:
RepositoryException- See Also:
Node.canAddMixin(String)
-
getDefinition
public NodeDefinition getDefinition() throws RepositoryException
- Specified by:
getDefinitionin interfaceNode- Throws:
RepositoryException- See Also:
Node.getDefinition()
-
checkin
public Version checkin() throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException
- Specified by:
checkinin interfaceNode- Throws:
VersionExceptionUnsupportedRepositoryOperationExceptionInvalidItemStateExceptionLockExceptionRepositoryException- See Also:
Node.checkin()
-
checkout
public void checkout() throws UnsupportedRepositoryOperationException, LockException, RepositoryException- Specified by:
checkoutin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionLockExceptionRepositoryException- See Also:
Node.checkout()
-
doneMerge
public void doneMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
doneMergein interfaceNode- Throws:
VersionExceptionInvalidItemStateExceptionUnsupportedRepositoryOperationExceptionRepositoryException- See Also:
Node.doneMerge(Version)
-
cancelMerge
public void cancelMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
cancelMergein interfaceNode- Throws:
VersionExceptionInvalidItemStateExceptionUnsupportedRepositoryOperationExceptionRepositoryException- See Also:
Node.cancelMerge(Version)
-
update
public void update(String srcWorkspaceName) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
updatein interfaceNode- Throws:
NoSuchWorkspaceExceptionAccessDeniedExceptionLockExceptionInvalidItemStateExceptionRepositoryException- See Also:
Node.update(String)
-
merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, VersionException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
mergein interfaceNode- Throws:
NoSuchWorkspaceExceptionAccessDeniedExceptionVersionExceptionLockExceptionInvalidItemStateExceptionRepositoryException- 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:
getCorrespondingNodePathin interfaceNode- Throws:
ItemNotFoundExceptionNoSuchWorkspaceExceptionAccessDeniedExceptionRepositoryException- See Also:
Node.getCorrespondingNodePath(String)
-
isCheckedOut
public boolean isCheckedOut() throws RepositoryException- Specified by:
isCheckedOutin interfaceNode- Throws:
RepositoryException- See Also:
Node.isCheckedOut()
-
restore
public void restore(String versionName, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
- Specified by:
restorein interfaceNode- Throws:
VersionExceptionItemExistsExceptionUnsupportedRepositoryOperationExceptionLockExceptionInvalidItemStateExceptionRepositoryException- See Also:
Node.restore(String, boolean)
-
restore
public void restore(Version version, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, RepositoryException
- Specified by:
restorein interfaceNode- Throws:
VersionExceptionItemExistsExceptionUnsupportedRepositoryOperationExceptionLockExceptionRepositoryException- 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:
restoreByLabelin interfaceNode- Throws:
VersionExceptionItemExistsExceptionUnsupportedRepositoryOperationExceptionLockExceptionInvalidItemStateExceptionRepositoryException- See Also:
Node.restoreByLabel(String, boolean)
-
getVersionHistory
public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getVersionHistoryin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
Node.getVersionHistory()
-
getBaseVersion
public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getBaseVersionin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
Node.getBaseVersion()
-
lock
public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException
- Specified by:
lockin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionLockExceptionAccessDeniedExceptionInvalidItemStateExceptionRepositoryException- 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:
getLockin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionLockExceptionAccessDeniedExceptionRepositoryException- See Also:
Node.getLock()
-
unlock
public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException- Specified by:
unlockin interfaceNode- Throws:
UnsupportedRepositoryOperationExceptionLockExceptionAccessDeniedExceptionInvalidItemStateExceptionRepositoryException- See Also:
Node.unlock()
-
holdsLock
public boolean holdsLock() throws RepositoryException- Specified by:
holdsLockin interfaceNode- Throws:
RepositoryException- See Also:
Node.holdsLock()
-
isLocked
public boolean isLocked() throws RepositoryException- Specified by:
isLockedin interfaceNode- Throws:
RepositoryException- See Also:
Node.isLocked()
-
followLifecycleTransition
public void followLifecycleTransition(String transition) throws RepositoryException
- Specified by:
followLifecycleTransitionin interfaceNode- Throws:
RepositoryException- See Also:
Node.followLifecycleTransition(String)
-
getAllowedLifecycleTransistions
public String[] getAllowedLifecycleTransistions() throws RepositoryException
- Specified by:
getAllowedLifecycleTransistionsin interfaceNode- Throws:
RepositoryException- See Also:
Node.getAllowedLifecycleTransistions()
-
getSharedSet
public NodeIterator getSharedSet() throws RepositoryException
- Specified by:
getSharedSetin interfaceNode- Throws:
RepositoryException- See Also:
Node.getSharedSet()
-
removeShare
public void removeShare() throws RepositoryException- Specified by:
removeSharein interfaceNode- Throws:
RepositoryException- See Also:
Node.removeShare()
-
removeSharedSet
public void removeSharedSet() throws RepositoryException- Specified by:
removeSharedSetin interfaceNode- Throws:
RepositoryException- See Also:
Node.removeSharedSet()
-
getNode
protected Node getNode(Name nodeName, int index) throws PathNotFoundException, RepositoryException
- Parameters:
nodeName-index-- Returns:
- Throws:
PathNotFoundExceptionRepositoryException
-
getProperty
protected Property getProperty(Name qName) throws PathNotFoundException, RepositoryException
- Parameters:
qName-- Returns:
- Throws:
PathNotFoundExceptionRepositoryException
-
-