ModeShape Distribution 3.0.0.Beta4

org.modeshape.jcr
Class JcrSystemNode

java.lang.Object
  extended by org.modeshape.jcr.JcrSystemNode
All Implemented Interfaces:
Item, Node

public class JcrSystemNode
extends Object


Nested Class Summary
protected static class AbstractJcrNode.ChildNodeResolver
           
 
Field Summary
protected  NodeKey key
           
protected  JcrSession session
           
protected static Pattern WILDCARD_PATTERN
           
 
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
 
Method Summary
 void accept(ItemVisitor visitor)
           
 void addMixin(String mixinName)
           
 org.modeshape.jcr.AbstractJcrNode addNode(String relPath)
           
 org.modeshape.jcr.AbstractJcrNode addNode(String relPath, String primaryNodeTypeName)
           
protected  void autoCreateChildren(Name primaryType, RepositoryNodeTypeManager.NodeTypes capabilities)
          Create in this node any auto-created child nodes.
protected  LinkedList<Property> autoCreatePropertiesFor(Name nodeName, int snsIndex, Name primaryType, PropertyFactory propertyFactory, RepositoryNodeTypeManager.NodeTypes capabilities)
          If there are any auto-created properties, create them and return them in a list.
 boolean canAddMixin(String mixinName)
           
 void cancelMerge(Version version)
           
protected  void checkForCheckedOut()
          Verifies that this node is either not versionable or that it is versionable but checked out.
protected  void checkForLock()
          Checks that this node is not already locked by another session.
 Version checkin()
           
protected  void checkNodeTypeCanBeModified()
          Check that this type of node can be modified
 void checkout()
           
protected  void checkSession()
          Check that the session is still valid and live.
protected  long childCount()
          Get the total number of children.
protected  long childCount(Name name)
          Get the number of children that have the supplied name.
protected  org.modeshape.jcr.AbstractJcrNode childNode(Name name, org.modeshape.jcr.AbstractJcrNode.Type expectedType)
          Get the JCR node for the named child.
protected  org.modeshape.jcr.AbstractJcrNode childNode(Path.Segment segment, org.modeshape.jcr.AbstractJcrNode.Type expectedType)
          Get the JCR node for the named child.
protected  boolean containsChangesWithExternalDependencies(AtomicReference<Set<NodeKey>> affectedNodeKeys)
          Determines whether this node, or any nodes below it, contain changes that depend on nodes that are outside of this node's hierarchy.
protected  Path correspondingNodePath(String workspaceName)
           
protected static List<?> createPatternsFor(String[] namePatterns)
           
 void doneMerge(Version version)
           
protected  void doRemove()
          Perform a real remove of this node.
 void followLifecycleTransition(String transition)
           
 String[] getAllowedLifecycleTransistions()
           
protected  PropertyIterator getAllReferences()
           
 Item getAncestor(int depth)
          
 org.modeshape.jcr.JcrVersionNode getBaseVersion()
           
 String getCorrespondingNodePath(String workspaceName)
           
 NodeDefinition getDefinition()
           
 int getDepth()
          
 String getIdentifier()
           
 int getIndex()
           
 Lock getLock()
           
protected  Lock getLockIfExists()
           
 NodeType[] getMixinNodeTypes()
           
 String getName()
           
 org.modeshape.jcr.AbstractJcrNode getNode(String relativePath)
           
 NodeIterator getNodes()
           
 NodeIterator getNodes(String namePattern)
           
 NodeIterator getNodes(String[] nameGlobs)
           
 org.modeshape.jcr.AbstractJcrNode getParent()
          
 String getPath()
           
 Item getPrimaryItem()
           
 org.modeshape.jcr.JcrNodeType getPrimaryNodeType()
           
 PropertyIterator getProperties()
           
 PropertyIterator getProperties(String namePattern)
           
 PropertyIterator getProperties(String[] nameGlobs)
           
 org.modeshape.jcr.AbstractJcrProperty getProperty(String relativePath)
           
 PropertyIterator getReferences()
           
 PropertyIterator getReferences(String propertyName)
           
 JcrSession getSession()
           
 NodeIterator getSharedSet()
           
 String getUUID()
          Deprecated. 
 org.modeshape.jcr.JcrVersionHistoryNode getVersionHistory()
           
 PropertyIterator getWeakReferences()
           
 PropertyIterator getWeakReferences(String propertyName)
           
 boolean hasNode(String relativePath)
           
 boolean hasNodes()
           
 boolean hasProperties()
           
 boolean hasProperty(String relPath)
           
 boolean holdsLock()
           
 boolean isCheckedOut()
           
