org.apache.jackrabbit.commons.jackrabbit.user
Class AuthorizableQueryManager
java.lang.Object
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(), ...
- A relative path refers to a property or a child node of an user or a group. Property names need to be
prefixed with the at (@) character. Invalid JCR characters need proper escaping. The current path is denoted
by a dot (.).
- In a 'pattern' the percent character (%) represents any string of zero or more characters and the underscore
character (_) represents any single character. Any literal use of these characters and the backslash
character (\) must be escaped with a backslash character. The pattern is matched against
Authorizable#getID() and Authorizable#getPrincipal().
- The syntax of 'expression' is [-]value { [OR] [-]value }.
|
Field Summary |
static int |
MAX_RESULT_COUNT
Constant defining the default maximal size of the result set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
AuthorizableQueryManager
public AuthorizableQueryManager(org.apache.jackrabbit.api.security.user.UserManager userManager,
ValueFactory valueFactory)
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.