| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCought; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.Error.*; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | |
| | | public class StartTLSExtendedOperation |
| | | extends ExtendedOperationHandler |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.extensions.StartTLSExtendedOperation"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(); |
| | | |
| | | assert debugConstructor(CLASS_NAME); |
| | | } |
| | | |
| | | |
| | |
| | | public void initializeExtendedOperationHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "initializeExtendedOperationHandler", |
| | | String.valueOf(configEntry)); |
| | | |
| | | // FIXME -- Are there any configurable options that we should support? |
| | | DirectoryServer.registerSupportedExtension(OID_START_TLS_REQUEST, this); |
| | |
| | | */ |
| | | public void finalizeExtendedOperationHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeExtendedOperationHandler"); |
| | | |
| | | DirectoryServer.deregisterSupportedExtension(OID_START_TLS_REQUEST); |
| | | } |
| | |
| | | */ |
| | | public void processExtendedOperation(ExtendedOperation operation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processExtendedOperation", |
| | | String.valueOf(operation)); |
| | | |
| | | |
| | | // We should always include the StartTLS OID in the response (the same OID |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | assert debugException(CLASS_NAME, "processExtendedOperation", de); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | logError(ErrorLogCategory.CORE_SERVER, ErrorLogSeverity.MILD_ERROR, |
| | | MSGID_STARTTLS_ERROR_ON_ENABLE, |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "processExtendedOperation", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | logError(ErrorLogCategory.CORE_SERVER, ErrorLogSeverity.MILD_ERROR, |
| | | MSGID_STARTTLS_ERROR_SENDING_CLEAR_RESPONSE, |