protected  boolean isForeign()
          Checks if this node is foreign for its current owning session
protected  boolean isInTheSameProcessAs(String otherProcessId)
           
 boolean isLocked()
           
 boolean isModified()
           
 boolean isNew()
           
 boolean isNode()
           
 boolean isNodeType(Name nodeTypeName)
          Determine whether this node's primary type or any of the mixins are or extend the node type with the supplied name.
 boolean isNodeType(String nodeTypeName)
           
 boolean isSame(Item otherItem)
           
protected  boolean isSameRepository(Item otherItem)
           
protected  NodeKey key()
           
protected  String location()
          Obtain a string identifying this node, usually for error or logging purposes.
 Lock lock(boolean isDeep, boolean isSessionScoped)
           
 NodeIterator merge(String srcWorkspace, boolean bestEffort)
           
protected  MutableCachedNode mutable()
           
protected  MutableCachedNode mutableParent()
           
protected  Name name()
           
protected  CachedNode node()
          Get the cached node.
 void orderBefore(String srcChildRelPath, String destChildRelPath)
           
protected  NodeKey parentKey()
           
protected  PropertyIterator propertiesOnOtherNodesReferencingThis(String propertyName, int referenceType)
          Find the properties on other nodes that are REFERENCE or WEAKREFERENCE properties (as dictated by the referenceType parameter) to this node.
protected  NodeIterator referringNodes(CachedNode.ReferenceType referenceType)
          Obtain an iterator over the nodes that reference this node.
 void refresh(boolean keepChanges)
           
 void remove()
           According to Section 14.3 of the JCR 2.0 specification, an implementation may choose whether the Item.remove() method (and the Session.removeItem(String) method) behaves as a Node.removeShare() or Node.removeSharedSet().
 void removeMixin(String mixinName)
           
 void removeShare()
           
 void removeSharedSet()
           
 void restore(String versionName, boolean removeExisting)
           
 void restore(Version version, boolean removeExisting)
           
 void restore(Version version, String relPath, boolean removeExisting)
           
 void restoreByLabel(String versionLabel, boolean removeExisting)
           
 void save()
          Deprecated. 
protected  Path.Segment segment()
           
protected  SessionCache sessionCache()
           
 void setPrimaryType(String nodeTypeName)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, BigDecimal value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Binary value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, boolean value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Calendar value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, double value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, InputStream value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, long value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Node value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, String value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, String[] values)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, String[] values, int type)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, String value, int type)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Value value)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Value[] values)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Value[] values, int type)
           
 org.modeshape.jcr.AbstractJcrProperty setProperty(String name, Value value, int type)
           
 String toString()
           
 void unlock()
           
 void update(String srcWorkspace)
           
 
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
 

Field Detail

WILDCARD_PATTERN

protected static final Pattern WILDCARD_PATTERN

key

protected final NodeKey key

session

protected final JcrSession session
Method Detail

doRemove

protected void doRemove()
                 throws ConstraintViolationException,
                        RepositoryException
Perform a real remove of this node.

Throws:
ConstraintViolationException
VersionException
LockException
AccessDeniedException
RepositoryException

checkNodeTypeCanBeModified

