public class LDAPSearch extends Object
| Constructor and Description |
|---|
LDAPSearch(AtomicInteger nextMessageID,
PrintStream out,
PrintStream err)
Constructor for the LDAPSearch object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
executeSearch(LDAPConnection connection,
String baseDN,
ArrayList<LDAPFilter> filters,
LinkedHashSet<String> attributes,
LDAPSearchOptions searchOptions,
int wrapColumn)
Execute the search based on the specified input parameters.
|
List<Control> |
getResponseControls()
Retrieves the set of response controls included in the last search result
done message.
|
static void |
main(String[] args)
The main method for LDAPSearch tool.
|
static int |
mainSearch(String[] args)
Parses the provided command-line arguments and uses that information to
run the ldapsearch tool.
|
static int |
mainSearch(String[] args,
boolean initializeServer,
boolean returnMatchingEntries,
OutputStream outStream,
OutputStream errStream)
Parses the provided command-line arguments and uses that information to
run the ldapsearch tool.
|
static int |
mainSearch(String[] args,
boolean initializeServer,
OutputStream outStream,
OutputStream errStream)
Parses the provided command-line arguments and uses that information to
run the ldapsearch tool.
|
void |
toLDIF(SearchResultEntryProtocolOp entry,
StringBuilder buffer,
int wrapColumn,
boolean typesOnly)
Appends an LDIF representation of the entry to the provided buffer.
|
public LDAPSearch(AtomicInteger nextMessageID, PrintStream out, PrintStream err)
nextMessageID - The message ID counter to use for requests.out - The print stream to use for standard output.err - The print stream to use for standard error.public int executeSearch(LDAPConnection connection, String baseDN, ArrayList<LDAPFilter> filters, LinkedHashSet<String> attributes, LDAPSearchOptions searchOptions, int wrapColumn) throws IOException, LDAPException
connection - The connection to use for the search.baseDN - The base DN for the search request.filters - The filters to use for the results.attributes - The attributes to return in the results.searchOptions - The constraints for the search.wrapColumn - The column at which to wrap long lines.IOException - If a problem occurs while attempting to communicate
with the Directory Server.LDAPException - If the Directory Server returns an error response.public void toLDIF(SearchResultEntryProtocolOp entry, StringBuilder buffer, int wrapColumn, boolean typesOnly)
entry - The entry to be written as LDIF.buffer - The buffer to which the entry should be appended.wrapColumn - The column at which long lines should be wrapped.typesOnly - Indicates whether to include only attribute types
without values.public List<Control> getResponseControls()
public static void main(String[] args)
args - The command-line arguments provided to this program.public static int mainSearch(String[] args)
args - The command-line arguments provided to this program.public static int mainSearch(String[] args, boolean initializeServer, OutputStream outStream, OutputStream errStream)
args - The command-line arguments provided to this
program.initializeServer - Indicates whether to initialize the server.outStream - The output stream to use for standard output, or
null if standard output is not
needed.errStream - The output stream to use for standard error, or
null if standard error is not
needed.public static int mainSearch(String[] args, boolean initializeServer, boolean returnMatchingEntries, OutputStream outStream, OutputStream errStream)
args - The command-line arguments provided to this
program.initializeServer - Indicates whether to initialize the server.returnMatchingEntries - whether when the option --countEntries is
specified, the number of matching entries should
be returned or not.outStream - The output stream to use for standard output, or
null if standard output is not
needed.errStream - The output stream to use for standard error, or
null if standard error is not
needed.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.