org.apache.jackrabbit.commons.jackrabbit.user
Class AuthorizableQueryManager

java.lang.Object
  extended by org.apache.jackrabbit.commons.jackrabbit.user.AuthorizableQueryManager

public class AuthorizableQueryManager
extends Object

This class handles the translation of queries for users and groups from a JSON format to the query model of Jackrabbit's user groups search (see UserManager#findAuthorizables(Query)). The JSON query format is defined as follows:

{
  ( selector: "authorizable" | "user" | "group" )?        // Defaults to "authorizable", see QueryBuilder#setSelector()

  (
    scope:                                                // See QueryBuilder#setScope()
    {
      groupName: /* group name (String) * /
      ( declaredOnly: true | false )                      // Defaults to true
    }
  ) ?                                                     // Defaults to all

  ( condition: [ CONJUNCTION+ ] ) ?                       // Defaults to a 'true' condition, see QueryBuilder#setCondition()

  (
    order | sort:                                         // See QueryBuilder#setOrder()
    {
      property: /* relative path (String) * /
      ( direction: "asc" | "desc" )                       // Defaults to "asc"
    }
  ) ?                                                     // Defaults to document order

  (
    limit:                                                // See QueryBuilder#setLimit()
    {
      offset: /* Positive Integer * /                     // Takes precedence over bound if both are given
      bound:  /* String, Number, Boolean * /
      max:    /* Positive Integer or -1 * /               // Defaults to no limit (-1)
    }
  ) ?                                                     // Defaults to all
}

CONJUNCTION ::= COMPOUND | PRIMITIVE
COMPOUND    ::= [ PRIMITIVE+ ]
PRIMITIVE   ::= { ATOM | NEGATION }
NEGATION    ::= not: { ATOM }                             // See QueryBuilder#not()
ATOM        ::= named: /* pattern * /                     // Users, groups of that name. See QueryBuilder#nameMatches()
            |   exists: /* relative path * /              // See QueryBuilder#exists()
            |   impersonates: /* authorizable name * /    // See QueryBuilder#impersonates()
            |   RELOP:
                {
                  property: /* relative path * /
                  value: /* String, Number, Boolean * /   // According to the type of the property
                }
            |   like:                                     // See QueryBuilder#like()
                {
                  property: /* relative path * /
                  pattern: /* pattern * /
                }
            |   contains:                                 // See QueryBuilder#contains()
                {
                  property: /* relative path * /
                  expression: /* search expression * /
                }
RELOP       ::= neq | eq | lt | le | gt | ge              // See QueryBuilder#neq(), QueryBuilder#eq(), ...


Field Summary
static int MAX_RESULT_COUNT
          Constant defining the default maximal size of the result set.
 
Constructor Summary
AuthorizableQueryManager(org.apache.jackrabbit.api.security.user.UserManager userManager, ValueFactory valueFactory)
           
 
Method Summary
 Iterator<org.apache.jackrabbit.api.security.user.Authorizable> execute(String query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_RESULT_COUNT

public static final int MAX_RESULT_COUNT
Constant defining the default maximal size of the result set.

See Also:
Constant Field Values
Constructor Detail

AuthorizableQueryManager

public AuthorizableQueryManager(org.apache.jackrabbit.api.security.user.UserManager userManager,
                                ValueFactory valueFactory)
Method Detail

execute

public Iterator<org.apache.jackrabbit.api.security.user.Authorizable> execute(String query)
                                                                       throws RepositoryException,
                                                                              IOException
Throws:
RepositoryException
IOException


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.