protected void checkNodeTypeCanBeModified()
                                   throws RepositoryException
Check that this type of node can be modified

Throws:
RepositoryException

getIndex

public int getIndex()
             throws RepositoryException
Specified by:
getIndex in interface Node
Throws:
RepositoryException

getName

public String getName()
               throws RepositoryException
Throws:
RepositoryException

getParent

public org.modeshape.jcr.AbstractJcrNode getParent()
                                            throws ItemNotFoundException,
                                                   RepositoryException

Specified by:
getParent in interface Item
Throws:
ItemNotFoundException
RepositoryException
See Also:
Item.getParent()

getPath

public String getPath()
               throws RepositoryException
Throws:
RepositoryException

sessionCache

protected SessionCache sessionCache()

key

protected final NodeKey key()

node

protected final CachedNode node()
                         throws ItemNotFoundException,
                                InvalidItemStateException
Get the cached node.

Returns:
the cached node
Throws:
InvalidItemStateException - if the node has been removed in this session's transient state
ItemNotFoundException - if the node does not exist

mutable

protected final MutableCachedNode mutable()

parentKey

protected NodeKey parentKey()
                     throws RepositoryException
Throws:
RepositoryException

mutableParent

protected final MutableCachedNode mutableParent()
                                         throws RepositoryException
Throws:
RepositoryException

location

protected final String location()
Obtain a string identifying this node, usually for error or logging purposes. This method never throws an exception.

Returns:
the location string; never null

name

protected Name name()
             throws RepositoryException
Throws:
RepositoryException

segment

protected Path.Segment segment()
                        throws RepositoryException
Throws:
RepositoryException

isForeign

protected final boolean isForeign()
Checks if this node is foreign for its current owning session

Returns:
boolean if this node is considered "foreign" to this session, or false otherwise
See Also:
JcrSession.isForeignKey(org.modeshape.jcr.cache.NodeKey)

isInTheSameProcessAs

protected final boolean isInTheSameProcessAs(String otherProcessId)

getIdentifier

public final String getIdentifier()
Specified by:
getIdentifier in interface Node

getSession

public final JcrSession getSession()
Specified by:
getSession in interface Item

getProperty

public org.modeshape.jcr.AbstractJcrProperty getProperty(String relativePath)
                                                  throws PathNotFoundException,
                                                         RepositoryException
Specified by:
getProperty in interface Node
Throws:
PathNotFoundException
RepositoryException

checkForLock

protected final void checkForLock()
                           throws LockException,
                                  RepositoryException
Checks that this node is not already locked by another session. If the node is not locked or the node is locked but the lock is owned by this Session, this method completes silently. If the node is locked (either directly or as part of a deep lock from an ancestor), this method throws a LockException.

Throws:
LockException - if this node is locked (that is, if isLocked() == true && getLock().getLockToken() == null).
RepositoryException - if any other error occurs
See Also:
Node.isLocked(), Lock.getLockToken()

checkForCheckedOut

protected final void checkForCheckedOut()
                                 throws VersionException,
                                        RepositoryException
Verifies that this node is either not versionable or that it is versionable but checked out.

Throws:
VersionException - if the node is versionable but is checked in and cannot be modified
RepositoryException - if there is an error accessing the repository

childCount

protected final long childCount()
                         throws RepositoryException
Get the total number of children.

Returns:
the total number of children
Throws:
RepositoryException

childCount

protected final long childCount(Name name)
                         throws RepositoryException
Get the number of children that have the supplied name.

Parameters:
name - the child name
Returns:
the number of children with names that match the supplied name
Throws:
RepositoryException

childNode

protected final org.modeshape.jcr.AbstractJcrNode childNode(Name name,
                                                            org.modeshape.jcr.AbstractJcrNode.Type expectedType)
                                                     throws PathNotFoundException,
                                                            ItemNotFoundException,
                                                            InvalidItemStateException
Get the JCR node for the named child.

