| | |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | |
| | | |
| | | // The current configuration state. |
| | | /** The current configuration state. */ |
| | | private PasswordModifyExtendedOperationHandlerCfg currentConfig; |
| | | |
| | | // The DN of the identity mapper. |
| | | /** The DN of the identity mapper. */ |
| | | private DN identityMapperDN; |
| | | |
| | | // The reference to the identity mapper. |
| | | /** The reference to the identity mapper. */ |
| | | private IdentityMapper<?> identityMapper; |
| | | |
| | | // The default set of supported control OIDs for this extended |
| | | /** The default set of supported control OIDs for this extended */ |
| | | private Set<String> supportedControlOIDs = new HashSet<String>(0); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Create an instance of this password modify extended operation. All |
| | | * initialization should be performed in the |
| | |
| | | public PasswordModifyExtendedOperation() |
| | | { |
| | | super(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Initializes this extended operation handler based on the information in the |
| | | * provided configuration. It should also register itself with the |
| | |
| | | { |
| | | // Remove all existing encoded values that match the old password. |
| | | Set<AttributeValue> existingValues = pwPolicyState.getPasswordValues(); |
| | | LinkedHashSet<AttributeValue> deleteValues = |
| | | Set<AttributeValue> deleteValues = |
| | | new LinkedHashSet<AttributeValue>(existingValues.size()); |
| | | if (pwPolicyState.getAuthenticationPolicy().isAuthPasswordSyntax()) |
| | | { |
| | |
| | | if (userEntry == null) |
| | | { |
| | | operation.setResultCode(ResultCode.NO_SUCH_OBJECT); |
| | | |
| | | 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(); |
| | | while (parentDN != null) |
| | | { |
| | | try |
| | | { |
| | | if (DirectoryServer.entryExists(parentDN)) |
| | | { |
| | | operation.setMatchedDN(parentDN); |
| | | break; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | parentDN = parentDN.getParentDNInSuffix(); |
| | | } |
| | | |
| | | findAndSetMatchingDN(operation, entryDN); |
| | | return null; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void findAndSetMatchingDN(Operation operation, DN entryDN) |
| | | { |
| | | try |
| | | { |
| | | DN matchedDN = entryDN.getParentDNInSuffix(); |
| | | while (matchedDN != null) |
| | | { |
| | | if (DirectoryServer.entryExists(matchedDN)) |
| | | { |
| | | operation.setMatchedDN(matchedDN); |
| | | return; |
| | | } |
| | | |
| | | matchedDN = matchedDN.getParentDNInSuffix(); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | |
| | | { |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<Message> messages = new ArrayList<Message>(); |
| | | List<Message> messages = new ArrayList<Message>(); |
| | | |
| | | |
| | | // Make sure that the specified identity mapper is OK. |