Class QueryUtil


  • public final class QueryUtil
    extends java.lang.Object
    Common utilities used for user/group queries.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.lang.String escapeForQuery​(@NotNull java.lang.String value)  
      static @NotNull java.lang.String escapeForQuery​(@NotNull java.lang.String oakName, @NotNull NamePathMapper namePathMapper)  
      static @NotNull java.lang.String escapeNodeName​(@NotNull java.lang.String string)
      Escape string for matching in jcr escaped node names
      static @NotNull java.lang.String format​(@NotNull Value value)  
      static @NotNull org.apache.jackrabbit.oak.security.user.query.RelationOp getCollation​(QueryBuilder.Direction direction)  
      static @Nullable java.lang.String getID​(@Nullable Authorizable authorizable)  
      static @NotNull java.lang.String getNodeTypeName​(@NotNull AuthorizableType type)
      Retrieve the node type name for the specified authorizable type.
      static @NotNull java.lang.String getSearchRoot​(AuthorizableType type, ConfigurationParameters config)
      Determine the search root for the given authorizable type based on the configured root path.
      • Methods inherited from class java.lang.Object

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

      • getSearchRoot

        @NotNull
        public static @NotNull java.lang.String getSearchRoot​(AuthorizableType type,
                                                              ConfigurationParameters config)
        Determine the search root for the given authorizable type based on the configured root path.
        Parameters:
        type - The authorizable type.
        config - The configuration parameters.
        Returns:
        The path of search root for the specified authorizable type.
      • getNodeTypeName

        @NotNull
        public static @NotNull java.lang.String getNodeTypeName​(@NotNull
                                                                @NotNull AuthorizableType type)
        Retrieve the node type name for the specified authorizable type.
        Parameters:
        type - The authorizable type.
        Returns:
        The corresponding node type name.
      • escapeNodeName

        @NotNull
        public static @NotNull java.lang.String escapeNodeName​(@NotNull
                                                               @NotNull java.lang.String string)
        Escape string for matching in jcr escaped node names
        Parameters:
        string - string to escape
        Returns:
        escaped string
      • escapeForQuery

        @NotNull
        public static @NotNull java.lang.String escapeForQuery​(@NotNull
                                                               @NotNull java.lang.String oakName,
                                                               @NotNull
                                                               @NotNull NamePathMapper namePathMapper)
      • escapeForQuery

        @NotNull
        public static @NotNull java.lang.String escapeForQuery​(@NotNull
                                                               @NotNull java.lang.String value)
      • getCollation

        @NotNull
        public static @NotNull org.apache.jackrabbit.oak.security.user.query.RelationOp getCollation​(@NotNull
                                                                                                     QueryBuilder.Direction direction)
      • getID

        @Nullable
        public static @Nullable java.lang.String getID​(@Nullable
                                                       @Nullable Authorizable authorizable)