Parameters:
name - the child name; may not be null
expectedType - the expected implementation type for the node, or null if it is not known
Returns:
the JCR node; never null
Throws:
PathNotFoundException - if there is no child with the supplied name
ItemNotFoundException - if this node or the referenced child no longer exist or cannot be found
InvalidItemStateException - if this node has been removed in this session's transient state

childNode

protected final org.modeshape.jcr.AbstractJcrNode childNode(Path.Segment segment,
                                                            org.modeshape.jcr.AbstractJcrNode.Type expectedType)
                                                     throws PathNotFoundException,
                                                            ItemNotFoundException,
                                                            InvalidItemStateException
Get the JCR node for the named child.

Parameters:
segment - the child name and SNS index; may not be null
expectedType - the expected implementation type for the node, or null if it is not known
Returns:
the JCR node; never null
Throws:
PathNotFoundException - if there is no child with the supplied name
ItemNotFoundException - if this node or the referenced child cannot be found
InvalidItemStateException - if this node has been removed in this session's transient state

hasNode

public boolean hasNode(String relativePath)
                throws RepositoryException
Specified by:
hasNode in interface Node
Throws:
RepositoryException

getNode

public org.modeshape.jcr.AbstractJcrNode getNode(String relativePath)
                                          throws PathNotFoundException,
                                                 RepositoryException
Specified by:
getNode in interface Node
Throws:
PathNotFoundException
RepositoryException

getNodes

public NodeIterator getNodes()
                      throws RepositoryException
Specified by:
getNodes in interface Node
Throws:
RepositoryException

getNodes

public NodeIterator getNodes(String namePattern)
                      throws RepositoryException
Specified by:
getNodes in interface Node
Throws:
RepositoryException

getNodes

public NodeIterator getNodes(String[] nameGlobs)
                      throws RepositoryException
Specified by:
getNodes in interface Node
Throws:
RepositoryException

createPatternsFor

protected static List<?> createPatternsFor(String[] namePatterns)
                                    throws RepositoryException
Throws:
RepositoryException

addNode

public org.modeshape.jcr.AbstractJcrNode addNode(String relPath)
                                          throws ItemExistsException,
                                                 PathNotFoundException,
                                                 VersionException,
                                                 ConstraintViolationException,
                                                 LockException,
                                                 RepositoryException
Specified by:
addNode in interface Node
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException

addNode

public org.modeshape.jcr.AbstractJcrNode addNode(String relPath,
                                                 String primaryNodeTypeName)
                                          throws ItemExistsException,
                                                 PathNotFoundException,
                                                 NoSuchNodeTypeException,
                                                 LockException,
                                                 VersionException,
                                                 ConstraintViolationException,
                                                 RepositoryException
Specified by:
addNode in interface Node
Throws:
ItemExistsException
PathNotFoundException
NoSuchNodeTypeException
LockException
VersionException
ConstraintViolationException
RepositoryException

autoCreatePropertiesFor

protected LinkedList<Property> autoCreatePropertiesFor(Name nodeName,
                                                       int snsIndex,
                                                       Name primaryType,
                                                       PropertyFactory propertyFactory,
                                                       RepositoryNodeTypeManager.NodeTypes capabilities)
If there are any auto-created properties, create them and return them in a list.

Parameters:
nodeName - the name of the node; may not be null
snsIndex - the same-name-sibling index for this node
primaryType - the name of the primary type; may not be null
propertyFactory - the factory for properties; may not be null
capabilities - the node type capabilities cache; may not be null
Returns:
the list of auto-created properties, or null if there are none

autoCreateChildren

protected void autoCreateChildren(Name primaryType,
                                  RepositoryNodeTypeManager.NodeTypes capabilities)
                           throws ItemExistsException,
                                  PathNotFoundException,
                                  VersionException,
                                  ConstraintViolationException,
                                  LockException,
                                  RepositoryException
Create in this node any auto-created child nodes.

