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
ANodeStateimplementation for theDocumentNodeStore.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDocumentNodeState.BundlingContextstatic classDocumentNodeState.ChildrenA list of children for a node.
-
Field Summary
Fields Modifier and Type Field Description static DocumentNodeState.ChildrenNO_CHILDREN
-
Constructor Summary
Constructors Modifier Constructor Description DocumentNodeState(@NotNull DocumentNodeStore store, @NotNull Path path, @NotNull RevisionVector rootRevision, @NotNull java.util.Map<java.lang.String,org.apache.jackrabbit.oak.api.PropertyState> properties, boolean hasChildren, int memory, @Nullable RevisionVector lastRevision, boolean fromExternalChange)protectedDocumentNodeState(@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.NodeBuilderbuilder()booleanexists()@NotNull DocumentNodeStatefromExternalChange()java.lang.Iterable<DocumentNodeState>getAllBundledNodesStates()java.util.Map<java.lang.String,java.lang.String>getAllBundledProperties()Returns all properties, including bundled, as Json serialized value.java.util.Set<java.lang.String>getBundledChildNodeNames()@NotNull org.apache.jackrabbit.oak.spi.state.NodeStategetChildNode(@NotNull java.lang.String name)longgetChildNodeCount(long max)@NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry>getChildNodeEntries()RevisionVectorgetLastRevision()intgetMemory()protected NodeStateDiffergetNodeStateDiffer()PathgetPath()@NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState>getProperties()org.apache.jackrabbit.oak.api.PropertyStategetProperty(@NotNull java.lang.String name)longgetPropertyCount()@NotNull RevisionVectorgetRootRevision()Returns the root revision for this node state.booleanhasChildNode(@NotNull java.lang.String name)booleanhasNoChildren()booleanhasOnlyBundledChildren()booleanhasProperty(@NotNull java.lang.String name)booleanisFromExternalChange()java.lang.StringtoString()DocumentNodeStatewithRootRevision(@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 java.util.Map<java.lang.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 thisDocumentNodeStatewith therootRevisionset to the givenrootrevision. This method returnsthisinstance if the givenrootrevision is the same as the one in this instance and thefromExternalChangeflags are equal.- Specified by:
withRootRevisionin classAbstractDocumentNodeState- Parameters:
root- the root revision for the copy of this node state.externalChange- if thefromExternalChangeflag 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
DocumentNodeStatewith thefromExternalChangeflag set totrue.
-
isFromExternalChange
public boolean isFromExternalChange()
- Specified by:
isFromExternalChangein classAbstractDocumentNodeState- Returns:
trueif this node state was created as a result of an external change;falseotherwise.
-
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:
getRootRevisionin classAbstractDocumentNodeState- Returns:
- the revision of the root node state.
-
getPath
public Path getPath()
- Specified by:
getPathin classAbstractDocumentNodeState
-
getLastRevision
public RevisionVector getLastRevision()
- Specified by:
getLastRevisionin classAbstractDocumentNodeState
-
exists
public boolean exists()
- Specified by:
existsin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getProperty
public org.apache.jackrabbit.oak.api.PropertyState getProperty(@NotNull @NotNull java.lang.String name)- Specified by:
getPropertyin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getPropertyin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
hasProperty
public boolean hasProperty(@NotNull @NotNull java.lang.String name)- Specified by:
hasPropertyin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
hasPropertyin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getProperties
@NotNull public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState> getProperties()
- Specified by:
getPropertiesin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
hasChildNode
public boolean hasChildNode(@NotNull @NotNull java.lang.String name)- Specified by:
hasChildNodein interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNode
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getChildNode(@NotNull @NotNull java.lang.String name)- Specified by:
getChildNodein interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNodeCount
public long getChildNodeCount(long max)
- Specified by:
getChildNodeCountin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getChildNodeCountin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getPropertyCount
public long getPropertyCount()
- Specified by:
getPropertyCountin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getPropertyCountin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getChildNodeEntries
@NotNull public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry> getChildNodeEntries()
- Specified by:
getChildNodeEntriesin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
builder
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder builder()
- Specified by:
builderin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getBundledChildNodeNames
public java.util.Set<java.lang.String> getBundledChildNodeNames()
-
hasOnlyBundledChildren
public boolean hasOnlyBundledChildren()
-
hasNoChildren
public boolean hasNoChildren()
- Specified by:
hasNoChildrenin classAbstractDocumentNodeState
-
getNodeStateDiffer
protected NodeStateDiffer getNodeStateDiffer()
- Specified by:
getNodeStateDifferin classAbstractDocumentNodeState
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getMemory
public int getMemory()
- Specified by:
getMemoryin interfaceorg.apache.jackrabbit.oak.cache.CacheValue
-
getAllBundledNodesStates
public java.lang.Iterable<DocumentNodeState> getAllBundledNodesStates()
-
getAllBundledProperties
public java.util.Map<java.lang.String,java.lang.String> getAllBundledProperties()
Returns all properties, including bundled, as Json serialized value.- Returns:
- all properties, including bundled.
-
-