| | |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.LockManager; |
| | | import org.opends.server.types.Modification; |
| | |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.extensions.ExtensionsConstants.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.messages.ExtensionsMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import org.opends.server.loggers.ErrorLogger; |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | |
| | | import org.opends.messages.MessageBuilder; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | |
| | | identityMapper = DirectoryServer.getIdentityMapper(identityMapperDN); |
| | | if (identityMapper == null) |
| | | { |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_SUCH_ID_MAPPER; |
| | | String message = getMessage(msgID, String.valueOf(identityMapperDN), |
| | | String.valueOf(config.dn())); |
| | | throw new ConfigException(msgID, message); |
| | | Message message = ERR_EXTOP_PASSMOD_NO_SUCH_ID_MAPPER.get( |
| | | String.valueOf(identityMapperDN), String.valueOf(config.dn())); |
| | | throw new ConfigException(message); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_DETERMINE_ID_MAPPER; |
| | | String message = getMessage(msgID, String.valueOf(config.dn()), |
| | | getExceptionMessage(e)); |
| | | throw new InitializationException(msgID, message, e); |
| | | Message message = ERR_EXTOP_PASSMOD_CANNOT_DETERMINE_ID_MAPPER.get( |
| | | String.valueOf(config.dn()), getExceptionMessage(e)); |
| | | throw new InitializationException(message, e); |
| | | } |
| | | |
| | | |
| | |
| | | default: |
| | | operation.setResultCode(ResultCode.PROTOCOL_ERROR); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_ILLEGAL_REQUEST_ELEMENT_TYPE; |
| | | operation.appendErrorMessage(getMessage(msgID, |
| | | byteToHex(e.getType()))); |
| | | |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_ILLEGAL_REQUEST_ELEMENT_TYPE.get( |
| | | byteToHex(e.getType()))); |
| | | return; |
| | | } |
| | | } |
| | |
| | | |
| | | operation.setResultCode(ResultCode.PROTOCOL_ERROR); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST; |
| | | String message = getMessage(msgID, getExceptionMessage(ae)); |
| | | Message message = ERR_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST.get( |
| | | getExceptionMessage(ae)); |
| | | operation.appendErrorMessage(message); |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_AUTH_OR_USERID; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_NO_AUTH_OR_USERID.get()); |
| | | |
| | | return; |
| | | } |
| | |
| | | { |
| | | operation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_LOCK_USER_ENTRY; |
| | | String message = getMessage(msgID, String.valueOf(userDN)); |
| | | Message message = |
| | | ERR_EXTOP_PASSMOD_CANNOT_LOCK_USER_ENTRY.get( |
| | | String.valueOf(userDN)); |
| | | operation.appendErrorMessage(message); |
| | | |
| | | return; |
| | |
| | | |
| | | operation.setResultCode(ResultCode.INVALID_DN_SYNTAX); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_DECODE_AUTHZ_DN; |
| | | operation.appendErrorMessage(getMessage(msgID, authzIDStr)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_DECODE_AUTHZ_DN.get(authzIDStr)); |
| | | |
| | | return; |
| | | } |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_MAP_USER; |
| | | operation.appendErrorMessage(getMessage(msgID, authzIDStr)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_MAP_USER.get(authzIDStr)); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_MAP_USER; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID, |
| | | authzIDStr)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_MAP_USER.get(authzIDStr)); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(de.getResultCode()); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_ERROR_MAPPING_USER; |
| | | operation.appendErrorMessage(getMessage(msgID, authzIDStr, |
| | | de.getErrorMessage())); |
| | | operation.appendErrorMessage(ERR_EXTOP_PASSMOD_ERROR_MAPPING_USER |
| | | .get(authzIDStr,de.getMessageObject())); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_ERROR_MAPPING_USER; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID, authzIDStr, |
| | | de.getErrorMessage())); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_ERROR_MAPPING_USER.get( |
| | | authzIDStr, |
| | | de.getMessageObject())); |
| | | } |
| | | |
| | | return; |
| | |
| | | // The authorization ID was in an illegal format. |
| | | operation.setResultCode(ResultCode.PROTOCOL_ERROR); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_INVALID_AUTHZID_STRING; |
| | | operation.appendErrorMessage(getMessage(msgID, authzIDStr)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_INVALID_AUTHZID_STRING.get(authzIDStr)); |
| | | |
| | | return; |
| | | } |
| | |
| | | |
| | | operation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_GET_PW_POLICY; |
| | | operation.appendErrorMessage(getMessage(msgID, String.valueOf(userDN), |
| | | de.getErrorMessage())); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_GET_PW_POLICY.get( |
| | | String.valueOf(userDN), |
| | | de.getMessageObject())); |
| | | return; |
| | | } |
| | | |
| | |
| | | if (! clientConnection.hasPrivilege(Privilege.PASSWORD_RESET, |
| | | operation)) |
| | | { |
| | | int msgID = MSGID_EXTOP_PASSMOD_INSUFFICIENT_PRIVILEGES; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_INSUFFICIENT_PRIVILEGES.get()); |
| | | operation.setResultCode(ResultCode.INSUFFICIENT_ACCESS_RIGHTS); |
| | | return; |
| | | } |
| | |
| | | pwPolicyErrorType)); |
| | | } |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_ACCOUNT_DISABLED; |
| | | String message = getMessage(msgID); |
| | | Message message = ERR_EXTOP_PASSMOD_ACCOUNT_DISABLED.get(); |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | |
| | | pwPolicyErrorType)); |
| | | } |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_ACCOUNT_LOCKED; |
| | | String message = getMessage(msgID); |
| | | Message message = ERR_EXTOP_PASSMOD_ACCOUNT_LOCKED.get(); |
| | | |
| | | if (oldPassword == null) |
| | | { |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_REQUIRE_CURRENT_PW; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_REQUIRE_CURRENT_PW.get()); |
| | | |
| | | if (pwPolicyRequested) |
| | | { |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_SECURE_AUTH_REQUIRED; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_AUTH_REQUIRED.get()); |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_INVALID_OLD_PASSWORD; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_INVALID_OLD_PASSWORD.get()); |
| | | |
| | | pwPolicyState.updateAuthFailureTimes(); |
| | | List<Modification> mods = pwPolicyState.getModifications(); |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_USER_PW_CHANGES_NOT_ALLOWED.get()); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_SECURE_CHANGES_REQUIRED.get()); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_IN_MIN_AGE; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage(ERR_EXTOP_PASSMOD_IN_MIN_AGE.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_IN_MIN_AGE; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_IN_MIN_AGE.get()); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_PASSWORD_IS_EXPIRED.get()); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_PW_GENERATOR; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_NO_PW_GENERATOR.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_PW_GENERATOR; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_NO_PW_GENERATOR.get()); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(de.getResultCode()); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_GENERATE_PW; |
| | | operation.appendErrorMessage(getMessage(msgID, |
| | | de.getErrorMessage())); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_GENERATE_PW.get( |
| | | de.getMessageObject())); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_GENERATE_PW; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID, |
| | | de.getErrorMessage())); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_GENERATE_PW.get( |
| | | de.getMessageObject())); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_PRE_ENCODED_NOT_ALLOWED.get()); |
| | | } |
| | | |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | StringBuilder invalidReason = new StringBuilder(); |
| | | MessageBuilder invalidReason = new MessageBuilder(); |
| | | if (! pwPolicyState.passwordIsAcceptable(operation, userEntry, |
| | | newPassword, |
| | | clearPasswords, |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_UNACCEPTABLE_PW; |
| | | operation.appendErrorMessage(getMessage(msgID, |
| | | String.valueOf(invalidReason))); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_UNACCEPTABLE_PW.get( |
| | | String.valueOf(invalidReason))); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_UNACCEPTABLE_PW; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID, |
| | | String.valueOf(invalidReason))); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_UNACCEPTABLE_PW.get( |
| | | String.valueOf(invalidReason))); |
| | | } |
| | | |
| | | return; |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_PW_IN_HISTORY; |
| | | operation.appendErrorMessage(getMessage(msgID)); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_PW_IN_HISTORY.get()); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_PW_IN_HISTORY; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID)); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_PW_IN_HISTORY.get()); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | operation.setResultCode(de.getResultCode()); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD; |
| | | operation.appendErrorMessage(getMessage(msgID, |
| | | de.getErrorMessage())); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD.get( |
| | | de.getMessageObject())); |
| | | } |
| | | else |
| | | { |
| | | operation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD; |
| | | operation.appendAdditionalLogMessage(getMessage(msgID, |
| | | de.getErrorMessage())); |
| | | operation.appendAdditionalLogMessage( |
| | | ERR_EXTOP_PASSMOD_CANNOT_ENCODE_PASSWORD.get( |
| | | de.getMessageObject())); |
| | | } |
| | | |
| | | return; |
| | |
| | | // appropriate response. Otherwise, process the operation. |
| | | if (noOpRequested) |
| | | { |
| | | operation.appendErrorMessage(getMessage(MSGID_EXTOP_PASSMOD_NOOP)); |
| | | operation.appendErrorMessage(WARN_EXTOP_PASSMOD_NOOP.get()); |
| | | |
| | | operation.setResultCode(ResultCode.NO_OPERATION); |
| | | } |
| | |
| | | // At this point, the user's password is already changed so there's |
| | | // not much point in returning a non-success result. However, we |
| | | // should at least log that something went wrong. |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_UPDATE_PWP_STATE; |
| | | String message = getMessage(msgID, String.valueOf(userDN), |
| | | modOp.getResultCode(), |
| | | modOp.getErrorMessage()); |
| | | logError(ErrorLogCategory.PASSWORD_POLICY, |
| | | ErrorLogSeverity.SEVERE_WARNING, message, msgID); |
| | | Message message = WARN_EXTOP_PASSMOD_CANNOT_UPDATE_PWP_STATE.get( |
| | | String.valueOf(userDN), |
| | | String.valueOf(modOp.getResultCode()), |
| | | modOp.getErrorMessage()); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | operation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_USER_ENTRY_BY_AUTHZID; |
| | | operation.appendErrorMessage(getMessage(msgID, |
| | | String.valueOf(entryDN))); |
| | | operation.appendErrorMessage( |
| | | ERR_EXTOP_PASSMOD_NO_USER_ENTRY_BY_AUTHZID.get( |
| | | String.valueOf(entryDN))); |
| | | |
| | | // See if one of the entry's ancestors exists. |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | |
| | | } |
| | | |
| | | operation.setResultCode(de.getResultCode()); |
| | | operation.appendErrorMessage(de.getErrorMessage()); |
| | | operation.appendErrorMessage(de.getMessageObject()); |
| | | operation.setMatchedDN(de.getMatchedDN()); |
| | | operation.setReferralURLs(de.getReferralURLs()); |
| | | |
| | |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(ExtendedOperationHandlerCfg |
| | | configuration, |
| | | List<String> unacceptableReasons) |
| | | List<Message> unacceptableReasons) |
| | | { |
| | | PasswordModifyExtendedOperationHandlerCfg config = |
| | | (PasswordModifyExtendedOperationHandlerCfg) configuration; |
| | |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordModifyExtendedOperationHandlerCfg config, |
| | | List<String> unacceptableReasons) |
| | | List<Message> unacceptableReasons) |
| | | { |
| | | // Make sure that the specified identity mapper is OK. |
| | | try |
| | |
| | | IdentityMapper mapper = DirectoryServer.getIdentityMapper(mapperDN); |
| | | if (mapper == null) |
| | | { |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_SUCH_ID_MAPPER; |
| | | String message = getMessage(msgID, String.valueOf(mapperDN), |
| | | String.valueOf(config.dn())); |
| | | Message message = ERR_EXTOP_PASSMOD_NO_SUCH_ID_MAPPER.get( |
| | | String.valueOf(mapperDN), |
| | | String.valueOf(config.dn())); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_DETERMINE_ID_MAPPER; |
| | | String message = getMessage(msgID, String.valueOf(config.dn()), |
| | | getExceptionMessage(e)); |
| | | Message message = ERR_EXTOP_PASSMOD_CANNOT_DETERMINE_ID_MAPPER.get( |
| | | String.valueOf(config.dn()), |
| | | getExceptionMessage(e)); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | |
| | | { |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | | ArrayList<Message> messages = new ArrayList<Message>(); |
| | | |
| | | |
| | | // Make sure that the specified identity mapper is OK. |
| | |
| | | { |
| | | resultCode = ResultCode.CONSTRAINT_VIOLATION; |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_NO_SUCH_ID_MAPPER; |
| | | messages.add(getMessage(msgID, String.valueOf(mapperDN), |
| | | String.valueOf(config.dn()))); |
| | | messages.add(ERR_EXTOP_PASSMOD_NO_SUCH_ID_MAPPER.get( |
| | | String.valueOf(mapperDN), |
| | | String.valueOf(config.dn()))); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | |
| | | resultCode = DirectoryServer.getServerErrorResultCode(); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_CANNOT_DETERMINE_ID_MAPPER; |
| | | messages.add(getMessage(msgID, String.valueOf(config.dn()), |
| | | getExceptionMessage(e))); |
| | | messages.add(ERR_EXTOP_PASSMOD_CANNOT_DETERMINE_ID_MAPPER.get( |
| | | String.valueOf(config.dn()), |
| | | getExceptionMessage(e))); |
| | | } |
| | | |
| | | |