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 anAbstractDocumentNodeState
by extracting the meta properties which are stored as hidden properties
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROP_LAST_REV
static String
PROP_REVISION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder
builder()
boolean
exists()
boolean
getBoolean(@NotNull String name)
@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()
Iterable<String>
getChildNodeNames()
RevisionVector
getLastRevision()
long
getLong(String name)
String
getName(@NotNull String name)
@NotNull Iterable<String>
getNames(@NotNull String name)
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()
RevisionVector
getRootRevision()
String
getString(String name)
@NotNull Iterable<String>
getStrings(@NotNull String name)
boolean
hasChildNode(@NotNull String name)
static boolean
hasMetaProps(org.apache.jackrabbit.oak.spi.state.NodeState delegate)
boolean
hasNoChildren()
boolean
hasProperty(@NotNull String name)
boolean
isFromExternalChange()
AbstractDocumentNodeState
withRootRevision(@NotNull RevisionVector root, boolean externalChange)
Creates a copy of thisDocumentNodeState
with theAbstractDocumentNodeState.getRootRevision()
set to the givenroot
revision.static AbstractDocumentNodeState
wrap(org.apache.jackrabbit.oak.spi.state.NodeState delegate, NodeStateDiffer differ)
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 aDelegatingDocumentNodeState
if 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 String PROP_REVISION
- See Also:
- Constant Field Values
-
PROP_LAST_REV
public static final 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 aDelegatingDocumentNodeState
if 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:
getPath
in classAbstractDocumentNodeState
-
getLastRevision
public RevisionVector getLastRevision()
- Specified by:
getLastRevision
in classAbstractDocumentNodeState
-
getRootRevision
public RevisionVector getRootRevision()
- Specified by:
getRootRevision
in classAbstractDocumentNodeState
-
isFromExternalChange
public boolean isFromExternalChange()
- Specified by:
isFromExternalChange
in classAbstractDocumentNodeState
-
withRootRevision
public AbstractDocumentNodeState withRootRevision(@NotNull @NotNull RevisionVector root, boolean externalChange)
Description copied from class:AbstractDocumentNodeState
Creates a copy of thisDocumentNodeState
with theAbstractDocumentNodeState.getRootRevision()
set to the givenroot
revision. This method returnsthis
instance if the givenroot
revision is the same as the one in this instance and theAbstractDocumentNodeState.isFromExternalChange()
flags are equal.- Specified by:
withRootRevision
in 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:
hasNoChildren
in classAbstractDocumentNodeState
-
getNodeStateDiffer
protected NodeStateDiffer getNodeStateDiffer()
- Specified by:
getNodeStateDiffer
in classAbstractDocumentNodeState
-
exists
public boolean exists()
-
getProperties
@NotNull public @NotNull Iterable<? extends org.apache.jackrabbit.oak.api.PropertyState> getProperties()
-
hasChildNode
public boolean hasChildNode(@NotNull @NotNull String name)
-
getChildNode
@NotNull public @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getChildNode(@NotNull @NotNull String name) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getChildNodeEntries
@NotNull public @NotNull 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 String name)
- Specified by:
getProperty
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getProperty
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
-
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
-
getBoolean
public boolean getBoolean(@NotNull @NotNull String name)
- Specified by:
getBoolean
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getBoolean
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getLong
public long getLong(String name)
- Specified by:
getLong
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getLong
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getString
public String getString(String name)
- Specified by:
getString
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getString
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getStrings
@NotNull public @NotNull Iterable<String> getStrings(@NotNull @NotNull String name)
- Specified by:
getStrings
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getStrings
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getName
public String getName(@NotNull @NotNull String name)
- Specified by:
getName
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getName
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
getNames
@NotNull public @NotNull Iterable<String> getNames(@NotNull @NotNull String name)
- Specified by:
getNames
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
- Overrides:
getNames
in classorg.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
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
-
-