Parameters:
primaryType - the desired primary type for the new node; null value indicates that the default primary type from the appropriate definition for this node should be used
capabilities - the node type capabilities cache; may not be null
Throws:
ItemExistsException - if an item at the specified path already exists and same-name siblings are not allowed.
PathNotFoundException - if the specified path implies intermediary nodes that do not exist.
VersionException - not thrown at this time, but included for compatibility with the specification
ConstraintViolationException - if the change would violate a node type or implementation-specific constraint.
LockException - not thrown at this time, but included for compatibility with the specification
RepositoryException - if another error occurs

orderBefore

public void orderBefore(String srcChildRelPath,
                        String destChildRelPath)
                 throws UnsupportedRepositoryOperationException,
                        VersionException,
                        ConstraintViolationException,
                        ItemNotFoundException,
                        LockException,
                        RepositoryException
Specified by:
orderBefore in interface Node
Throws:
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Value value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Value value,
                                                         int type)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Value[] values)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Value[] values,
                                                         int type)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         String[] values)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         String[] values,
                                                         int type)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         String value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         String value,
                                                         int type)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         InputStream value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Binary value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         boolean value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         double value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         BigDecimal value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         long value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Calendar value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public org.modeshape.jcr.AbstractJcrProperty setProperty(String name,
                                                         Node value)
                                                  throws ValueFormatException,
                                                         VersionException,
                                                         LockException,
                                                         ConstraintViolationException,
                                                         RepositoryException
Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

getProperties

public PropertyIterator getProperties()
                               throws RepositoryException
Specified by:
getProperties in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties(String namePattern)
                               throws RepositoryException
Specified by:
getProperties in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties(String[] nameGlobs)
                               throws RepositoryException
Specified by:
getProperties in interface Node
Throws:
RepositoryException

getPrimaryItem

public Item getPrimaryItem()
                    throws ItemNotFoundException,
                           RepositoryException
Specified by:
getPrimaryItem in interface Node
Throws:
ItemNotFoundException
RepositoryException

getUUID

@Deprecated
public final String getUUID()
                     throws UnsupportedRepositoryOperationException,
                            RepositoryException
Deprecated. 

Specified by:
getUUID in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

getReferences

public final PropertyIterator getReferences()
                                     throws RepositoryException
Specified by:
getReferences in interface Node
Throws:
RepositoryException

getReferences

public final PropertyIterator getReferences(String propertyName)
                                     throws RepositoryException
Specified by:
getReferences in interface Node
Throws:
RepositoryException

getWeakReferences

public PropertyIterator getWeakReferences()
                                   throws RepositoryException
Specified by:
getWeakReferences in interface Node
Throws:
RepositoryException

getWeakReferences

public PropertyIterator getWeakReferences(String propertyName)
                                   throws RepositoryException
Specified by:
getWeakReferences in interface Node
Throws:
RepositoryException

getAllReferences

protected PropertyIterator getAllReferences()
                                     throws RepositoryException
Throws:
RepositoryException

propertiesOnOtherNodesReferencingThis

protected PropertyIterator propertiesOnOtherNodesReferencingThis(String propertyName,
                                                                 int referenceType)
                                                          throws RepositoryException
Find the properties on other nodes that are REFERENCE or WEAKREFERENCE properties (as dictated by the referenceType parameter) to this node.

Parameters:
propertyName - the name of the referring REFERENCE or WEAKREFERENCE properties on the other nodes, or null if all referring REFERENCE or WEAKREFERENCE properties should be returned
referenceType - either PropertyType.REFERENCE or PropertyType.WEAKREFERENCE
Returns:
the property iterator; never null by may be empty if there are no references or if this node is not referenceable
Throws:
RepositoryException - if there is an error finding the referencing properties

referringNodes

protected final NodeIterator referringNodes(CachedNode.ReferenceType referenceType)
                                     throws RepositoryException
Obtain an iterator over the nodes that reference this node.

