used the Dn normalized name for the pwdResetSet, in order to speed up teh retrieval of Dn in this set.
git-svn-id: https://svn.apache.org/repos/asf/directory/apacheds/branches/index-work@1332204 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java b/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
index 5bbe64a..ead1bbf 100644
--- a/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
+++ b/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
@@ -122,7 +122,7 @@
private CoreSession adminSession;
- private Set<Dn> pwdResetSet = new HashSet<Dn>();
+ private Set<String> pwdResetSet = new HashSet<String>();
// pwdpolicy state attribute types
private AttributeType AT_PWD_RESET;
@@ -668,7 +668,7 @@
if ( isPwdMustReset( userEntry ) )
{
pwdRespCtrl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.CHANGE_AFTER_RESET );
- pwdResetSet.add( dn );
+ pwdResetSet.add( dn.getNormName() );
}
bindContext.addResponseControl( pwdRespCtrl );
@@ -827,7 +827,7 @@
if ( pwdModDetails.isPwdModPresent() )
{
- if ( pwdResetSet.contains( userDn ) )
+ if ( pwdResetSet.contains( userDn.getNormName() ) )
{
if ( pwdModDetails.isOtherModExists() )
{
@@ -1042,7 +1042,7 @@
if ( removeFromPwdResetSet )
{
- pwdResetSet.remove( userDn );
+ pwdResetSet.remove( userDn.getNormName() );
}
}
else
@@ -1133,7 +1133,7 @@
// cause that requires fetching the ppolicy first, which requires a lookup for user entry
if ( !directoryService.isPwdPolicyEnabled() )
{
- pwdResetSet.remove( unbindContext.getDn() );
+ pwdResetSet.remove( unbindContext.getDn().getNormName() );
}
}
@@ -1402,7 +1402,7 @@
Dn userDn = session.getAuthenticatedPrincipal().getDn();
- if ( pwdResetSet.contains( userDn ) )
+ if ( pwdResetSet.contains( userDn.getNormName() ) )
{
boolean isPPolicyReqCtrlPresent = opContext
.hasRequestControl( PasswordPolicy.OID );