Class 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 Tree createIndexDefinition​(@NotNull 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 given indexNode.
      static Tree createIndexDefinition​(@NotNull 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 given indexNode of the provided propertyIndexType.
      static NodeBuilder createIndexDefinition​(@NotNull 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 given indexNode.
      static NodeBuilder createIndexDefinition​(@NotNull 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 given indexNode of the provided propertyIndexType.
      static void createReferenceIndex​(@NotNull NodeBuilder index)  
      static @Nullable java.lang.String getAsyncLaneName​(NodeState idxState, java.lang.String indexPath)  
      static @Nullable java.lang.String getAsyncLaneName​(NodeState idxState, java.lang.String indexPath, PropertyState async)  
      static NodeBuilder getOrCreateOakIndex​(NodeBuilder root)  
      static boolean isIndexNodeType​(NodeState state)  
      static boolean isIndexNodeType​(NodeState state, java.lang.String typeIn)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createIndexDefinition

        public static NodeBuilder createIndexDefinition​(@NotNull
                                                        @NotNull 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 given indexNode.
        Parameters:
        index - The oak:index node builder
        indexDefName - 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 or null.
        Returns:
        the NodeBuilder of the new index definition.
      • createIndexDefinition

        public static Tree createIndexDefinition​(@NotNull
                                                 @NotNull 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 given indexNode.
        Parameters:
        indexNode -
        indexDefName -
        unique -
        propertyNames -
        declaringNodeTypeNames -
        Throws:
        RepositoryException
      • createIndexDefinition

        public static Tree createIndexDefinition​(@NotNull
                                                 @NotNull 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 given indexNode of the provided propertyIndexType.
        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 NodeBuilder index)
      • isIndexNodeType

        public static boolean isIndexNodeType​(NodeState state)
      • isIndexNodeType

        public static boolean isIndexNodeType​(NodeState state,
                                              java.lang.String typeIn)
      • createIndexDefinition

        public static NodeBuilder createIndexDefinition​(@NotNull
                                                        @NotNull 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 given indexNode of the provided propertyIndexType.
        Parameters:
        indexNode - the oak:index
        indexDefName - the node for the index definition
        unique - true if uniqueness
        propertyNames - the list of properties to be indexed
        declaringNodeTypeNames -
        propertyIndexType - the type of the PropertyIndex
        properties - any additional property to be added to the index definition.
        Throws:
        RepositoryException
      • getAsyncLaneName

        @Nullable
        public static @Nullable java.lang.String getAsyncLaneName​(NodeState idxState,
                                                                  java.lang.String indexPath)
      • getAsyncLaneName

        @Nullable
        public static @Nullable java.lang.String getAsyncLaneName​(NodeState idxState,
                                                                  java.lang.String indexPath,
                                                                  PropertyState async)