LDIFSearch.java revision d20053afa42700e3ec7a6f6fb474622e8680f4cc
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CDDL HEADER START
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence * The contents of this file are subject to the terms of the
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence * Common Development and Distribution License, Version 1.0 only
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence * (the "License"). You may not use this file except in compliance
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * with the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * You can obtain a copy of the license at
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * trunk/opends/resource/legal-notices/OpenDS.LICENSE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * See the License for the specific language governing permissions
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * and limitations under the License.
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence * When distributing Covered Code, include this CDDL HEADER in each
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence * file and include the License file at
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence * add the following below this CDDL HEADER, with the fields enclosed
866d106459313499d0ca7bfccb4b2d23d5e4377cDavid Lawrence * by brackets "[]" replaced with your own identifying information:
7c74e180c206e6ed99e8beb820da5f399d845c3eDavid Lawrence * Portions Copyright [yyyy] [name of copyright owner]
ea31416b4fcdf23732355a8002f93f29e3b3d2dbAndreas Gustafsson * CDDL HEADER END
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley * Portions Copyright 2006-2007 Sun Microsystems, Inc.
ccdac53c027e8964753b36c4d8c7b0e98af501c2Michael Graffimport org.opends.server.extensions.ConfigFileHandler;
3d776d762914d1b675b4fd49728ce353ccf6f77eBrian Wellingtonimport org.opends.server.protocols.ldap.LDAPResultCode;
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid Lawrenceimport org.opends.server.types.ExistingFileBehavior;
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid Lawrenceimport org.opends.server.types.LDIFExportConfig;
75a4dd0d377dca2f85cea44e28bf110314c1fe8cDavid Lawrenceimport org.opends.server.types.LDIFImportConfig;
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafssonimport org.opends.server.types.ObjectClass;
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafssonimport org.opends.server.types.SearchFilter;
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafssonimport org.opends.server.types.SearchScope;
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafssonimport org.opends.server.util.LDIFException;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.ArgumentException;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.ArgumentParser;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.BooleanArgument;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.FileBasedArgument;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.IntegerArgument;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.MultiChoiceArgument;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport org.opends.server.util.args.StringArgument;
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrenceimport static org.opends.server.messages.MessageHandler.*;
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halleyimport static org.opends.server.messages.ToolMessages.*;
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halleyimport static org.opends.server.util.StaticUtils.*;
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * This class provides a program that may be used to search LDIF files. It is
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * modeled after the LDAPSearch tool, with the primary differencing being that
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * all of its data comes from LDIF rather than communicating over LDAP.
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * However, it does have a number of differences that allow it to perform
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * multiple operations in a single pass rather than requiring multiple passes
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * through the LDIF.
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley * The fully-qualified name of this class.
8e06cea14c857429ab7e7299af2dce5eeeaa5ff0Michael Graff private static final String CLASS_NAME = "org.opends.server.tools.LDIFSearch";
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson * The search scope string that will be used for baseObject searches.
3ecf3394e37dc2848a09ffc643565d454e9e6974Andreas Gustafsson private static final String SCOPE_STRING_BASE = "base";
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * The search scope string that will be used for singleLevel searches.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence private static final String SCOPE_STRING_ONE = "one";
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * The search scope string that will be used for wholeSubtree searches.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence private static final String SCOPE_STRING_SUB = "sub";
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * The search scope string that will be used for subordinateSubtree searches.
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence private static final String SCOPE_STRING_SUBORDINATE = "subordinate";
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence * Provides the command line arguments to the <CODE>mainSearch</CODE> method
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence * so that they can be processed.
ae4cbb69eef32ced103fe4561e8d2031ee4c3497David Lawrence * @param args The command line arguments provided to this program.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * Parses the provided command line arguments and performs the appropriate
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence * search operation.
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence * @param args The command line arguments provided to this program.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * @return The return code for this operation. A value of zero indicates
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * that all processing completed successfully. A nonzero value
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence * indicates that some problem occurred during processing.
0293ad13207aa29bd5844cdc87d085ffc009d749David Lawrence LinkedHashSet<String> scopeStrings = new LinkedHashSet<String>(4);
1ce985ab3c6670662d555c108b35fed84a6a1001David Lawrence String toolDescription = getMessage(MSGID_LDIFSEARCH_TOOL_DESCRIPTION);
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence "[filter] [attributes ...]");
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence ldifFile = new StringArgument("ldiffile", 'l', "ldifFile", false, true,
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence baseDNString = new StringArgument("basedn", 'b', "baseDN", false, true,
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence scopeString = new MultiChoiceArgument("scope", 's', "scope", false, false,
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff configFile = new StringArgument("configfile", 'c', "configFile", false,
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff configClass = new StringArgument("configclass", 'C', "configClass", false,
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff false, true, "{configClass}",
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrews filterFile = new FileBasedArgument("filterfile", 'f', "filterFile", false,
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrews outputFile = new StringArgument("outputfile", 'o', "outputFile", false,
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews new BooleanArgument("overwriteexisting", 'O',"overwriteExisting",
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews MSGID_LDIFSEARCH_DESCRIPTION_OVERWRITE_EXISTING);
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews dontWrap = new BooleanArgument("dontwrap", 'T', "dontWrap",
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews sizeLimit = new IntegerArgument("sizelimit", 'z', "sizeLimit", false,
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews timeLimit = new IntegerArgument("timelimit", 't', "timeLimit", false,
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews showUsage = new BooleanArgument("help", 'H', "help",
6342df69b05f2f62d060fd4affdf536e51504084Mark Andrews int msgID = MSGID_LDIFSEARCH_CANNOT_INITIALIZE_ARGS;
6342df69b05f2f62d060fd4affdf536e51504084Mark Andrews String message = getMessage(msgID, ae.getMessage());
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson // Parse the command-line arguments provided to the program.
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington int msgID = MSGID_LDIFSEARCH_ERROR_PARSING_ARGS;
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington String message = getMessage(msgID, ae.getMessage());
47fd46791da765e3dbedd987e9b263b3bee25986Brian Wellington return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
6fcb2f0faad67a6d2cb2e30ec57157d75fbfe58fAndreas Gustafsson // If we should just display usage information, then print it and exit.
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews // Make sure that at least one filter was provided. Also get the attribute
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews // list at the same time because it may need to be specified in the same
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews boolean allUserAttrs = false;
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews boolean allOperationalAttrs = false;
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews LinkedList<String> attributeNames = new LinkedList<String>();
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews LinkedList<String> objectClassNames = new LinkedList<String>();
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews ArrayList<String> trailingArguments = argParser.getTrailingArguments();
43fe2897fc80bbec2115310ca79d432a252f3ea4Mark Andrews if ((trailingArguments == null) || trailingArguments.isEmpty())
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews ArrayList<String> trailingArguments = argParser.getTrailingArguments();
40dd9cb8cc240c33d820fe79f176ed51e4c06a1aMark Andrews if ((trailingArguments == null) || trailingArguments.isEmpty())
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson Iterator<String> iterator = trailingArguments.iterator();
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson filterStrings = new LinkedList<String>();
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson attributeNames = new LinkedList<String>();
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson String lowerName = toLowerCase(iterator.next());
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson objectClassNames.add(lowerName.substring(1));
5ff133b82082d82f0ba89b7c999c6b62b6298e46Andreas Gustafsson if (attributeNames.isEmpty() && objectClassNames.isEmpty() &&
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff // This will be true if no attributes were requested, which is effectively
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff // all user attributes. It will also be true if just "*" was included,
90407942d3afe50f04ccea361de3b164a5a1702dMichael Graff // but the net result will be the same.
13faa8b6a2d0d45e0659049983928366252ab3faMichael Graff // Bootstrap the Directory Server configuration for use as a client.
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson DirectoryServer directoryServer = DirectoryServer.getInstance();
3d8dfd44a3be708f00380064411c16b2fa28303aMark Andrews // If we're to use the configuration then initialize it, along with the
a53259c4cc558f86dd008eccc60cc89b6734a03cMark Andrews int msgID = MSGID_LDIFSEARCH_CANNOT_INITIALIZE_JMX;
a53259c4cc558f86dd008eccc60cc89b6734a03cMark Andrews directoryServer.initializeConfiguration(configClass.getValue(),
a53259c4cc558f86dd008eccc60cc89b6734a03cMark Andrews int msgID = MSGID_LDIFSEARCH_CANNOT_INITIALIZE_CONFIG;
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson int msgID = MSGID_LDIFSEARCH_CANNOT_INITIALIZE_SCHEMA;
c5826852e6c789f59b301f8197e65a1dd4e09a44Mark Andrews // Choose the desired search scope.
c5826852e6c789f59b301f8197e65a1dd4e09a44Mark Andrews String scopeStr = toLowerCase(scopeString.getValue());
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson else if (scopeStr.equals(SCOPE_STRING_SUBORDINATE))
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson searchScope = SearchScope.SUBORDINATE_SUBTREE;
2995f8205eaa0d4bc3a57900a413b5cfdb83564fAndreas Gustafsson // Create the list of filters that will be used to process the searches.
2995f8205eaa0d4bc3a57900a413b5cfdb83564fAndreas Gustafsson LinkedList<SearchFilter> searchFilters = new LinkedList<SearchFilter>();
bc53aacc6e9302b1f8d01467fc39585584652782Andreas Gustafsson for (String filterString : filterStrings)
d73de275987d29627dc11d5bd4a22874a29f7874Mark Andrews searchFilters.add(SearchFilter.createFilterFromString(filterString));
d73de275987d29627dc11d5bd4a22874a29f7874Mark Andrews int msgID = MSGID_LDIFSEARCH_CANNOT_PARSE_FILTER;
d73de275987d29627dc11d5bd4a22874a29f7874Mark Andrews String message = getMessage(msgID, filterString, e.getMessage());
d73de275987d29627dc11d5bd4a22874a29f7874Mark Andrews // Transform the attributes to return from strings to attribute types.
d73de275987d29627dc11d5bd4a22874a29f7874Mark Andrews LinkedHashSet<AttributeType> userAttributeTypes =
d73de275987d29627dc11d5bd4a22874a29f7874Mark Andrews LinkedHashSet<AttributeType> operationalAttributeTypes =
7f32428506d55083fe5ac9aa515294bdef7c6e27Mark Andrews AttributeType t = DirectoryServer.getAttributeType(attributeName, true);
bd1db480f30e025bba719799f910b34848a9a997Mark Andrews for (String objectClassName : objectClassNames)
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson ObjectClass c = DirectoryServer.getObjectClass(objectClassName, true);
5989aea4bbe79e09290792f04aeb557e2b2da02eAndreas Gustafsson for (AttributeType t : c.getRequiredAttributeChain())
7f32428506d55083fe5ac9aa515294bdef7c6e27Mark Andrews for (AttributeType t : c.getOptionalAttributeChain())
7f32428506d55083fe5ac9aa515294bdef7c6e27Mark Andrews // Set the base DNs for the import config.
c0707105f60934d59321c2fccbc254f9e31ff28aMark Andrews for (String dnString : baseDNString.getValues())
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington int msgID = MSGID_LDIFSEARCH_CANNOT_PARSE_BASE_DN;
5f9e583552f53de12062bfff12e47250abce378fBrian Wellington String message = getMessage(msgID, dnString, e.getMessage());
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington // Get the time limit in milliseconds.
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington timeLimitMillis = 1000L * timeLimit.getIntValue();
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington int msgID = MSGID_LDIFSEARCH_CANNOT_PARSE_TIME_LIMIT;
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington String message = getMessage(msgID, String.valueOf(e));
fee5012c43744322c1785e5c3e0c322443faa304Brian Wellington // Convert the size limit to an integer.
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington int msgID = MSGID_LDIFSEARCH_CANNOT_PARSE_SIZE_LIMIT;
3ec6b563d7b6cb11a047f23faa2a0f206ccd93e7Brian Wellington String message = getMessage(msgID, String.valueOf(e));
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington // Create the LDIF import configuration that will be used to read the source
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington importConfig = new LDIFImportConfig(ldifFile.getValues());
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington importConfig = new LDIFImportConfig(System.in);
b495fd2992c63472b3ad2d9517ffe9b50118840aAndreas Gustafsson // Create the LDIF export configuration that will be used to write the
af5ad488cbf17988fbd36a25c908737412ccd382Brian Wellington // matching entries.
a14613fce99dee3cad5bf842fd6be78f8e463582Brian Wellington exportConfig = new LDIFExportConfig(outputFile.getName(),
529ff4b4959fb157194f985394951108ff5286e4Brian Wellington exportConfig = new LDIFExportConfig(outputFile.getName(),
5b76a09697bfc76f5acefd65d5b37b1214d271a8Mark Andrews exportConfig = new LDIFExportConfig(System.out);
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson // Create the LDIF reader/writer from the import/export config.
3184ff5e45c8f821e5165ea60d674bfb87faf5b8Mark Andrews int msgID = MSGID_LDIFSEARCH_CANNOT_CREATE_READER;
3184ff5e45c8f821e5165ea60d674bfb87faf5b8Mark Andrews String message = getMessage(msgID, String.valueOf(e));
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson int msgID = MSGID_LDIFSEARCH_CANNOT_CREATE_WRITER;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson String message = getMessage(msgID, String.valueOf(e));
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson // Start reading data from the LDIF reader.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson long startTime = System.currentTimeMillis();
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson long stopTime = startTime + timeLimitMillis;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson // If the time limit has been reached, then stop now.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson if ((timeLimitMillis > 0) && (System.currentTimeMillis() > stopTime))
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson resultCode = LDAPResultCode.TIME_LIMIT_EXCEEDED;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson int msgID = MSGID_LDIFSEARCH_TIME_LIMIT_EXCEEDED;
3fafd7c0c42134ff2964b74a31500465a96dee90Andreas Gustafsson Entry entry = reader.readEntry(checkSchema);
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson // Check to see if the entry has an acceptable base and scope.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson if (entry.matchesBaseAndScope(baseDN, searchScope))
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson // Check to see if the entry matches any of the filters.
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson boolean matchesFilter = false;
a1884b96ef53efc8b4e14be173aaee552ca0213aAndreas Gustafsson for (SearchFilter filter : searchFilters)
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews // Prepare the entry to return to the client.
712bf9b0cc4ed34f4bf33b437f8b0e45853b93ceMark Andrews if (! userAttributeTypes.contains(iterator.next()))
9ceaa92a8ca8a0270ba296d44599e94d95033759Andreas Gustafsson entry.getOperationalAttributes().keySet().iterator();
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence if (! operationalAttributeTypes.contains(iterator.next()))
23ac30603a7639bea1d331537634b079b046b122Mark Andrews // Write the entry to the client and increase the count.
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington // FIXME -- Should we include a comment about which base+filter matched?
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington if ((sizeLimitValue > 0) && (matchCount > sizeLimitValue))
3f123dcc2fe5d2cd08ca91b732741d86a4036906Brian Wellington resultCode = LDAPResultCode.SIZE_LIMIT_EXCEEDED;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence int msgID = MSGID_LDIFSEARCH_SIZE_LIMIT_EXCEEDED;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence int msgID = MSGID_LDIFSEARCH_CANNOT_READ_ENTRY_RECOVERABLE;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence String message = getMessage(msgID, le.getMessage());
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halley int msgID = MSGID_LDIFSEARCH_CANNOT_READ_ENTRY_FATAL;
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halley String message = getMessage(msgID, le.getMessage());
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halley resultCode = LDAPResultCode.CLIENT_SIDE_LOCAL_ERROR;
03f4c76f95f75e2b0d1206e784e35bed6041305cBob Halley int msgID = MSGID_LDIFSEARCH_ERROR_DURING_PROCESSING;
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence String message = getMessage(msgID, String.valueOf(e));
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence resultCode = LDAPResultCode.CLIENT_SIDE_LOCAL_ERROR;
53f1312c61fa8618852584bcdf9f35530282eb08Mark Andrews // Close the reader and writer.
3ea6d4dc33482a752553c59ed94bcecd23d254b0Mark Andrews } catch (Exception e) {}
9a2574531e3d2ced31072200b416467fdee0c29cDavid Lawrence } catch (Exception e) {}