@ThreadSafe public class SessionNode extends Object implements MutableCachedNode
session
when that node has (or may have) transient (unsaved) changes. This node is an
extension of a CachedNode
, and thus can be used as a regular cached node. All transient changes are captured as a delta
on top of the underlying workspace node
, and so any changes to the workspace node (made by other sessions'
save operations) are immediately reflected.Modifier and Type | Class and Description |
---|---|
protected static class |
SessionNode.ChangedAdditionalParents |
protected static class |
SessionNode.ChangedChildren
The representation of the changes made to the child references of this node.
|
protected class |
SessionNode.DeepClone |
protected class |
SessionNode.DeepCopy |
protected static class |
SessionNode.FederatedSegmentChanges |
protected static class |
SessionNode.InsertedChildReferences |
protected static class |
SessionNode.Insertions |
static class |
SessionNode.LockChange |
protected static class |
SessionNode.MixinChanges |
protected static class |
SessionNode.PermissionChanges |
protected static class |
SessionNode.ReferrerChanges |
CachedNode.Properties, CachedNode.ReferenceType
Constructor and Description |
---|
SessionNode(NodeKey key,
boolean isNew) |
Modifier and Type | Method and Description |
---|---|
void |
addFederatedSegment(String externalNodeKey,
String segmentName)
Adds a new federated segment with the given name and key to this node.
|
void |
addInternalProperty(String name,
Object value)
Adds an internal property to this cached node.
|
protected SessionNode.ChangedAdditionalParents |
additionalParents() |
void |
addMixin(SessionCache cache,
Name mixinName)
Add the supplied mixin type if not already an explicitly referenced.
|
protected void |
addOrRemoveReferrers(SessionCache cache,
SessionCache systemCache,
Property property,
Iterator<?> referenceValuesIterator,
boolean add) |
void |
addReferrer(SessionCache cache,
Property property,
NodeKey referrerKey,
CachedNode.ReferenceType type)
Adds to this node a reference with the given type from the node with the supplied key to this node.
|
protected MutableChildReferences |
appended(boolean createIfMissing) |
protected SessionNode.ChangedChildren |
changedChildren() |
protected ConcurrentMap<Name,Property> |
changedProperties() |
MutableCachedNode |
createChild(SessionCache cache,
NodeKey key,
Name name,
Iterable<Property> properties)
Create a new node as a child of this node with the supplied name and properties.
|
MutableCachedNode |
createChild(SessionCache cache,
NodeKey key,
Name name,
Property firstProperty,
Property... additionalProperties)
Create a new node as a child of this node with the supplied name and properties.
|
void |
deepClone(SessionCache cache,
CachedNode sourceNode,
SessionCache sourceCache,
String systemWorkspaceKey,
Connectors connectors)
Clones into this node all the properties and children (deep clone) from the given source node.
|
Map<NodeKey,NodeKey> |
deepCopy(SessionCache cache,
CachedNode sourceNode,
SessionCache sourceCache,
String systemWorkspaceKey,
Connectors connectors)
Copies into this node all the properties and children (deep copy) from the given source node.
|
boolean |
equals(Object obj) |
void |
excludeFromSearch()
Sets a flag indicating if this node and anything below it should be excluded from all searches and indexing operations.
|
protected Map<String,String> |
getAddedFederatedSegments() |
Map<String,Object> |
getAddedInternalProperties()
Returns a map of all the internal properties added for this node.
|
Set<Name> |
getAddedMixins(SessionCache cache)
Get the set of mixin names that were added to this node but not yet saved.
|
Set<NodeKey> |
getAdditionalParentKeys(NodeCache cache)
Get the keys for all of the nodes (other than the
primary parent ) under which this node
appears. |
Set<NodeKey> |
getChangedReferrerNodes()
Returns a set with all the referencing nodes (nodes which are referring this node) which have changed.
|
ChildReferences |
getChildReferences(NodeCache cache)
Get the set of child references for this node.
|
int |
getDepth(NodeCache cache)
Get the depth of this node.
|
String |
getEtag(SessionCache cache)
Compute an ETag value for this node.
|
NodeKey |
getKey()
Get the key for the node.
|
SessionNode.LockChange |
getLockChange() |
SessionNode.MixinChanges |
getMixinChanges() |
Set<Name> |
getMixinTypes(NodeCache cache)
Get the set of mixin types for this node.
|
Name |
getName(NodeCache cache)
Get the name for this node, without any same-name-sibiling (SNS) index.
|
org.modeshape.jcr.cache.document.SessionNode.NodeChanges |
getNodeChanges()
Returns an object encapsulating all the different changes that this session node contains.
|
NodeKey |
getParentKey(NodeCache cache)
Get the node key for this node's primary parent within this workspace.
|
NodeKey |
getParentKeyInAnyWorkspace(NodeCache cache)
Get the node key for this node's primary parent in any workspace.
|
Path |
getPath(NodeCache cache)
Get the path to this node.
|
Path |
getPath(PathCache pathCache)
Get the path to this node.
|
Map<String,Set<String>> |
getPermissions(NodeCache cache)
Gets the map of privileges by principal name which are in effect for this node.
|
Name |
getPrimaryType(NodeCache cache)
Get the primary type for this node.
|
Iterator<Property> |
getProperties(Collection<?> namePatterns,
NodeCache cache)
Get an iterator over all of the properties of this node that have names matching at least one of the supplied patterns.
|
Iterator<Property> |
getProperties(NodeCache cache)
Get an iterator over all of the node's properties.
|
CachedNode.Properties |
getPropertiesByName(NodeCache cache)
Get the properties collection.
|
Property |
getProperty(Name name,
NodeCache cache)
Get the property with the given name.
|
int |
getPropertyCount(NodeCache cache)
Determine the number of properties that this node contains.
|
protected SessionNode.ReferrerChanges |
getReferrerChanges() |
ReferrerCounts |
getReferrerCounts(NodeCache cache)
Get a snapshot of the referrers that have REFERENCE and/or WEAK_REFERENCE properties pointing to this node.
|
Set<NodeKey> |
getReferrers(NodeCache cache,
CachedNode.ReferenceType type)
Get the keys of the nodes that have JCR REFERENCE and/or WEAK_REFERENCE properties pointing to this node.
|
protected Set<String> |
getRemovedFederatedSegments() |
Set<String> |
getRemovedInternalProperties()
Returns a set of all the internal properties which have been removed from this node.
|
Path.Segment |
getSegment(NodeCache cache)
Get the path segment for this node.
|
protected Path.Segment |
getSegment(NodeCache cache,
CachedNode parent)
Get the segment for this node.
|
String |
getString(NamespaceRegistry registry) |
boolean |
hasACL(NodeCache cache)
Determine if there is an access control list for this node only, not taking into account any possible parents.
|
boolean |
hasChangedPrimaryType()
Return whether the primary type for the node has changed.
|
boolean |
hasChanges()
Return whether this node has changes, including property-related changes and other changes not related to properties.
|
int |
hashCode() |
boolean |
hasNonPropertyChanges()
Return whether this node has changes unrelated to properties.
|
boolean |
hasOnlyChangesToAdditionalParents()
Return whether this node contains only changes to the additional parents.
|
boolean |
hasProperties(NodeCache cache)
Determine if the node contains one or more properties.
|
boolean |
hasProperty(Name name,
NodeCache cache)
Determine if the node contains a property with the specified name.
|
boolean |
hasPropertyChanges()
Return whether this node has changes in the properties.
|
boolean |
isAtOrBelow(NodeCache cache,
Path path)
Determine if this node is effectively at or below the supplied path.
|
boolean |
isExcludedFromSearch(NodeCache cache)
Determine if this node and *all* of its children should be taken into account when searching/indexing or not.
|
boolean |
isExternal(NodeCache cache)
Determine if this node belongs to an external source (via federation) or is local to the repository.
|
boolean |
isNew()
Return whether this node was created since last saved.
|
boolean |
isPropertyModified(SessionCache cache,
Name propertyName)
Return whether the property with the supplied name was modified since the session was last saved.
|
boolean |
isPropertyNew(SessionCache cache,
Name propertyName)
Return whether the property with the supplied name was created since the session was last saved.
|
protected boolean |
isPropertyRemoved(Name name) |
boolean |
linkChild(SessionCache cache,
NodeKey childKey,
Name name)
Link the existing node with the supplied key to be appended as a child of this node.
|
void |
lock(boolean sessionScoped)
Lock this node.
|
protected SessionNode.MixinChanges |
mixinChanges(boolean createIfMissing) |
void |
moveChild(SessionCache cache,
NodeKey key,
MutableCachedNode newParent,
Name newName)
Remove the node from being a child of this node and append it as a child of the supplied node.
|
protected NodeKey |
newParent() |
protected CachedNode |
nodeInWorkspace(AbstractSessionCache session)
Get the CachedNode within the workspace cache.
|
protected CachedNode |
parent(AbstractSessionCache session) |
protected SessionNode.PermissionChanges |
permissionChanges() |
protected SessionNode.ReferrerChanges |
referrerChanges(boolean createIfMissing) |
MutableCachedNode.PermissionChanges |
removeACL(SessionCache cache)
Removes any potential existing ACL for this node.
|
void |
removeAllProperties(SessionCache cache)
Remove all of the properties from this node.
|
protected void |
removeAllReferences(SessionCache cache) |
void |
removeChild(SessionCache cache,
NodeKey key)
Remove the node from being a child of this node.
|
protected SessionNode |
removeChildFromNode(AbstractSessionCache session,
NodeKey childKey)
Remove the child from this parent node.
|
protected Set<Name> |
removedProperties() |
void |
removeFederatedSegment(String externalNodeKey)
Removes the federated segment towards an external node.
|
boolean |
removeInternalProperty(String name)
Removes an internal property from this cached node.
|
void |
removeMixin(SessionCache cache,
Name mixinName)
Remove the supplied mixin type if already an explicitly referenced.
|
void |
removeProperty(SessionCache cache,
Name name)
Remove the property with the given name.
|
void |
removeReferrer(SessionCache cache,
Property property,
NodeKey referrerKey,
CachedNode.ReferenceType type)
Remove from this node a reference with the given type from the node with the supplied key to this node.
|
void |
renameChild(SessionCache cache,
NodeKey key,
Name newName)
Renames the child node.
|
void |
reorderChild(SessionCache cache,
NodeKey key,
NodeKey nextNode)
Remove the node from being a child of this node and append it as a child before the supplied node.
|
protected void |
replaceParentWithAdditionalParent(NodeCache cache,
NodeKey oldParent,
NodeKey existingAdditionalParent) |
protected AbstractSessionCache |
session(NodeCache cache) |
SessionNode.PermissionChanges |
setPermissions(SessionCache cache,
Map<String,Set<String>> privilegesByPrincipalName)
Sets permissions for this node, creating in effect an ACL.
|
void |
setProperties(SessionCache cache,
Iterable<Property> properties)
Set the properties on this node.
|
void |
setProperties(SessionCache cache,
Iterator<Property> properties)
Set the properties on this node.
|
void |
setProperty(SessionCache cache,
Property property)
Set the property with the given name.
|
void |
setPropertyIfUnchanged(SessionCache cache,
Property property)
Set the given property only if it has not been set previously and therefore appear as changed.
|
void |
setReference(SessionCache cache,
Property property,
SessionCache systemCache)
Sets a property of type reference in the case when there's an active system cache and the property is a reference towards a
transient node from the system cache.
|
String |
toString() |
void |
unlock()
Unlock this node.
|
protected WorkspaceCache |
workspace(NodeCache cache) |
protected WritableSessionCache |
writableSession(NodeCache cache) |
public SessionNode(NodeKey key, boolean isNew)
protected final SessionNode.ChangedChildren changedChildren()
protected final ConcurrentMap<Name,Property> changedProperties()
protected final NodeKey newParent()
public final boolean isNew()
MutableCachedNode
isNew
in interface MutableCachedNode
public final boolean isPropertyNew(SessionCache cache, Name propertyName)
MutableCachedNode
true
if MutableCachedNode.isNew()
returns true
.isPropertyNew
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullpropertyName
- the name of the property; may not be nullMutableCachedNode.isPropertyModified(org.modeshape.jcr.cache.SessionCache, org.modeshape.jcr.value.Name)
,
MutableCachedNode.isNew()
public final boolean isPropertyModified(SessionCache cache, Name propertyName)
MutableCachedNode
isPropertyModified
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullpropertyName
- the name of the property; may not be nullMutableCachedNode.isPropertyNew(org.modeshape.jcr.cache.SessionCache, org.modeshape.jcr.value.Name)
public boolean hasChanges()
MutableCachedNode
hasNonPropertyChanges() || hasPropertyChanges()
.hasChanges
in interface MutableCachedNode
MutableCachedNode.hasNonPropertyChanges()
,
MutableCachedNode.hasPropertyChanges()
public boolean hasNonPropertyChanges()
MutableCachedNode
hasNonPropertyChanges
in interface MutableCachedNode
MutableCachedNode.hasChanges()
,
MutableCachedNode.hasPropertyChanges()
public boolean hasPropertyChanges()
MutableCachedNode
hasPropertyChanges
in interface MutableCachedNode
MutableCachedNode.hasChanges()
,
MutableCachedNode.hasNonPropertyChanges()
public void lock(boolean sessionScoped)
MutableCachedNode
lock
in interface MutableCachedNode
sessionScoped
- true if the lock should be limited in scope to the lifetime of the session, or false otherwisepublic void unlock()
MutableCachedNode
unlock
in interface MutableCachedNode
public SessionNode.LockChange getLockChange()
protected void replaceParentWithAdditionalParent(NodeCache cache, NodeKey oldParent, NodeKey existingAdditionalParent)
protected MutableChildReferences appended(boolean createIfMissing)
protected SessionNode.MixinChanges mixinChanges(boolean createIfMissing)
protected SessionNode.ReferrerChanges referrerChanges(boolean createIfMissing)
protected final WritableSessionCache writableSession(NodeCache cache)
protected final AbstractSessionCache session(NodeCache cache)
protected final WorkspaceCache workspace(NodeCache cache)
protected CachedNode nodeInWorkspace(AbstractSessionCache session)
session
- the session; may not be nullpublic NodeKey getParentKey(NodeCache cache)
CachedNode
getParentKey
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic NodeKey getParentKeyInAnyWorkspace(NodeCache cache)
CachedNode
getParentKeyInAnyWorkspace
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullprotected CachedNode parent(AbstractSessionCache session)
protected SessionNode.ChangedAdditionalParents additionalParents()
public Set<NodeKey> getAdditionalParentKeys(NodeCache cache)
CachedNode
primary parent
) under which this node
appears.getAdditionalParentKeys
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic boolean hasOnlyChangesToAdditionalParents()
MutableCachedNode
hasOnlyChangesToAdditionalParents
in interface MutableCachedNode
public boolean isAtOrBelow(NodeCache cache, Path path)
CachedNode
additional parents
, a node has multiple effective paths.isAtOrBelow
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpath
- the path to be used for comparison; may not be nullpublic NodeKey getKey()
CachedNode
getKey
in interface CachedNode
public Name getName(NodeCache cache)
CachedNode
getName
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullCachedNode.getSegment(NodeCache)
,
CachedNode.getPath(NodeCache)
public Path.Segment getSegment(NodeCache cache)
CachedNode
getSegment
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullCachedNode.getName(NodeCache)
,
CachedNode.getPath(NodeCache)
protected final Path.Segment getSegment(NodeCache cache, CachedNode parent)
cache
- the cacheparent
- the parent nodeNodeNotFoundInParentException
- if the node doesn't exist in the referenced parentpublic int getDepth(NodeCache cache) throws NodeNotFoundException
CachedNode
/foo
", 2 for "/foo/bar
", etc.), although this method will likely compute the depth more efficiently
that finding the path and asking for the number of segments.
The depth is calculated based upon the primary parent (and primary path
). This is, although
shared nodes are accessible at multiple paths, only the primary path is used to determine the depth of the node.
getDepth
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullNodeNotFoundException
- if this node no longer existspublic Path getPath(NodeCache cache)
CachedNode
getPath
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullCachedNode.getName(NodeCache)
,
CachedNode.getSegment(NodeCache)
public Path getPath(PathCache pathCache) throws NodeNotFoundException
CachedNode
getPath
in interface CachedNode
pathCache
- the cache of paths that can be used to compute the path for any node; may not be nullNodeNotFoundInParentException
- if this node no longer exists inside the parent node (and perhaps in no other parent)NodeNotFoundException
- if this node no longer existsCachedNode.getName(NodeCache)
,
CachedNode.getSegment(NodeCache)
public Name getPrimaryType(NodeCache cache)
CachedNode
getPrimaryType
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic boolean hasChangedPrimaryType()
MutableCachedNode
hasChangedPrimaryType
in interface MutableCachedNode
public Set<Name> getMixinTypes(NodeCache cache)
CachedNode
getMixinTypes
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic void addMixin(SessionCache cache, Name mixinName)
MutableCachedNode
addMixin
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullmixinName
- the name of the mixin to be removed; may not be nullpublic void removeMixin(SessionCache cache, Name mixinName)
MutableCachedNode
removeMixin
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullmixinName
- the name of the mixin to be removed; may not be nullpublic SessionNode.MixinChanges getMixinChanges()
public Set<Name> getAddedMixins(SessionCache cache)
MutableCachedNode
getAddedMixins
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullpublic Set<NodeKey> getReferrers(NodeCache cache, CachedNode.ReferenceType type)
CachedNode
getReferrers
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nulltype
- the flag specifying whether nodes with REFERENCE properties and/or WEAK reference properties should be included
in the result; may not be nullpublic ReferrerCounts getReferrerCounts(NodeCache cache)
CachedNode
getReferrerCounts
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullprotected SessionNode.ReferrerChanges getReferrerChanges()
public void addReferrer(SessionCache cache, Property property, NodeKey referrerKey, CachedNode.ReferenceType type)
MutableCachedNode
addReferrer
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperty
- the Property
of the referrer node; may not be nullreferrerKey
- the key for the node that has a new reference to this node; may not be nulltype
- the reference type; may not be nullpublic void removeReferrer(SessionCache cache, Property property, NodeKey referrerKey, CachedNode.ReferenceType type)
MutableCachedNode
removeReferrer
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperty
- the Property
of the referrer node; may not be nullreferrerKey
- the key for the node that no longer has a reference to this node; may not be nulltype
- the reference type; may not be nullpublic int getPropertyCount(NodeCache cache)
CachedNode
getPropertyCount
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic boolean hasProperties(NodeCache cache)
CachedNode
hasProperties
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic boolean hasProperty(Name name, NodeCache cache)
CachedNode
hasProperty
in interface CachedNode
name
- the name of the propertycache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic Property getProperty(Name name, NodeCache cache)
CachedNode
getProperty
in interface CachedNode
name
- the name of the propertycache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullprotected final boolean isPropertyRemoved(Name name)
public CachedNode.Properties getPropertiesByName(NodeCache cache)
CachedNode
getPropertiesByName
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic Iterator<Property> getProperties(NodeCache cache)
CachedNode
getProperties
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic Iterator<Property> getProperties(Collection<?> namePatterns, NodeCache cache)
CachedNode
getProperties
in interface CachedNode
namePatterns
- the regex patterns or string literals describing the namescache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic void setProperty(SessionCache cache, Property property)
MutableCachedNode
setProperty
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperty
- the property; may not be nullpublic void setReference(SessionCache cache, Property property, SessionCache systemCache)
MutableCachedNode
setReference
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperty
- the property; may not be nullsystemCache
- an existing system cache which contains transient nodes towards which the property points.protected void removeAllReferences(SessionCache cache)
protected void addOrRemoveReferrers(SessionCache cache, SessionCache systemCache, Property property, Iterator<?> referenceValuesIterator, boolean add)
public void setPropertyIfUnchanged(SessionCache cache, Property property)
MutableCachedNode
setPropertyIfUnchanged
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperty
- the property; may not be nullpublic void setProperties(SessionCache cache, Iterable<Property> properties)
MutableCachedNode
setProperties
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperties
- the properties to be set; may not be nullpublic void setProperties(SessionCache cache, Iterator<Property> properties)
MutableCachedNode
setProperties
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullproperties
- the iterator over the properties to be set; may not be nullpublic void removeProperty(SessionCache cache, Name name)
MutableCachedNode
removeProperty
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullname
- the name of the property to be removed; may not be nullpublic void removeAllProperties(SessionCache cache)
MutableCachedNode
removeAllProperties
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullpublic ChildReferences getChildReferences(NodeCache cache)
CachedNode
getChildReferences
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullpublic MutableCachedNode createChild(SessionCache cache, NodeKey key, Name name, Property firstProperty, Property... additionalProperties)
MutableCachedNode
createChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullkey
- the key for the new node; may be nullname
- the name for the new node; may not be nullfirstProperty
- the first property; may not be nulladditionalProperties
- the properties that should be set on the node; may be null or empty, and any null property
references will be ignoredpublic MutableCachedNode createChild(SessionCache cache, NodeKey key, Name name, Iterable<Property> properties)
MutableCachedNode
createChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullkey
- the key for the new node; may be nullname
- the name for the new node; may not be nullproperties
- the properties that should be set on the node; may be null or empty, and any null property references
will be ignoredpublic void removeChild(SessionCache cache, NodeKey key)
MutableCachedNode
removeChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullkey
- the key for the child that is to be removed; may not be nullpublic void moveChild(SessionCache cache, NodeKey key, MutableCachedNode newParent, Name newName)
MutableCachedNode
moveChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullkey
- the key for the child that is to be removed; may not be nullnewParent
- the new parent for the node; may not be null and may not be this nodenewName
- the new name for the node, or null if the existing name is to be usedprotected SessionNode removeChildFromNode(AbstractSessionCache session, NodeKey childKey)
session
- the sessionchildKey
- the child key; may not be nullpublic void reorderChild(SessionCache cache, NodeKey key, NodeKey nextNode)
MutableCachedNode
reorderChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullkey
- the key for the child that is to be removed; may not be nullnextNode
- the key for the node before which the node should be moved; may be null if the node should be moved to the
end of the parentspublic void renameChild(SessionCache cache, NodeKey key, Name newName)
MutableCachedNode
renameChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullkey
- the key for the child that is to be removed; may not be nullnewName
- the new name for the node; may not be nullpublic boolean linkChild(SessionCache cache, NodeKey childKey, Name name)
MutableCachedNode
The link can be removed by simply removing
the linked child from the parent,
and this works whether or not the parent is the original parent or an additional parent.
linkChild
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullchildKey
- the key for the child that is to be removed; may not be nullname
- the name for the (linked) node, or null if the existing name is to be usedpublic String getEtag(SessionCache cache)
MutableCachedNode
getEtag
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullpublic Map<NodeKey,NodeKey> deepCopy(SessionCache cache, CachedNode sourceNode, SessionCache sourceCache, String systemWorkspaceKey, Connectors connectors)
MutableCachedNode
deepCopy
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullsourceNode
- the node from which to copy the properties and children; may not be nullsourceCache
- the cache in which the source node belongs; may not be nullsystemWorkspaceKey
- the key of the system workspace; may not be nullconnectors
- a Connectors
instance which used for processing external nodes.public void deepClone(SessionCache cache, CachedNode sourceNode, SessionCache sourceCache, String systemWorkspaceKey, Connectors connectors)
MutableCachedNode
deepClone
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullsourceNode
- the node from which to copy the properties and children; may not be nullsourceCache
- the cache in which the source node belongs; may not be nullsystemWorkspaceKey
- the key of the system workspace; may not be nullconnectors
- a Connectors
instance which used for processing external nodes.public Set<NodeKey> getChangedReferrerNodes()
MutableCachedNode
getChangedReferrerNodes
in interface MutableCachedNode
NodeKey
instances, never null.public void addFederatedSegment(String externalNodeKey, String segmentName)
MutableCachedNode
addFederatedSegment
in interface MutableCachedNode
externalNodeKey
- the key of the external node which should be linked under this name; may not be nullsegmentName
- the name of the segment (i.e. the name of the alias under which an external child is linked); may not be
nullpublic void removeFederatedSegment(String externalNodeKey)
MutableCachedNode
removeFederatedSegment
in interface MutableCachedNode
externalNodeKey
- the key of the external node which should be linked under this name; may not be nullpublic org.modeshape.jcr.cache.document.SessionNode.NodeChanges getNodeChanges()
MutableCachedNode
getNodeChanges
in interface MutableCachedNode
non-null
MutableCachedNode.NodeChanges
object.public boolean isExcludedFromSearch(NodeCache cache)
CachedNode
isExcludedFromSearch
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nulltrue
if the node should be indexed, false
otherwisepublic void excludeFromSearch()
MutableCachedNode
excludeFromSearch
in interface MutableCachedNode
public boolean hasACL(NodeCache cache)
CachedNode
hasACL
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nulltrue
if this node has an ACL, false
otherwisepublic Map<String,Set<String>> getPermissions(NodeCache cache)
CachedNode
getPermissions
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nullMap
which contains a set of permission names keyed by principal name or null
if no privileges
are in effect for this node(i.e. this node does not have an ACL). An empty Map
means a node which has an ACL, but
does not have any permissions.public SessionNode.PermissionChanges setPermissions(SessionCache cache, Map<String,Set<String>> privilegesByPrincipalName)
MutableCachedNode
setPermissions
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullprivilegesByPrincipalName
- a set of privileges enqueued by principal name; may not be nullMutableCachedNode.PermissionChanges
instance which reflects how the persistent
state has been affected by the change; never nullprotected SessionNode.PermissionChanges permissionChanges()
public MutableCachedNode.PermissionChanges removeACL(SessionCache cache)
MutableCachedNode
removeACL
in interface MutableCachedNode
cache
- the cache to which this node belongs; may not be nullMutableCachedNode.PermissionChanges
instance which reflects which principal
have been removed; never nullpublic boolean isExternal(NodeCache cache)
CachedNode
isExternal
in interface CachedNode
cache
- the cache to which this node belongs, required in case this node needs to use the cache; may not be nulltrue
if the node is local, false
otherwise.public void addInternalProperty(String name, Object value)
MutableCachedNode
addInternalProperty
in interface MutableCachedNode
name
- a String
the name of the property; may not be null.value
- a String
the value of the property; may not be null.public Map<String,Object> getAddedInternalProperties()
MutableCachedNode
getAddedInternalProperties
in interface MutableCachedNode
Map
of (propertyName, propertyValue) pairs. never null
but possibly empty.public boolean removeInternalProperty(String name)
MutableCachedNode
removeInternalProperty
in interface MutableCachedNode
name
- a String
the name of the property; may not be null.true
if the property was removed, false
otherwise.public Set<String> getRemovedInternalProperties()
MutableCachedNode
getRemovedInternalProperties
in interface MutableCachedNode
Set
of property names; never null
but possibly empty.public String getString(NamespaceRegistry registry)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.