org.apache.jackrabbit.api.security.user
Interface Query


public interface Query

A query to match Authorizables. Pass an instance of this interface to UserManager.findAuthorizables(Query). The following query finds all users named 'Bob' which have the word 'engineer' in its description and returns them in ascending order wrt. to the name.

  Iterator result = userMgr.findAuthorizables(new Query() {
      public  void build(QueryBuilder builder) {
          builder.setCondition(builder.
              and(builder.
                  property("@name", RelationOp.EQ, valueFactory.createValue("Bob")), builder.
                  contains("@description", "engineer")));

          builder.setSortOrder("@name", Direction.ASCENDING);
          builder.setSelector(Selector.USER);
      }
  });
 


Method Summary
<T> void
build(QueryBuilder<T> builder)
          Build the query using a QueryBuilder.
 

Method Detail

build

<T> void build(QueryBuilder<T> builder)
Build the query using a QueryBuilder.

Type Parameters:
T - Opaque type of the query builder.
Parameters:
builder - A query builder for building the query.


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