Novell exteNd
Director 5.2 API

com.sssw.fw.usermgr.api
Interface EbiUserQuery

All Superinterfaces:
EbiMetaDataQuery, EbiQuery, EbiQueryBase, EbiUserMetaDataQuery, Serializable

public interface EbiUserQuery
extends EbiMetaDataQuery, EbiUserMetaDataQuery, Serializable

Objects that implement this interface represent queries that are used to search for Users maintained by the User Service.

The user is expected to create the Query in three steps:

  1. Specify all the selected properties using the 'select...' methods;
  2. Specify a WHERE clause by using the 'where...' methods, combining various WHERE subclauses via the EbiQueryExpression.andExpression, orExpression, and negate methods, and then using the 'setWhere' method on this interface;
  3. Specify the ORDER BY clause by using the 'orderBy...' methods.

Example:

 // define two custom attributes from PAC or user sevice API
 // "officeLocation" and "lastAccess".

 // Get the EbiContext and User Delegate objects.........
 context = ...
 userdelegate = com.sssw.fw.usermgr.client.EboFactory.getUserDelegate();


 // Create a User Query Object from fw factory
 EbiUserQuery userQuery =
  (EbiUserQuery)com.sssw.fw.factory.EboFactory.getQuery(EbiUserQuery.EL_USER_QUERY);

 // We're interested in users with last name 'Smith'
 EbiQueryExpression queryExpr = userQuery.whereLastName("Smith", EbiUserQUery.ROP_EQUAL, false);

 // The email address we're interested in has trailing of "novell.com"
 EbiQueryExpression emailExpr = userQuery.whereEmailAddressLike("novell.com", EbiUserQuery.ROP_LIKE, false);

 // AND the two defined above
 queryExpr.andExpression(emailExpr);

 // The custom attribute "officeLocation" we're interested in has 'Billerica'
 EbiQueryExpression customField1Expr = userQuery.whereAttribute(
 "officeLocation", "Billerica", EbiUserQuery.ROP_EQUAL, false);

 // The custom attribute "lastAccess" we're interested in was done 5/11/2000
 EbiQueryExpression customField2Expr = userQuery.whereAttribute(
 "lastAccess", "5/11/2000", EbiUserQuery.ROP_EQUAL, false);

 // AND the two custom attributes:
 // "officeLocation" and "LastAccess"
 customField1Expr.andExpression(customField2Expr);

 // AND the four attributes together:
 // lastname is "Smith" and emailaddress end as novell.com and
 // officeLocation was "Billerica" and lastAccess was done 5/11/2000
 queryExpr.andExpression(customField1Expr);

 // The WHERE clause is ready, set it into the Query
 userQuery.setWhere(queryExpr);

 // Set Select Clause (default select clause contains USERUUID and USERID
 // columns only, see EboUserMetaDataQuery class for details.)
 // Note: for selectAttribute() method only if the custom attribute is a base
 // attribute (i.e. defined as one of the 5 KEYn columns in the PROFILEUSERS table),
 // then it is allowed to be in the select clause. You may check whether an
 // attribute is a base attribute by calling userMeta.isBaseUserAttribute()
 // method.
 userQuery.selectFirstName();
 userQuery.selectAttribute("officeLocation");

 // Set orderBy clause (see EboUserMetaDataQuery class for detailes)
 // Note: the custom attribute restriction applies to orderByAttribute()
 // method as well.
 userQuery.orderByUserID();
 userQuery.orderByAttribute("lastAccess");

 // Execute the query
 EbiUserInfo[] results = userdelegate.getUserList(sess, userQuery);
 


Field Summary
static String EL_USER_QUERY
          The element type for User Query
 
Fields inherited from interface com.sssw.fw.api.EbiMetaDataQuery
LDAP_APPROX, LDAP_BETWEEN, LDAP_ENDS_WITH, LDAP_EQUAL, LDAP_GEQ, LDAP_GREATER, LDAP_IN, LDAP_LEQ, LDAP_LESS, LDAP_MATCH, LDAP_PRESENCE, LDAP_STARTS_WITH, OP_BETWEEN, OP_IN, OP_IS_NULL, ROP_EQUAL, ROP_GEQ, ROP_GREATER, ROP_LEQ, ROP_LESS, SOP_ENDS_WITH, SOP_EQUALS_IGNORE_CASE, SOP_LIKE, SOP_LIKE_IGNORE_CASE, SOP_STARTS_WITH
 
