Novell exteNd
Director 5.0 API

com.sssw.fw.persist.jndi.api
Interface EbiJndiQuery

All Superinterfaces:
EbiQuery, EbiQueryBase, Serializable
All Known Subinterfaces:
EbiJndiMetaDataQuery

public interface EbiJndiQuery
extends EbiQuery

This interface defines a generic LDAP query. It's used to construct queries that return search results.


Method Summary
 void addOrderBy(String attribName, boolean asc)
          Designate an attribute for ordering in a JNDI query.
 void addSelect(String attribName)
          Designate an attribute for selection in a JNDI query.
 void clear()
          Clear all selections related to this query
 Object[] getArguments()
          Get the query arguments, if there are any.
 String getContextName()
          Get the contextName value for the query.
 long getCountLimit()
          Get the CountLimit attribute for the query.
 DirContext getDirContext()
          Get the DirContext for the query.
 String[] getReturningAttributes()
          Get the array of attributes to be returned by this query.
 SearchControls getSearchControls()
          Get the search controls for this query.
 int getSearchScope()
          Get the scope attribute for the query.
 int getTimeLimit()
          Get the TimeLimit attribute for the query.
 EbiQueryExpression getWhere()
          Get a query's search filter.
 void setArguments(Object[] args)
          Specify an array or arguments for an argument style query.
 void setContextName(String contextName)
          Designate the context name for a JNDI query.
 void setCountLimit(long limit)
          Specify a maximum number of entries to be returned by the query.
 void setDirContext(DirContext dirContext)
          Designate the DirContext for a JNDI query.
 void setSearchScope(int scope)
          Specify the scope for the query.
 void setTimeLimit(int msecs)
          Specify a timeout interval to be used with the query.
 void setWhere(EbiQueryExpression expr)
          Designate a filter expression for a JNDI query.
 EbiQueryExpression whereAttributeBetween(String attribName, Object first, Object last, boolean not)
          Specify the search condition for selecting from a range of attribute values
 EbiQueryExpression whereAttributeIn(String attribName, Object[] values, boolean not)
          Specify the search condition for selecting from a set of attribute values
 EbiQueryExpression whereAttributeOp(String attribName, Object value, int op, boolean not)
          Specify the search condition for an attribute
 EbiQueryExpression whereAttributeOpWithArg(String attribName, int op, boolean not)
          Specify the search condition for an attribute.
 EbiQueryExpression whereAttributeOpWithAttrArg(int op, boolean not)
          Specify the search condition for an attribute.
 
Methods implemented from interface com.sssw.fw.api.EbiQuery
allSelected, deselectAll, getOrderBys, getQueryString, getSelects, removeOrderBys, selectAll
 

Method Detail

setContextName

public void setContextName(String contextName)
Designate the context name for a JNDI query. If a name is not specified, the root of the JNDI tree will be used.
Parameters:
contextName - the name of the context for the query (e.g., o=Administrator )

getContextName

public String getContextName()
Get the contextName value for the query. This method will return the DirectoryService ROOT_CONTAINER configuration entry if the value hasn't been explicitly set.
Returns:
a String value.

setDirContext

public void setDirContext(DirContext dirContext)
Designate the DirContext for a JNDI query. If a context is not specified, the context associated with the login user will be used. This context is established based upon the user's login credentials and server configuration specified during project deployment.
Parameters:
dirContext - the context against which the query will be executed.

getDirContext

public DirContext getDirContext()
Get the DirContext for the query. This method will return null if the value hasn't been explicitly set. Queries utilize the DirContext associated with the login user unless an explicit value is specified.
Returns:
a DirContext value.

addSelect

public void addSelect(String attribName)
Designate an attribute for selection in a JNDI query.
Parameters:
attribName - an attribute name to be selected in the query.

addOrderBy

public void addOrderBy(String attribName,
                       boolean asc)
Designate an attribute for ordering in a JNDI query.
Parameters:
attribName - an attribute name to be used for ordering in a query.
asc - a boolean value indicating whether to use ascending order.

setWhere

public void setWhere(EbiQueryExpression expr)
Designate a filter expression for a JNDI query.
Parameters:
expr - an EbiQueryExpression containing the search filter.

