Interface IDirectorySearch
public interface IDirectorySearch
{
// Fields
public static final int ADS_DEREF_ALWAYS;
public static final int ADS_DEREF_FINDING;
public static final int ADS_DEREF_NEVER;
public static final int ADS_DEREF_SEARCHING;
public static final int ADS_SCOPE_BASE;
public static final int ADS_SCOPE_ONELEVEL;
public static final int ADS_SCOPE_SUBTREE;
public static final int ADS_SEARCHPREF_ASYNCHRONOUS;
public static final int ADS_SEARCHPREF_ATTRIBUTES_ONLY;
public static final int ADS_SEARCHPREF_DEREF_ALIASES;
public static final int ADS_SEARCHPREF_PAGESIZE;
public static final int ADS_SEARCHPREF_SEARCH_SCOPE;
public static final int ADS_SEARCHPREF_SIZE_LIMIT;
public static final int ADS_SEARCHPREF_TIME_LIMIT;
public static final int ADS_SEARCHPREF_TIMEOUT;
public static final int ADS_STATUS_INVALID_SEARCHPREF;
public static final int ADS_STATUS_INVALID_SEARCHPREFVALUE;
public static final int ADS_STATUS_OK;
public static final int ADS_STATUS_UNKNOWN;
public static final int ADSTYPE_BOOLEAN;
public static final int ADSTYPE_INTEGER;
public static final int ADSTYPE_LARGE_INTEGER;
public static final int ADSTYPE_OCTET_STRING;
public static final int ADSTYPE_PRINTABLE_STRING;
public static final int ADSTYPE_UTC_TIME;
// Methods
public ADsSearchResult ExecuteSearch( String searchFilter,
String[] attributeNames ) throws IADsException;
public ADsSearchColumn GetColumn( ADsSearchResult result,
String columnName ) throws IADsException;
public void GetFirstRow(ADsSearchResult result)
throws IADsException;
public String GetNextColumnName(ADsSearchResult result)
throws IADsException;
public void GetNextRow(ADsSearchResult result)
throws IADsException;
public void SetSearchPreference(
ADsSearchPrefInfo preferences[]) throws IADsException;
}
This interface specifies the methods which objects must implement to support searches.
Also see Also Active Directory Design Specification Version 2.0
Methods
public ADsSearchResult ExecuteSearch( String searchFilter,
String[] attributeNames ) throws IADsException;
Performs the search operation and returns the handle if no exception was thrown.
| Parameter | Description |
| searchFilter, | a string indicating the filter to use.
|
| attributeNames, | an array of attributes interested in.
|
Exceptions
IADsException,
if the search fails.
public ADsSearchColumn GetColumn( ADsSearchResult result,
String columnName ) throws IADsException;
This method gets the contents of the column whose name is specified.
Return Value
Returns searchColumn, an ADsSearchColumn corresponding to the columnName.
| Parameter | Description |
| result, | the ADsSearchresult from a search operation.
|
| columnName, | a String with the name of the column.
|
Exceptions
IADsException,
thrown if the operation fails.
public void GetFirstRow(ADsSearchResult result)
throws IADsException;
This method returns the first entry of the search. After this call is made, subsequent rows maybe obtained using the the GetNextRow method.
| Parameter | Description |
| result, | the ADsSearchResult from execute search.
|
Exceptions
IADsException,
thrown if the operation fails.
public String GetNextColumnName(ADsSearchResult result)
throws IADsException;
This methods gets the name of the next column in the current row. This method is used when the user has called ExecuteSearch asking for all attributes and does not know the names of the attributes.
Return Value
Returns columnName, a string with the name of the column.
| Parameter | Description |
| result, | the ADsSearchResult from a search operation.
|
Exceptions
IADsException,
thrown if the operation fails.
public void GetNextRow(ADsSearchResult result)
throws IADsException;
This methods advances the searchResult to the next entry in the result obtained by executing a search. Once this call has been made the columns with the information may be retrieved using the methods associated with columns. Note that you do not need to call GetFirstRow before calling GetNextRow.
| Parameter | Description |
| result, | the ADsSearchResult from an ExecuteSearch operation.
|
Exceptions
IADsException
if the operation failed.
public void SetSearchPreference(
ADsSearchPrefInfo preferences[]) throws IADsException;
Sets the search preferences to be used. easier to do error checking.
| Parameter | Description |
| preferences, | an array of search preference info.
|
Exceptions
IADsException,
if the operation failed.
Fields
- ADS_DEREF_ALWAYS
-
- ADS_DEREF_FINDING
-
- ADS_DEREF_NEVER
- Constants specifying options for referalls.
- ADS_DEREF_SEARCHING
-
- ADS_SCOPE_BASE
- Constants used to specify the scope of the search
- ADS_SCOPE_ONELEVEL
-
- ADS_SCOPE_SUBTREE
-
- ADS_SEARCHPREF_ASYNCHRONOUS
- Constants used to specify other preferences
- ADS_SEARCHPREF_ATTRIBUTES_ONLY
-
- ADS_SEARCHPREF_DEREF_ALIASES
-
- ADS_SEARCHPREF_PAGESIZE
-
- ADS_SEARCHPREF_SEARCH_SCOPE
-
- ADS_SEARCHPREF_SIZE_LIMIT
-
- ADS_SEARCHPREF_TIME_LIMIT
-
- ADS_SEARCHPREF_TIMEOUT
-
- ADS_STATUS_INVALID_SEARCHPREF
-
- ADS_STATUS_INVALID_SEARCHPREFVALUE
-
- ADS_STATUS_OK
-
- ADS_STATUS_UNKNOWN
- Constants defining status information
- ADSTYPE_BOOLEAN
-
- ADSTYPE_INTEGER
-
- ADSTYPE_LARGE_INTEGER
-
- ADSTYPE_OCTET_STRING
-
- ADSTYPE_PRINTABLE_STRING
- Constants defining type specifications
- ADSTYPE_UTC_TIME
-