Method Summary
 EbiQueryExpression whereAttribute(String name, String value, int op, boolean not)
          Specify the seach condition of "where extension metadata attribute.."
 EbiQueryExpression whereAttributeBetween(String name, String first, String last, boolean not)
          Specify the search condition of "where attribute between..."
 EbiQueryExpression whereAttributeIn(String name, String[] values, boolean not)
          Specify the seach condition of "where extension metadata field ID in..."
 EbiQueryExpression whereEmailAddress(String value, int op, boolean not)
          Specify the seach condition of "where user emailaddress..."
 EbiQueryExpression whereEmailAddressBetween(String first, String last, boolean not)
          Specify the search condition of "where user emailaddress between..."
 EbiQueryExpression whereEmailAddressIn(String[] values, boolean not)
          Specify the search condition of "where user emailaddress in..."
 EbiQueryExpression whereFirstName(String value, int op, boolean not)
          Specify the seach condition of "where user First name..."
 EbiQueryExpression whereFirstNameBetween(String first, String last, boolean not)
          Specify the search condition of "where user First name between..."
 EbiQueryExpression whereFirstNameIn(String[] values, boolean not)
          Specify the seach condition of "where user First name in..."
 EbiQueryExpression whereLastName(String value, int op, boolean not)
          Specify the seach condition of "where user Last name..."
 EbiQueryExpression whereLastNameBetween(String first, String last, boolean not)
          Specify the search condition of "where user Last name between..."
 EbiQueryExpression whereLastNameIn(String[] values, boolean not)
          Specify the seach condition of "where user Last name in..."
 EbiQueryExpression whereRealmName(String value, int op, boolean not)
          Specify the search condition of "where realm name..."
 EbiQueryExpression whereRealmNameIn(String[] values, boolean not)
          Specify the search condition of "where realm name in..."
 EbiQueryExpression whereUpdateTime(Timestamp value, int op, boolean not)
          Specify the seach condition of "where update timestamp.."
 EbiQueryExpression whereUpdateTimeBetween(Timestamp first, Timestamp last, boolean not)
          Specify the search condition of "where update timestamp between..."
 EbiQueryExpression whereUpdateTimeIn(Timestamp[] values, boolean not)
          Specify the seach condition of "where update timestamps in..."
 EbiQueryExpression whereUserID(String value, int op, boolean not)
          Specify the search condition of "where user ID..."
 EbiQueryExpression whereUserIDBetween(String first, String last, boolean not)
          Specify the search condition of "where user ID between..."
 EbiQueryExpression whereUserIDIn(String[] values, boolean not)
          Specify the search condition of "where user ID in..."
 EbiQueryExpression whereUserUUID(String userIID, int op, boolean not)
          Specify the search condition of "where user UUID..."
 EbiQueryExpression whereUserUUIDIn(String[] values, boolean not)
          Specify the search condition of "where user UUID in..."
 
Methods implemented from interface com.sssw.fw.api.EbiMetaDataQuery
getSelectedColumnIndices, getWhere, isHierarchical, setWhere
 
Methods implemented from interface com.sssw.fw.usermgr.api.EbiUserMetaDataQuery
orderByAttribute, orderByEmailAddress, orderByFirstName, orderByLastName, orderByRealmName, orderByUpdateTime, orderByUserID, orderByUserUUID, selectAttribute, selectEmailAddress, selectFirstName, selectLastName, selectRealmName, selectUpdateTime
 

Field Detail

EL_USER_QUERY

public static final String EL_USER_QUERY
The element type for User Query
Method Detail

whereUserUUID

public EbiQueryExpression whereUserUUID(String userIID,
                                        int op,
                                        boolean not)
Specify the search condition of "where user UUID..."
Parameters:
value - the value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the constructed query expression

whereUserUUIDIn

public EbiQueryExpression whereUserUUIDIn(String[] values,
                                          boolean not)
Specify the search condition of "where user UUID in..."
Parameters:
values - the values for the IN condition
not - whether to negate the condition
Returns:
the constructed query expression

whereUserID

public EbiQueryExpression whereUserID(String value,
                                      int op,
                                      boolean not)
Specify the search condition of "where user ID..."
Parameters:
value - the value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the constructed query expression

whereUserIDIn

public EbiQueryExpression whereUserIDIn(String[] values,
                                        boolean not)
Specify the search condition of "where user ID in..."
Parameters:
values - the values for the IN condition
not - whether to negate the condition
Returns:
the constructed query expression

whereUserIDBetween

public EbiQueryExpression whereUserIDBetween(String first,
                                             String last,
                                             boolean not)
Specify the search condition of "where user ID between..."
Parameters:
first - the start expression for the range
last - the end expression for the range
not - whether to negate the condition
Returns:
the constructed query expression

whereFirstName

public EbiQueryExpression whereFirstName(String value,
                                         int op,
                                         boolean not)
Specify the seach condition of "where user First name..."
Parameters:
value - the value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the query expression

whereFirstNameIn

public EbiQueryExpression whereFirstNameIn(String[] values,
                                           boolean not)