whereAttributeOp

public EbiQueryExpression whereAttributeOp(String attribName,
                                           Object value,
                                           int op,
                                           boolean not)
Specify the search condition for an attribute
Parameters:
attribName - the name of the attribute being evaluated
value - an Object value for the condition, valid objects are defined in EboLdapSearchHelper
op - an operator, valid operators are defined in EboLdapSearchHelper
not - whether to negate the condition
Returns:
the query expression

whereAttributeOpWithArg

public EbiQueryExpression whereAttributeOpWithArg(String attribName,
                                                  int op,
                                                  boolean not)
Specify the search condition for an attribute. The value will be provided in a separate argument and must be set in the returned query expression.
Parameters:
attribName - the name of the attribute being evaluated
op - an operator, valid operators are defined in EboLdapSearchHelper
not - whether to negate the condition
Returns:
the query expression

whereAttributeOpWithAttrArg

public EbiQueryExpression whereAttributeOpWithAttrArg(int op,
                                                      boolean not)
Specify the search condition for an attribute. The attribute and value will both be provided in separate arguments and must be set in the returned query expression.
Parameters:
op - an operator, valid operators are defined in EboLdapSearchHelper
not - whether to negate the condition
Returns:
the query expression

whereAttributeIn

public EbiQueryExpression whereAttributeIn(String attribName,
                                           Object[] values,
                                           boolean not)
Specify the search condition for selecting from a set of attribute values
Parameters:
attribName - the name of the attribute being evaluated
values - Object values for the selectable set
not - whether to negate the condition
Returns:
the query expression

whereAttributeBetween

public EbiQueryExpression whereAttributeBetween(String attribName,
                                                Object first,
                                                Object last,
                                                boolean not)
Specify the search condition for selecting from a range of attribute values
Parameters:
attribName - the name of the attribute being evaluated
first - the start Object value for the range
last - the end Object value for the range
not - whether to negate the condition
Returns:
the constructed query expression

getWhere

public EbiQueryExpression getWhere()
Get a query's search filter.
Returns:
an EbiQueryExpression containing the search filter

clear

public void clear()
Clear all selections related to this query

setCountLimit

public void setCountLimit(long limit)
Specify a maximum number of entries to be returned by the query. This attribute is applied to the JNDI SearchControls associated with the query.
Parameters:
limit - is a long containing the maximum entries to be returned.

getCountLimit

public long getCountLimit()
Get the CountLimit attribute for the query. This method will return the JNDI default value of 0 if the attribute isn't explicitly set.
Returns:
a long

setSearchScope

public void setSearchScope(int scope)
Specify the scope for the query. Valid values are defined in the SearchControls interface.
Parameters:
scope - is an integer identifying the scope for the query.

getSearchScope

public int getSearchScope()
Get the scope attribute for the query. This method will return the JNDI default value of SUBTREE_SCOPE if the attribute isn't explicitly set.
Returns:
an integer

setTimeLimit

public void setTimeLimit(int msecs)
Specify a timeout interval to be used with the query. This attribute is applied to the JNDI search controls used to execute the query.
Parameters:
msecs - is an int representing the timeout in milliseconds.

getTimeLimit

public int getTimeLimit()
Get the TimeLimit attribute for the query. This method will return the JNDI default value of 0 if the attribute hasn't been explicitly set.
Returns:
an integer value.

getReturningAttributes

public String[] getReturningAttributes()
Get the array of attributes to be returned by this query.
Returns:
an array of attribute names, null for all attributes, empty string for no attributes.

getSearchControls

public SearchControls getSearchControls()
Get the search controls for this query.
Returns:
a SearchControls object string for no attributes.

setArguments

public void setArguments(Object[] args)
Specify an array or arguments for an argument style query. Arguments must be listed in the suquence with which there were added. This is a convenience that resets the argument list in the underlying query expression.
Parameters:
args - the array of argument values

getArguments

public Object[] getArguments()
Get the query arguments, if there are any.
Returns:
an array of parameters with propName/propDatatype/propValue for each argument.

Novell exteNd
Director 5.0 API