Parameters:
referenceType - specification of the type of references to include; may not be null
Returns:
the iterator over the referencing nodes; never null
Throws:
RepositoryException - if an error occurs while obtaining the information

hasProperty

public boolean hasProperty(String relPath)
                    throws RepositoryException
Specified by:
hasProperty in interface Node
Throws:
RepositoryException

hasNodes

public boolean hasNodes()
                 throws RepositoryException
Specified by:
hasNodes in interface Node
Throws:
RepositoryException

hasProperties

public boolean hasProperties()
                      throws RepositoryException
Specified by:
hasProperties in interface Node
Throws:
RepositoryException

getPrimaryNodeType

public org.modeshape.jcr.JcrNodeType getPrimaryNodeType()
                                                 throws RepositoryException
Specified by:
getPrimaryNodeType in interface Node
Throws:
RepositoryException

getMixinNodeTypes

public NodeType[] getMixinNodeTypes()
                             throws RepositoryException
Specified by:
getMixinNodeTypes in interface Node
Throws:
RepositoryException

isNodeType

public boolean isNodeType(String nodeTypeName)
                   throws RepositoryException
Specified by:
isNodeType in interface Node
Throws:
RepositoryException

isNodeType

public final boolean isNodeType(Name nodeTypeName)
                         throws RepositoryException
Determine whether this node's primary type or any of the mixins are or extend the node type with the supplied name. This method is semantically equivalent to but slightly more efficient than the equivalent in the JCR API, especially when the node type name is already a Name object.

Parameters:
nodeTypeName - the name of the node type
Returns:
true if this node is of the node type given by the supplied name, or false otherwise
Throws:
RepositoryException - if there is an exception

setPrimaryType

public void setPrimaryType(String nodeTypeName)
                    throws NoSuchNodeTypeException,
                           VersionException,
                           ConstraintViolationException,
                           LockException,
                           RepositoryException
Specified by:
setPrimaryType in interface Node
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

addMixin

public void addMixin(String mixinName)
              throws NoSuchNodeTypeException,
                     VersionException,
                     ConstraintViolationException,
                     LockException,
                     RepositoryException
Specified by:
addMixin in interface Node
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

removeMixin

public void removeMixin(String mixinName)
                 throws NoSuchNodeTypeException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        RepositoryException
Specified by:
removeMixin in interface Node
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

canAddMixin

public boolean canAddMixin(String mixinName)
                    throws NoSuchNodeTypeException,
                           RepositoryException
Specified by:
canAddMixin in interface Node
Throws:
NoSuchNodeTypeException
RepositoryException

getDefinition

public NodeDefinition getDefinition()
                             throws RepositoryException
Specified by:
getDefinition in interface Node
Throws:
RepositoryException

checkin

public Version checkin()
                throws VersionException,
                       UnsupportedRepositoryOperationException,
                       InvalidItemStateException,
                       LockException,
                       RepositoryException
Specified by:
checkin in interface Node
Throws:
VersionException
UnsupportedRepositoryOperationException
InvalidItemStateException
LockException
RepositoryException

checkout

public void checkout()
              throws UnsupportedRepositoryOperationException,
                     LockException,
                     ActivityViolationException,
                     RepositoryException
Specified by:
checkout in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
ActivityViolationException
RepositoryException

doneMerge

public void doneMerge(Version version)
               throws VersionException,
                      InvalidItemStateException,
                      UnsupportedRepositoryOperationException,
                      RepositoryException
Specified by:
doneMerge in interface Node
Throws:
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException

cancelMerge

public void cancelMerge(Version version)
                 throws VersionException,
                        InvalidItemStateException,
                        UnsupportedRepositoryOperationException,
                        RepositoryException
Specified by:
cancelMerge in interface Node
Throws:
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException

update

public void update(String srcWorkspace)
            throws NoSuchWorkspaceException,
                   AccessDeniedException,
                   LockException,
                   InvalidItemStateException,
                   RepositoryException
