Class IndexUtils
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.index.IndexUtils
-
public final class IndexUtils extends java.lang.Object
TODO document
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.jackrabbit.oak.api.Tree
createIndexDefinition(@NotNull org.apache.jackrabbit.oak.api.Tree indexNode, @NotNull java.lang.String indexDefName, boolean unique, @NotNull java.lang.String[] propertyNames, @NotNull java.lang.String... declaringNodeTypeNames)
Create a new property2 index definition below the givenindexNode
.static org.apache.jackrabbit.oak.api.Tree
createIndexDefinition(@NotNull org.apache.jackrabbit.oak.api.Tree indexNode, @NotNull java.lang.String indexDefName, boolean unique, @NotNull java.util.Collection<java.lang.String> propertyNames, @Nullable java.util.Collection<java.lang.String> declaringNodeTypeNames, @NotNull java.lang.String propertyIndexType, @Nullable java.util.Map<java.lang.String,java.lang.String> properties)
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.static org.apache.jackrabbit.oak.spi.state.NodeBuilder
createIndexDefinition(@NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder index, @NotNull java.lang.String indexDefName, boolean reindex, boolean unique, @NotNull java.util.Collection<java.lang.String> propertyNames, @Nullable java.util.Collection<java.lang.String> declaringNodeTypeNames)
Create a new property index definition below the givenindexNode
.static org.apache.jackrabbit.oak.spi.state.NodeBuilder
createIndexDefinition(@NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder indexNode, @NotNull java.lang.String indexDefName, boolean unique, @NotNull java.lang.Iterable<java.lang.String> propertyNames, @Nullable java.lang.String[] declaringNodeTypeNames, @NotNull java.lang.String propertyIndexType, java.util.Map<java.lang.String,java.lang.String> properties)
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.static void
createReferenceIndex(@NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder index)
static @Nullable java.lang.String
getAsyncLaneName(org.apache.jackrabbit.oak.spi.state.NodeState idxState, java.lang.String indexPath)
static @Nullable java.lang.String
getAsyncLaneName(org.apache.jackrabbit.oak.spi.state.NodeState idxState, java.lang.String indexPath, org.apache.jackrabbit.oak.api.PropertyState async)
static @NotNull java.lang.String
getCaller(@Nullable java.lang.String[] ignoredJavaPackages)
Retrieves the calling class and method from the call stack; this is determined by unwinding the stack until it finds a combination of full qualified classname + method (separated by ".") which do not start with any of the values provided by the ignoredJavaPackages parameters.static org.apache.jackrabbit.oak.spi.state.NodeBuilder
getOrCreateOakIndex(org.apache.jackrabbit.oak.spi.state.NodeBuilder root)
static boolean
isIndexNodeType(org.apache.jackrabbit.oak.spi.state.NodeState state)
static boolean
isIndexNodeType(org.apache.jackrabbit.oak.spi.state.NodeState state, java.lang.String typeIn)
-
-
-
Method Detail
-
getOrCreateOakIndex
public static org.apache.jackrabbit.oak.spi.state.NodeBuilder getOrCreateOakIndex(org.apache.jackrabbit.oak.spi.state.NodeBuilder root)
-
createIndexDefinition
public static org.apache.jackrabbit.oak.spi.state.NodeBuilder createIndexDefinition(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder index, @NotNull @NotNull java.lang.String indexDefName, boolean reindex, boolean unique, @NotNull @NotNull java.util.Collection<java.lang.String> propertyNames, @Nullable @Nullable java.util.Collection<java.lang.String> declaringNodeTypeNames)
Create a new property index definition below the givenindexNode
.- Parameters:
index
- The oak:index node builderindexDefName
- The name of the new property index.reindex
-true
if the the reindex flag should be turned on.unique
-true
if the index is expected the assert property uniqueness.propertyNames
- The property names that should be indexed.declaringNodeTypeNames
- The declaring node type names ornull
.- Returns:
- the NodeBuilder of the new index definition.
-
createIndexDefinition
public static org.apache.jackrabbit.oak.api.Tree createIndexDefinition(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree indexNode, @NotNull @NotNull java.lang.String indexDefName, boolean unique, @NotNull @NotNull java.lang.String[] propertyNames, @NotNull @NotNull java.lang.String... declaringNodeTypeNames) throws RepositoryException
Create a new property2 index definition below the givenindexNode
.- Parameters:
indexNode
-indexDefName
-unique
-propertyNames
-declaringNodeTypeNames
-- Throws:
RepositoryException
-
createIndexDefinition
public static org.apache.jackrabbit.oak.api.Tree createIndexDefinition(@NotNull @NotNull org.apache.jackrabbit.oak.api.Tree indexNode, @NotNull @NotNull java.lang.String indexDefName, boolean unique, @NotNull @NotNull java.util.Collection<java.lang.String> propertyNames, @Nullable @Nullable java.util.Collection<java.lang.String> declaringNodeTypeNames, @NotNull @NotNull java.lang.String propertyIndexType, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.String> properties) throws RepositoryException
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.- Parameters:
indexNode
-indexDefName
-unique
-propertyNames
-declaringNodeTypeNames
-propertyIndexType
-properties
- any additional property to be added to the index definition.- Throws:
RepositoryException
-
createReferenceIndex
public static void createReferenceIndex(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder index)
-
isIndexNodeType
public static boolean isIndexNodeType(org.apache.jackrabbit.oak.spi.state.NodeState state)
-
isIndexNodeType
public static boolean isIndexNodeType(org.apache.jackrabbit.oak.spi.state.NodeState state, java.lang.String typeIn)
-
createIndexDefinition
public static org.apache.jackrabbit.oak.spi.state.NodeBuilder createIndexDefinition(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeBuilder indexNode, @NotNull @NotNull java.lang.String indexDefName, boolean unique, @NotNull @NotNull java.lang.Iterable<java.lang.String> propertyNames, @Nullable @Nullable java.lang.String[] declaringNodeTypeNames, @NotNull @NotNull java.lang.String propertyIndexType, java.util.Map<java.lang.String,java.lang.String> properties) throws RepositoryException
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.- Parameters:
indexNode
- the oak:indexindexDefName
- the node for the index definitionunique
- true if uniquenesspropertyNames
- the list of properties to be indexeddeclaringNodeTypeNames
-propertyIndexType
- the type of the PropertyIndexproperties
- any additional property to be added to the index definition.- Throws:
RepositoryException
-
getAsyncLaneName
@Nullable public static @Nullable java.lang.String getAsyncLaneName(org.apache.jackrabbit.oak.spi.state.NodeState idxState, java.lang.String indexPath)
-
getAsyncLaneName
@Nullable public static @Nullable java.lang.String getAsyncLaneName(org.apache.jackrabbit.oak.spi.state.NodeState idxState, java.lang.String indexPath, org.apache.jackrabbit.oak.api.PropertyState async)
-
getCaller
@NotNull public static @NotNull java.lang.String getCaller(@Nullable @Nullable java.lang.String[] ignoredJavaPackages)
Retrieves the calling class and method from the call stack; this is determined by unwinding the stack until it finds a combination of full qualified classname + method (separated by ".") which do not start with any of the values provided by the ignoredJavaPackages parameters. If the provided parameters cover all stack frames, the whole query is considered to be internal, where the actual caller doesn't matter (or cannot be determined clearly). In this case a short message indicating this is returned. If the ignoredJavaPackages parameter is null or empty, the caller is not looked up, but instead it is assumed, that the feature is not configured; in that case a short messages is returned indicating that the feature is not configured.- Parameters:
ignoredJavaPackages
- the java packages or class names- Returns:
- the calling class or another non-null value
-
-