| | |
| | | import org.opends.server.util.args.IntegerArgument; |
| | | import org.opends.server.util.args.StringArgument; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | |
| | | import org.opends.server.controls.SubtreeDeleteControl; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.protocols.ldap.LDAPResultCode.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | */ |
| | | public class LDAPDelete |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * The fully-qualified name of this class. |
| | |
| | | responseMessage = connection.getLDAPReader().readMessage(); |
| | | } catch(ASN1Exception ae) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ae); |
| | | } |
| | | logger.traceException(ae); |
| | | if (!deleteOptions.continueOnError()) |
| | | { |
| | | String msg = LDAPToolUtils.getMessageForConnectionException(ae); |
| | |
| | | portNumber = port.getIntValue(); |
| | | } catch(ArgumentException ae) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ae); |
| | | } |
| | | logger.traceException(ae); |
| | | err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); |
| | | return CLIENT_SIDE_PARAM_ERROR; |
| | | } |
| | |
| | | connectionOptions.setVersionNumber(versionNumber); |
| | | } catch(ArgumentException ae) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ae); |
| | | } |
| | | logger.traceException(ae); |
| | | err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); |
| | | return CLIENT_SIDE_PARAM_ERROR; |
| | | } |
| | |
| | | bindPasswordValue = new String(pwChars); |
| | | } catch(Exception ex) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ex); |
| | | } |
| | | logger.traceException(ex); |
| | | err.println(wrapText(ex.getMessage(), MAX_LINE_WIDTH)); |
| | | return CLIENT_SIDE_PARAM_ERROR; |
| | | } |
| | |
| | | } |
| | | } catch(LDAPException le) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, le); |
| | | } |
| | | logger.traceException(le); |
| | | LDAPToolUtils.printErrorMessage(err, le.getMessageObject(), |
| | | le.getResultCode(), |
| | | le.getErrorMessage(), |
| | |
| | | return code; |
| | | } catch(LDAPConnectionException lce) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, lce); |
| | | } |
| | | logger.traceException(lce); |
| | | LDAPToolUtils.printErrorMessage(err, lce.getMessageObject(), |
| | | lce.getResultCode(), |
| | | lce.getErrorMessage(), |
| | |
| | | return code; |
| | | } catch(Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } finally |