Specified by:
update in interface Node
Throws:
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException

merge

public NodeIterator merge(String srcWorkspace,
                          boolean bestEffort)
                   throws NoSuchWorkspaceException,
                          AccessDeniedException,
                          MergeException,
                          LockException,
                          InvalidItemStateException,
                          RepositoryException
Specified by:
merge in interface Node
Throws:
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException

getCorrespondingNodePath

public String getCorrespondingNodePath(String workspaceName)
                                throws ItemNotFoundException,
                                       NoSuchWorkspaceException,
                                       AccessDeniedException,
                                       RepositoryException
Specified by:
getCorrespondingNodePath in interface Node
Throws:
ItemNotFoundException
NoSuchWorkspaceException
AccessDeniedException
RepositoryException

correspondingNodePath

protected final Path correspondingNodePath(String workspaceName)
                                    throws NoSuchWorkspaceException,
                                           ItemNotFoundException,
                                           RepositoryException
Throws:
NoSuchWorkspaceException
ItemNotFoundException
RepositoryException

getSharedSet

public NodeIterator getSharedSet()
                          throws RepositoryException
Specified by:
getSharedSet in interface Node
Throws:
RepositoryException

removeSharedSet

public void removeSharedSet()
                     throws VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException
Specified by:
removeSharedSet in interface Node
Throws:
VersionException
LockException
ConstraintViolationException
RepositoryException

removeShare

public void removeShare()
                 throws VersionException,
                        LockException,
                        ConstraintViolationException,
                        RepositoryException
Specified by:
removeShare in interface Node
Throws:
VersionException
LockException
ConstraintViolationException
RepositoryException

isCheckedOut

public boolean isCheckedOut()
                     throws RepositoryException
Specified by:
isCheckedOut in interface Node
Throws:
RepositoryException

restore

public void restore(String versionName,
                    boolean removeExisting)
             throws VersionException,
                    ItemExistsException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException
Specified by:
restore in interface Node
Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

restore

public void restore(Version version,
                    boolean removeExisting)
             throws VersionException,
                    ItemExistsException,
                    InvalidItemStateException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    RepositoryException
Specified by:
restore in interface Node
Throws:
VersionException
ItemExistsException
InvalidItemStateException
UnsupportedRepositoryOperationException
LockException
RepositoryException

restore

public void restore(Version version,
                    String relPath,
                    boolean removeExisting)
             throws PathNotFoundException,
                    ItemExistsException,
                    VersionException,
                    ConstraintViolationException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException
Specified by:
restore in interface Node
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 interface Node
Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

getVersionHistory

public org.modeshape.jcr.JcrVersionHistoryNode getVersionHistory()
                                                          throws UnsupportedRepositoryOperationException,
                                                                 RepositoryException
Specified by:
getVersionHistory in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

getBaseVersion

public org.modeshape.jcr.JcrVersionNode getBaseVersion()
                                                throws UnsupportedRepositoryOperationException,
                                                       RepositoryException
Specified by:
getBaseVersion in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

lock

public Lock lock(boolean isDeep,
                 boolean isSessionScoped)
          throws UnsupportedRepositoryOperationException,
                 LockException,
                 AccessDeniedException,
                 InvalidItemStateException,
                 RepositoryException
Specified by:
lock in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException

getLock

public final Lock getLock()
                   throws UnsupportedRepositoryOperationException,
                          LockException,
                          AccessDeniedException,
                          RepositoryException
Specified by:
getLock in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
RepositoryException

getLockIfExists

protected final Lock getLockIfExists()
                              throws UnsupportedRepositoryOperationException,
                                     AccessDeniedException,
                                     RepositoryException
Throws:
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException

unlock

public void unlock()
            throws UnsupportedRepositoryOperationException,
                   LockException,
                   AccessDeniedException,
                   InvalidItemStateException,
                   RepositoryException