Specify the seach condition of "where user First name in..."
Parameters:
values - the values for the IN condition
not - whether to negate the condition
Returns:
the query expression

whereFirstNameBetween

public EbiQueryExpression whereFirstNameBetween(String first,
                                                String last,
                                                boolean not)
Specify the search condition of "where user First name between..."
Parameters:
first - the start expression for the range
last - the end expression for the range
not - whether to negate the condition
Returns:
the constructed query expression

whereLastName

public EbiQueryExpression whereLastName(String value,
                                        int op,
                                        boolean not)
Specify the seach condition of "where user Last name..."
Parameters:
value - the value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the query expression

whereLastNameIn

public EbiQueryExpression whereLastNameIn(String[] values,
                                          boolean not)
Specify the seach condition of "where user Last name in..."
Parameters:
values - the values for the IN condition
not - whether to negate the condition
Returns:
the query expression

whereLastNameBetween

public EbiQueryExpression whereLastNameBetween(String first,
                                               String last,
                                               boolean not)
Specify the search condition of "where user Last name between..."
Parameters:
first - the start expression for the range
last - the end expression for the range
not - whether to negate the condition
Returns:
the constructed query expression

whereEmailAddress

public EbiQueryExpression whereEmailAddress(String value,
                                            int op,
                                            boolean not)
Specify the seach condition of "where user emailaddress..."
Parameters:
value - the value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the query expression

whereEmailAddressIn

public EbiQueryExpression whereEmailAddressIn(String[] values,
                                              boolean not)
Specify the search condition of "where user emailaddress in..."
Parameters:
values - the values for the IN condition
not - whether to negate the condition
Returns:
the constructed query expression

whereEmailAddressBetween

public EbiQueryExpression whereEmailAddressBetween(String first,
                                                   String last,
                                                   boolean not)
Specify the search condition of "where user emailaddress between..."
Parameters:
first - the start expression for the range
last - the end expression for the range
not - whether to negate the condition
Returns:
the constructed query expression

whereRealmName

public EbiQueryExpression whereRealmName(String value,
                                         int op,
                                         boolean not)
Specify the search condition of "where realm name..."
Parameters:
value - the value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the constructed query expression

whereRealmNameIn

public EbiQueryExpression whereRealmNameIn(String[] values,
                                           boolean not)
Specify the search condition of "where realm name in..."
Parameters:
values - the values for the range
not - whether to negate the condition
Returns:
the constructed query expression

whereAttribute

public EbiQueryExpression whereAttribute(String name,
                                         String value,
                                         int op,
                                         boolean not)
Specify the seach condition of "where extension metadata attribute.."
Parameters:
attribute - name/value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the query expression

whereAttributeIn

public EbiQueryExpression whereAttributeIn(String name,
                                           String[] values,
                                           boolean not)
Specify the seach condition of "where extension metadata field ID in..."
Parameters:
attributes - the names/values for the IN condition
not - whether to negate the condition
Returns:
the query expression

whereAttributeBetween

public EbiQueryExpression whereAttributeBetween(String name,
                                                String first,
                                                String last,
                                                boolean not)
Specify the search condition of "where attribute between..."
Parameters:
first - the start expression for the range
last - the end expression for the range
not - whether to negate the condition
Returns:
the constructed query expression

whereUpdateTime

public EbiQueryExpression whereUpdateTime(Timestamp value,
                                          int op,
                                          boolean not)
Specify the seach condition of "where update timestamp.."

Note

When using this method in one of the ldap realm configurations provided with Director you must specify the time in UTC format. This is required as directory servers such as Novell eDirectory store their timestamps in this format.

Parameters:
value - value for the condition
op - the operator (see EbiMetaDataQuery)
not - whether to negate the condition
Returns:
the query expression

whereUpdateTimeIn

public EbiQueryExpression whereUpdateTimeIn(Timestamp[] values,
                                            boolean not)
Specify the seach condition of "where update timestamps in..."

Note

When using this method in one of the ldap realm configurations provided with Director you must specify the time in UTC format. This is required as directory servers such as Novell eDirectory store their timestamps in this format.

Parameters:
values - the names/values for the IN condition
not - whether to negate the condition
Returns:
the query expression

whereUpdateTimeBetween

public EbiQueryExpression whereUpdateTimeBetween(Timestamp first,
                                                 Timestamp last,
                                                 boolean not)
Specify the search condition of "where update timestamp between..."

Note

When using this method in one of the ldap realm configurations provided with Director you must specify the times in UTC format. This is required as directory servers such as Novell eDirectory store their timestamps in this format.

Parameters:
first - the start expression for the range
last - the end expression for the range
not - whether to negate the condition
Returns:
the constructed query expression

Novell exteNd
Director 5.2 API