Class 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
    A NodeState implementation for the DocumentNodeStore.
    • 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)
    • Method Detail

      • withRootRevision

        public DocumentNodeState withRootRevision​(@NotNull
                                                  @NotNull RevisionVector root,
                                                  boolean externalChange)
        Creates a copy of this DocumentNodeState with the rootRevision set to the given root revision. This method returns this instance if the given root revision is the same as the one in this instance and the fromExternalChange flags are equal.
        Specified by:
        withRootRevision in class AbstractDocumentNodeState
        Parameters:
        root - the root revision for the copy of this node state.
        externalChange - if the fromExternalChange 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.
      • isFromExternalChange

        public boolean isFromExternalChange()
        Specified by:
        isFromExternalChange in class AbstractDocumentNodeState
        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 class AbstractDocumentNodeState
        Returns:
        the revision of the root node state.
      • exists

        public boolean exists()
        Specified by:
        exists in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getProperty

        public org.apache.jackrabbit.oak.api.PropertyState getProperty​(@NotNull
                                                                       @NotNull java.lang.String name)
        Specified by:
        getProperty in interface org.apache.jackrabbit.oak.spi.state.NodeState
        Overrides:
        getProperty in class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
      • hasProperty

        public boolean hasProperty​(@NotNull
                                   @NotNull java.lang.String name)
        Specified by:
        hasProperty in interface org.apache.jackrabbit.oak.spi.state.NodeState
        Overrides:
        hasProperty in class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
      • getProperties

        @NotNull
        public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState> getProperties()
        Specified by:
        getProperties in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • hasChildNode

        public boolean hasChildNode​(@NotNull
                                    @NotNull java.lang.String name)
        Specified by:
        hasChildNode in interface org.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:
        getChildNode in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getChildIfCached

        @Nullable
        public @Nullable DocumentNodeState getChildIfCached​(java.lang.String name)
        /** Returns the child node for the given name from the cache. This method returns null if the cache does not have an entry for the child node.

        Please note, the returned node state may also represent a node that does not exist. In which case exists() of the returned node state will return false.

        Parameters:
        name - the name of the child node.
        Returns:
        the node state or null if the cache does not have an entry for the child node.
      • getChildNodeCount

        public long getChildNodeCount​(long max)
        Specified by:
        getChildNodeCount in interface org.apache.jackrabbit.oak.spi.state.NodeState
        Overrides:
        getChildNodeCount in class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
      • getPropertyCount

        public long getPropertyCount()
        Specified by:
        getPropertyCount in interface org.apache.jackrabbit.oak.spi.state.NodeState
        Overrides:
        getPropertyCount in class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
      • getChildNodeEntries

        @NotNull
        public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry> getChildNodeEntries()
        Specified by:
        getChildNodeEntries in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • builder

        @NotNull
        public @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder builder()
        Specified by:
        builder in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getBundledChildNodeNames

        public java.util.Set<java.lang.String> getBundledChildNodeNames()
      • hasOnlyBundledChildren

        public boolean hasOnlyBundledChildren()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
      • getMemory

        public int getMemory()
        Specified by:
        getMemory in interface org.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.