Specified by:
unlock in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException

holdsLock

public boolean holdsLock()
Specified by:
holdsLock in interface Node

isLocked

public boolean isLocked()
                 throws RepositoryException
Specified by:
isLocked in interface Node
Throws:
RepositoryException

followLifecycleTransition

public void followLifecycleTransition(String transition)
                               throws UnsupportedRepositoryOperationException
Specified by:
followLifecycleTransition in interface Node
Throws:
UnsupportedRepositoryOperationException

getAllowedLifecycleTransistions

public String[] getAllowedLifecycleTransistions()
                                         throws UnsupportedRepositoryOperationException,
                                                RepositoryException
Specified by:
getAllowedLifecycleTransistions in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

isNode

public boolean isNode()
Specified by:
isNode in interface Item

isNew

public boolean isNew()
Specified by:
isNew in interface Item

isModified

public boolean isModified()
Specified by:
isModified in interface Item

isSame

public boolean isSame(Item otherItem)
               throws RepositoryException
Specified by:
isSame in interface Item
Throws:
RepositoryException

accept

public void accept(ItemVisitor visitor)
            throws RepositoryException
Specified by:
accept in interface Item
Throws:
RepositoryException

save

@Deprecated
public void save()
          throws AccessDeniedException,
                 ItemExistsException,
                 ConstraintViolationException,
                 InvalidItemStateException,
                 ReferentialIntegrityException,
                 VersionException,
                 LockException,
                 NoSuchNodeTypeException,
                 RepositoryException
Deprecated. 

Specified by:
save in interface Item
Throws:
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
ReferentialIntegrityException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException

refresh

public void refresh(boolean keepChanges)
             throws RepositoryException
Specified by:
refresh in interface Item
Throws:
RepositoryException

remove

public void remove()
            throws VersionException,
                   LockException,
                   ConstraintViolationException,
                   AccessDeniedException,
                   RepositoryException

According to Section 14.3 of the JCR 2.0 specification, an implementation may choose whether the Item.remove() method (and the Session.removeItem(String) method) behaves as a Node.removeShare() or Node.removeSharedSet(). Node.removeShare() just removes this node from the shared set, whereas Node.removeSharedSet() removes all nodes in the shared set, including the original shared node.

ModeShape implements Item.remove() of a shared node as simply removing this node from the shared set. In other words, this method is equivalent to calling removeShare().

Specified by:
remove in interface Item
Throws:
VersionException
LockException
ConstraintViolationException
AccessDeniedException
RepositoryException
See Also:
Item.remove()

toString

public String toString()
Overrides:
toString in class Object

containsChangesWithExternalDependencies

protected boolean containsChangesWithExternalDependencies(AtomicReference<Set<NodeKey>> affectedNodeKeys)
                                                   throws RepositoryException
Determines whether this node, or any nodes below it, contain changes that depend on nodes that are outside of this node's hierarchy.

Parameters:
affectedNodeKeys - the reference that should be assigned to the set of node keys that are at or below this node; may be null if not needed
Returns:
true if this node's hierarchy has nodes with changes dependent on nodes from outside the hierarchy
Throws:
InvalidItemStateException
ItemNotFoundException
RepositoryException

checkSession

protected final void checkSession()
                           throws RepositoryException
Check that the session is still valid and live.

Throws:
RepositoryException - if the session is not valid or live

getAncestor

public Item getAncestor(int depth)
                 throws RepositoryException

Specified by:
getAncestor in interface Item
Throws:
RepositoryException
See Also:
Item.getAncestor(int)

getDepth

public int getDepth()
             throws RepositoryException

Specified by:
getDepth in interface Item
Throws:
RepositoryException
See Also:
Item.getDepth()

isSameRepository

protected boolean isSameRepository(Item otherItem)
                            throws RepositoryException
Throws:
RepositoryException

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.