Class DocumentNodeState
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
- org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState
-
- org.apache.jackrabbit.oak.plugins.document.DocumentNodeState
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.cache.CacheValue
,org.apache.jackrabbit.oak.spi.state.NodeState
public class DocumentNodeState extends AbstractDocumentNodeState implements org.apache.jackrabbit.oak.cache.CacheValue
ANodeState
implementation for theDocumentNodeStore
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DocumentNodeState.BundlingContext
static class
DocumentNodeState.Children
A list of children for a node.
-
Field Summary
Fields Modifier and Type Field Description static DocumentNodeState.Children
NO_CHILDREN
-
Constructor Summary
Constructors Modifier Constructor Description DocumentNodeState(@NotNull DocumentNodeStore store, @NotNull Path path, @NotNull RevisionVector rootRevision, @NotNull Map<String,org.apache.jackrabbit.oak.api.PropertyState> properties, boolean hasChildren, int memory, @Nullable RevisionVector lastRevision, boolean fromExternalChange)
protected
DocumentNodeState(@NotNull DocumentNodeStore store, @NotNull Path path, @Nullable RevisionVector lastRevision, @NotNull RevisionVector rootRevision, boolean fromExternalChange, DocumentNodeState.BundlingContext bundlingContext, int memory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder
builder()
boolean
exists()
@NotNull DocumentNodeState
fromExternalChange()
Iterable<DocumentNodeState>
getAllBundledNodesStates()
Map<String,String>
getAllBundledProperties()
Returns all properties, including bundled, as Json serialized value.Set<String>
getBundledChildNodeNames()
@NotNull org.apache.jackrabbit.oak.spi.state.NodeState
getChildNode(@NotNull String name)
long
getChildNodeCount(long max)
@NotNull Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry>
getChildNodeEntries()
RevisionVector
getLastRevision()
int
getMemory()
protected NodeStateDiffer
getNodeStateDiffer()
Path
getPath()
@NotNull Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState>
getProperties()
org.apache.jackrabbit.oak.api.PropertyState
getProperty(@NotNull String name)
long
getPropertyCount()
@NotNull RevisionVector
getRootRevision()
Returns the root revision for this node state.boolean
hasChildNode(@NotNull String name)
boolean
hasNoChildren()
boolean
hasOnlyBundledChildren()
boolean
hasProperty(@NotNull String name)
boolean
isFromExternalChange()
String
toString()
DocumentNodeState
withRootRevision(@NotNull RevisionVector root, boolean externalChange)
-
Methods inherited from class org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState
compareAgainstBaseState, equals
-
Methods inherited from class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
checkValidName, compareAgainstBaseState, comparePropertiesAgainstBaseState, count, equals, getBoolean, getBoolean, getChildNodeNames, getLong, getLong, getName, getName, getNames, getNames, getString, getString, getStrings, getStrings, hashCode, isValidName, toString
-
-
-
-
Field Detail
-
NO_CHILDREN
public static final DocumentNodeState.Children NO_CHILDREN
-
-
Constructor Detail
-
DocumentNodeState
public DocumentNodeState(@NotNull @NotNull DocumentNodeStore store, @NotNull @NotNull Path path, @NotNull @NotNull RevisionVector rootRevision, @NotNull @NotNull Map<String,org.apache.jackrabbit.oak.api.PropertyState> properties, boolean hasChildren, int memory, @Nullable @Nullable RevisionVector lastRevision, boolean fromExternalChange)
-
DocumentNodeState
protected DocumentNodeState(@NotNull @NotNull DocumentNodeStore store, @NotNull @NotNull Path path, @Nullable @Nullable RevisionVector lastRevision, @NotNull @NotNull RevisionVector rootRevision, boolean fromExternalChange, DocumentNodeState.BundlingContext bundlingContext, int memory)
-
-
Method Detail
-
withRootRevision
public DocumentNodeState withRootRevision(@NotNull @NotNull RevisionVector root, boolean externalChange)
Creates a copy of thisDocumentNodeState
with therootRevision
set to the givenroot
revision. This method returnsthis
instance if the givenroot
revision is the same as the one in this instance and thefromExternalChange
flags are equal.- Specified by:
withRootRevision
in classAbstractDocumentNodeState
- Parameters:
root
- the root revision for the copy of this node state.externalChange
- if thefromExternalChange
flag must be set on the returned node state.- Returns:
- a copy of this node state with the given root revision and external change flag.
-
fromExternalChange
@NotNull public @NotNull DocumentNodeState fromExternalChange()
- Returns:
- a copy of this
DocumentNodeState
with thefromExternalChange
flag set totrue
.
-
isFromExternalChange
public boolean isFromExternalChange()
- Specified by:
isFromExternalChange
in classAbstractDocumentNodeState
- Returns:
true
if this node state was created as a result of an external change;false
otherwise.
-
getRootRevision
@NotNull public @NotNull RevisionVector getRootRevision()
Returns the root revision for this node state. This is the root revision passed from the parent node state. This revision therefore reflects the revision of the root node state where the traversal down the tree started.- Specified by:
getRootRevision
in classAbstractDocumentNodeState
- Returns:
- the revision of the root node state.
-
getPath
public Path getPath()
- Specified by:
getPath
in classAbstractDocumentNodeState
-
getLastRevision
public RevisionVector getLastRevision()
- Specified by:
getLastRevision
in classAbstractDocumentNodeState
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getProperty
public org.apache.jackrabbit.oak.api.PropertyState getProperty(@NotNull @NotNull String name)
- Specified by:
getProperty
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getProperty
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
hasProperty
public boolean hasProperty(@NotNull @NotNull String name)
- Specified by:
hasProperty
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
hasProperty
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getProperties
@NotNull public @NotNull Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState> getProperties()
- Specified by:
getProperties
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
hasChildNode
public boolean hasChildNode(@NotNull @NotNull String name)
- Specified by:
hasChildNode
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNode
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getChildNode(@NotNull @NotNull String name)
- Specified by:
getChildNode
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNodeCount
public long getChildNodeCount(long max)
- Specified by:
getChildNodeCount
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getChildNodeCount
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getPropertyCount
public long getPropertyCount()
- Specified by:
getPropertyCount
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getPropertyCount
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getChildNodeEntries
@NotNull public @NotNull Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry> getChildNodeEntries()
- Specified by:
getChildNodeEntries
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
builder
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder builder()
- Specified by:
builder
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
hasOnlyBundledChildren
public boolean hasOnlyBundledChildren()
-
hasNoChildren
public boolean hasNoChildren()
- Specified by:
hasNoChildren
in classAbstractDocumentNodeState
-
getNodeStateDiffer
protected NodeStateDiffer getNodeStateDiffer()
- Specified by:
getNodeStateDiffer
in classAbstractDocumentNodeState
-
toString
public String toString()
- Overrides:
toString
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getMemory
public int getMemory()
- Specified by:
getMemory
in interfaceorg.apache.jackrabbit.oak.cache.CacheValue
-
getAllBundledNodesStates
public Iterable<DocumentNodeState> getAllBundledNodesStates()
-
-