|
ModeShape Distribution 3.0.0.CR1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.jcr.cache.document.LazyCachedNode
@Immutable public class LazyCachedNode
This is an immutable CachedNode implementation that lazily loads its content. Technically each instance modifies its
internal state, but all the state is based upon a single Document that is read-in only once and never changed again. And thus
externally each instance appears to be immutable and invariant.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.modeshape.jcr.cache.CachedNode |
|---|
CachedNode.ReferenceType |
| Constructor Summary | |
|---|---|
LazyCachedNode(NodeKey key)
|
|
LazyCachedNode(NodeKey key,
Document document)
|
|
| Method Summary | |
|---|---|
protected Document |
document(WorkspaceCache cache)
Get the Document that represents this node. |
boolean |
equals(Object obj)
|
Set<NodeKey> |
getAdditionalParentKeys(NodeCache cache)
Get the keys for all of the nodes (other than the primary parent) under which this node
appears. |
ChildReferences |
getChildReferences(NodeCache cache)
Get the set of child references for this node. |
NodeKey |
getKey()
Get the key for the node. |
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. |
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. |
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. |
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. |
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. |
Path.Segment |
getSegment(NodeCache cache)
Get the path segment for this node. |
protected Path.Segment |
getSegment(WorkspaceCache cache)
Get the name for this node, without any same-name-sibiling (SNS) index. |
String |
getString(NamespaceRegistry registry)
|
int |
hashCode()
|
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 |
isAtOrBelow(NodeCache cache,
Path path)
Determine if this node is effectively at or below the supplied path. |
protected CachedNode |
parent(WorkspaceCache cache)
|
protected ChildReference |
parentReferenceToSelf(WorkspaceCache cache)
Get the parent node's child reference to this node. |
protected Map<Name,Property> |
properties()
|
String |
toString()
|
protected WorkspaceCache |
workspaceCache(NodeCache cache)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LazyCachedNode(NodeKey key)
public LazyCachedNode(NodeKey key,
Document document)
| Method Detail |
|---|
protected final WorkspaceCache workspaceCache(NodeCache cache)
protected Document document(WorkspaceCache cache)
Document that represents this node.
cache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
NodeNotFoundException - if this node no longer existspublic NodeKey getParentKey(NodeCache cache)
CachedNode
getParentKey in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public NodeKey getParentKeyInAnyWorkspace(NodeCache cache)
CachedNode
getParentKeyInAnyWorkspace in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public Set<NodeKey> getAdditionalParentKeys(NodeCache cache)
CachedNodeprimary parent) under which this node
appears.
getAdditionalParentKeys in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public boolean isAtOrBelow(NodeCache cache,
Path path)
CachedNodeadditional parents, a node has multiple effective paths.
isAtOrBelow in interface CachedNodecache - 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 null
protected CachedNode parent(WorkspaceCache cache)
protected ChildReference parentReferenceToSelf(WorkspaceCache cache)
cache - the cache
NodeNotFoundInParentException - if this node is no longer referenced by its parent as a child of the parent node
(which can happen if this node is used while in the midst of being (re)moved.protected Map<Name,Property> properties()
public NodeKey getKey()
CachedNode
getKey in interface CachedNodepublic Name getName(NodeCache cache)
CachedNode
getName in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
CachedNode.getSegment(NodeCache),
CachedNode.getPath(NodeCache)public Path.Segment getSegment(NodeCache cache)
CachedNode
getSegment in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
CachedNode.getName(NodeCache),
CachedNode.getPath(NodeCache)protected Path.Segment getSegment(WorkspaceCache cache)
cache - the workspace cache to which this node belongs, required in case this node needs to use the cache; may not be
null
NodeNotFoundInParentException - if this node no longer existsgetSegment(NodeCache),
getPath(NodeCache)public Path getPath(NodeCache cache)
CachedNode
getPath in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
CachedNode.getName(NodeCache),
CachedNode.getSegment(NodeCache)
public Path getPath(PathCache pathCache)
throws NodeNotFoundException
CachedNode
getPath in interface CachedNodepathCache - the cache of paths that can be used to compute the path for any node; may not be null
NodeNotFoundInParentException - 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 CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public Set<Name> getMixinTypes(NodeCache cache)
CachedNode
getMixinTypes in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public int getPropertyCount(NodeCache cache)
CachedNode
getPropertyCount in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public boolean hasProperties(NodeCache cache)
CachedNode
hasProperties in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public boolean hasProperty(Name name,
NodeCache cache)
CachedNode
hasProperty in interface CachedNodename - 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 null
public Property getProperty(Name name,
NodeCache cache)
CachedNode
getProperty in interface CachedNodename - 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 null
public Iterator<Property> getProperties(NodeCache cache)
CachedNode
getProperties in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public Iterator<Property> getProperties(Collection<?> namePatterns,
NodeCache cache)
CachedNode
getProperties in interface CachedNodenamePatterns - 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 null
public ChildReferences getChildReferences(NodeCache cache)
CachedNode
getChildReferences in interface CachedNodecache - the cache to which this node belongs, required in case this node needs to use the cache; may not be null
public Set<NodeKey> getReferrers(NodeCache cache,
CachedNode.ReferenceType type)
CachedNode
getReferrers in interface CachedNodecache - 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 null
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Objectpublic String getString(NamespaceRegistry registry)
|
ModeShape Distribution 3.0.0.CR1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||