Class DelegatingDocumentNodeState
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
- org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState
-
- org.apache.jackrabbit.oak.plugins.document.secondary.DelegatingDocumentNodeState
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.spi.state.NodeState
public class DelegatingDocumentNodeState extends AbstractDocumentNodeState
NodeState wrapper which wraps another NodeState (mostly SegmentNodeState) so as to expose it as anAbstractDocumentNodeStateby extracting the meta properties which are stored as hidden properties
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_LAST_REVstatic java.lang.StringPROP_REVISION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilderbuilder()booleanexists()booleangetBoolean(@NotNull java.lang.String name)@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()java.lang.Iterable<java.lang.String>getChildNodeNames()RevisionVectorgetLastRevision()longgetLong(java.lang.String name)java.lang.StringgetName(@NotNull java.lang.String name)@NotNull java.lang.Iterable<java.lang.String>getNames(@NotNull java.lang.String name)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()RevisionVectorgetRootRevision()java.lang.StringgetString(java.lang.String name)@NotNull java.lang.Iterable<java.lang.String>getStrings(@NotNull java.lang.String name)booleanhasChildNode(@NotNull java.lang.String name)static booleanhasMetaProps(org.apache.jackrabbit.oak.spi.state.NodeState delegate)booleanhasNoChildren()booleanhasProperty(@NotNull java.lang.String name)booleanisFromExternalChange()AbstractDocumentNodeStatewithRootRevision(@NotNull RevisionVector root, boolean externalChange)Creates a copy of thisDocumentNodeStatewith theAbstractDocumentNodeState.getRootRevision()set to the givenrootrevision.static AbstractDocumentNodeStatewrap(org.apache.jackrabbit.oak.spi.state.NodeState delegate, NodeStateDiffer differ)static org.apache.jackrabbit.oak.spi.state.NodeStatewrapIfPossible(org.apache.jackrabbit.oak.spi.state.NodeState delegate, NodeStateDiffer differ)Wraps a given root NodeState as aDelegatingDocumentNodeStateif it has required meta properties otherwise just returns the passed NodeState-
Methods inherited from class org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState
compareAgainstBaseState, equals
-
-
-
-
Field Detail
-
PROP_REVISION
public static final java.lang.String PROP_REVISION
- See Also:
- Constant Field Values
-
PROP_LAST_REV
public static final java.lang.String PROP_LAST_REV
- See Also:
- Constant Field Values
-
-
Method Detail
-
wrapIfPossible
public static org.apache.jackrabbit.oak.spi.state.NodeState wrapIfPossible(org.apache.jackrabbit.oak.spi.state.NodeState delegate, NodeStateDiffer differ)Wraps a given root NodeState as aDelegatingDocumentNodeStateif it has required meta properties otherwise just returns the passed NodeState- Parameters:
delegate- nodeState to wrap- Returns:
- wrapped state or original state
-
hasMetaProps
public static boolean hasMetaProps(org.apache.jackrabbit.oak.spi.state.NodeState delegate)
-
wrap
public static AbstractDocumentNodeState wrap(org.apache.jackrabbit.oak.spi.state.NodeState delegate, NodeStateDiffer differ)
-
getPath
public Path getPath()
- Specified by:
getPathin classAbstractDocumentNodeState
-
getLastRevision
public RevisionVector getLastRevision()
- Specified by:
getLastRevisionin classAbstractDocumentNodeState
-
getRootRevision
public RevisionVector getRootRevision()
- Specified by:
getRootRevisionin classAbstractDocumentNodeState
-
isFromExternalChange
public boolean isFromExternalChange()
- Specified by:
isFromExternalChangein classAbstractDocumentNodeState
-
withRootRevision
public AbstractDocumentNodeState withRootRevision(@NotNull @NotNull RevisionVector root, boolean externalChange)
Description copied from class:AbstractDocumentNodeStateCreates a copy of thisDocumentNodeStatewith theAbstractDocumentNodeState.getRootRevision()set to the givenrootrevision. This method returnsthisinstance if the givenrootrevision is the same as the one in this instance and theAbstractDocumentNodeState.isFromExternalChange()flags are equal.- Specified by:
withRootRevisionin classAbstractDocumentNodeState- Parameters:
root- the root revision for the copy of this node state.externalChange- if theAbstractDocumentNodeState.isFromExternalChange()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.
-
hasNoChildren
public boolean hasNoChildren()
- Specified by:
hasNoChildrenin classAbstractDocumentNodeState
-
getNodeStateDiffer
protected NodeStateDiffer getNodeStateDiffer()
- Specified by:
getNodeStateDifferin classAbstractDocumentNodeState
-
exists
public boolean exists()
-
getProperties
@NotNull public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState> getProperties()
-
hasChildNode
public boolean hasChildNode(@NotNull @NotNull java.lang.String name)
-
getChildNode
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getChildNode(@NotNull @NotNull java.lang.String name) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
getChildNodeEntries
@NotNull public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry> getChildNodeEntries()
-
builder
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder builder()
-
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
-
getPropertyCount
public long getPropertyCount()
- Specified by:
getPropertyCountin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getPropertyCountin 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
-
getBoolean
public boolean getBoolean(@NotNull @NotNull java.lang.String name)- Specified by:
getBooleanin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getBooleanin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getLong
public long getLong(java.lang.String name)
- Specified by:
getLongin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getLongin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getString
public java.lang.String getString(java.lang.String name)
- Specified by:
getStringin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getStringin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getStrings
@NotNull public @NotNull java.lang.Iterable<java.lang.String> getStrings(@NotNull @NotNull java.lang.String name)- Specified by:
getStringsin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getStringsin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getName
public java.lang.String getName(@NotNull @NotNull java.lang.String name)- Specified by:
getNamein interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getNamein classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getNames
@NotNull public @NotNull java.lang.Iterable<java.lang.String> getNames(@NotNull @NotNull java.lang.String name)- Specified by:
getNamesin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getNamesin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
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
-
getChildNodeNames
public java.lang.Iterable<java.lang.String> getChildNodeNames()
- Specified by:
getChildNodeNamesin interfaceorg.apache.jackrabbit.oak.spi.state.NodeState- Overrides:
getChildNodeNamesin classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
-