| | |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.core; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | |
| | | import org.opends.server.api.ServerShutdownListener; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.DisconnectReason; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.messages.CoreMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import org.opends.server.loggers.ErrorLogger; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | int disconnectMessageID = MSGID_IDLETIME_LIMIT_EXCEEDED; |
| | | String disconnectMessage = getMessage(disconnectMessageID); |
| | | Message disconnectMessage = INFO_IDLETIME_LIMIT_EXCEEDED.get(); |
| | | |
| | | long sleepTime = 5000L; |
| | | |
| | |
| | | try |
| | | { |
| | | c.disconnect(DisconnectReason.IDLE_TIME_LIMIT_EXCEEDED, |
| | | true, disconnectMessage, disconnectMessageID); |
| | | true, disconnectMessage); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_IDLETIME_DISCONNECT_ERROR; |
| | | String message = getMessage(msgID, c.getConnectionID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(ErrorLogCategory.CORE_SERVER, |
| | | ErrorLogSeverity.MILD_ERROR, message, msgID); |
| | | Message message = ERR_IDLETIME_DISCONNECT_ERROR.get( |
| | | c.getConnectionID(), |
| | | stackTraceToSingleLineString(e) |
| | | ); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | } |
| | | else |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_IDLETIME_UNEXPECTED_ERROR; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | | logError(ErrorLogCategory.CORE_SERVER, ErrorLogSeverity.SEVERE_ERROR, |
| | | message, msgID); |
| | | Message message = |
| | | ERR_IDLETIME_UNEXPECTED_ERROR.get(stackTraceToSingleLineString(e)); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void processServerShutdown(String reason) |
| | | public void processServerShutdown(Message reason) |
| | | { |
| | | shutdownRequested = true; |
| | | } |