| | |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.ProtocolMessages.*; |
| | | import org.opends.server.loggers.ErrorLogger; |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | |
| | | import org.opends.server.types.DisconnectReason; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDAP_REQHANDLER_OPEN_SELECTOR_FAILED; |
| | | String message = getMessage(msgID, handlerName, String.valueOf(e)); |
| | | throw new InitializationException(msgID, message, e); |
| | | Message message = ERR_LDAP_REQHANDLER_OPEN_SELECTOR_FAILED.get( |
| | | handlerName, String.valueOf(e)); |
| | | throw new InitializationException(message, e); |
| | | } |
| | | |
| | | try |
| | |
| | | (ste.getMethodName().indexOf("poll") >= 0) && |
| | | ioe.getMessage().equalsIgnoreCase("Invalid argument")) |
| | | { |
| | | int msgID = MSGID_LDAP_REQHANDLER_DETECTED_JVM_ISSUE_CR6322825; |
| | | String message = getMessage(msgID, String.valueOf(ioe)); |
| | | throw new InitializationException(msgID, message, ioe); |
| | | Message message = ERR_LDAP_REQHANDLER_DETECTED_JVM_ISSUE_CR6322825. |
| | | get(String.valueOf(ioe)); |
| | | throw new InitializationException(message, ioe); |
| | | } |
| | | } |
| | | } |
| | |
| | | // FIXME -- Should we log this? |
| | | key.cancel(); |
| | | clientConnection.disconnect(DisconnectReason.SERVER_ERROR, |
| | | false, String.valueOf(e), -1); |
| | | false, null); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | if (clientConnection != null) |
| | | { |
| | | clientConnection.disconnect(DisconnectReason.SERVER_ERROR, |
| | | false, String.valueOf(e), -1); |
| | | false, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | // This should not happen, and it would have caused our reader |
| | | // thread to die. Log a severe error. |
| | | int msgID = MSGID_LDAP_REQHANDLER_UNEXPECTED_SELECT_EXCEPTION; |
| | | String message = getMessage(msgID, getName(), |
| | | getExceptionMessage(e)); |
| | | logError(ErrorLogCategory.REQUEST_HANDLING, |
| | | ErrorLogSeverity.SEVERE_ERROR, message, msgID); |
| | | Message message = ERR_LDAP_REQHANDLER_UNEXPECTED_SELECT_EXCEPTION. |
| | | get(getName(), getExceptionMessage(e)); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | finally |
| | | { |
| | |
| | | } |
| | | |
| | | c.disconnect(DisconnectReason.SERVER_ERROR, true, |
| | | MSGID_LDAP_REQHANDLER_CANNOT_REGISTER, handlerName, |
| | | String.valueOf(e)); |
| | | ERR_LDAP_REQHANDLER_CANNOT_REGISTER.get(handlerName, |
| | | String.valueOf(e))); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (shutdownRequested) |
| | | { |
| | | clientConnection.disconnect(DisconnectReason.SERVER_SHUTDOWN, true, |
| | | MSGID_LDAP_REQHANDLER_REJECT_DUE_TO_SHUTDOWN); |
| | | ERR_LDAP_REQHANDLER_REJECT_DUE_TO_SHUTDOWN.get()); |
| | | return false; |
| | | } |
| | | |
| | |
| | | else |
| | | { |
| | | clientConnection.disconnect(DisconnectReason.ADMIN_LIMIT_EXCEEDED, true, |
| | | MSGID_LDAP_REQHANDLER_REJECT_DUE_TO_QUEUE_FULL, handlerName); |
| | | ERR_LDAP_REQHANDLER_REJECT_DUE_TO_QUEUE_FULL.get(handlerName)); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param reason The human-readable reason for the shutdown. |
| | | */ |
| | | public void processServerShutdown(String reason) |
| | | public void processServerShutdown(Message reason) |
| | | { |
| | | shutdownRequested = true; |
| | | |
| | |
| | | try |
| | | { |
| | | c.disconnect(DisconnectReason.SERVER_SHUTDOWN, true, |
| | | MSGID_LDAP_REQHANDLER_DEREGISTER_DUE_TO_SHUTDOWN, |
| | | reason); |
| | | ERR_LDAP_REQHANDLER_DEREGISTER_DUE_TO_SHUTDOWN.get( |
| | | reason)); |
| | | } |
| | | catch (Exception e) |
| | | { |