From dcdd29a54153389748e64c505453d018000aaa4d Mon Sep 17 00:00:00 2001
From: david_page <david_page@localhost>
Date: Wed, 21 Feb 2007 16:29:51 +0000
Subject: [PATCH] The PasswordPolicyState public interface includes "getters" for PasswordPolicy attributes that simply forward the request to the corresponding PasswordPolicy getter. Remove these methods from the PasswordPolicyState interface and replace any calls with a direct invocation on the PasswordPolicy object reference held by the PasswordPolicyState object (via PasswordPolicyState.getPolicy()).
---
opends/src/server/org/opends/server/core/BindOperation.java | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/BindOperation.java b/opends/src/server/org/opends/server/core/BindOperation.java
index 0489f66..173af05 100644
--- a/opends/src/server/org/opends/server/core/BindOperation.java
+++ b/opends/src/server/org/opends/server/core/BindOperation.java
@@ -1263,7 +1263,8 @@
// Check to see if the user has a password. If not, then fail.
// FIXME -- We need to have a way to enable/disable debugging.
pwPolicyState = new PasswordPolicyState(userEntry, false, false);
- AttributeType pwType = pwPolicyState.getPasswordAttribute();
+ AttributeType pwType
+ = pwPolicyState.getPolicy().getPasswordAttribute();
List<Attribute> pwAttr = userEntry.getAttribute(pwType);
if ((pwAttr == null) || (pwAttr.isEmpty()))
@@ -1378,7 +1379,8 @@
pwPolicyErrorType = PasswordPolicyErrorType.PASSWORD_EXPIRED;
}
- int maxGraceLogins = pwPolicyState.getMaxAllowedGraceLogins();
+ int maxGraceLogins
+ = pwPolicyState.getPolicy().getGraceLoginCount();
if ((maxGraceLogins > 0) && pwPolicyState.mayUseGraceLogin())
{
List<Long> graceLoginTimes = pwPolicyState.getGraceLoginTimes();
@@ -1656,7 +1658,8 @@
setResultCode(ResultCode.INVALID_CREDENTIALS);
setAuthFailureReason(msgID, message);
- int maxAllowedFailures = pwPolicyState.getMaxAllowedFailures();
+ int maxAllowedFailures
+ = pwPolicyState.getPolicy().getLockoutFailureCount();
if (maxAllowedFailures > 0)
{
pwPolicyState.updateAuthFailureTimes();
@@ -1667,7 +1670,8 @@
AccountStatusNotificationType notificationType;
- int lockoutDuration = pwPolicyState.getLockoutDuration();
+ int lockoutDuration
+ = pwPolicyState.getPolicy().getLockoutDuration();
if (lockoutDuration > 0)
{
notificationType = AccountStatusNotificationType.
@@ -1893,7 +1897,8 @@
pwPolicyErrorType = PasswordPolicyErrorType.PASSWORD_EXPIRED;
}
- int maxGraceLogins = pwPolicyState.getMaxAllowedGraceLogins();
+ int maxGraceLogins
+ = pwPolicyState.getPolicy().getGraceLoginCount();
if ((maxGraceLogins > 0) && pwPolicyState.mayUseGraceLogin())
{
List<Long> graceLoginTimes =
@@ -2137,7 +2142,8 @@
if (saslHandler.isPasswordBased(saslMechanism))
{
- int maxAllowedFailures = pwPolicyState.getMaxAllowedFailures();
+ int maxAllowedFailures
+ = pwPolicyState.getPolicy().getLockoutFailureCount();
if (maxAllowedFailures > 0)
{
pwPolicyState.updateAuthFailureTimes();
@@ -2150,7 +2156,8 @@
int msgID;
String message;
- int lockoutDuration = pwPolicyState.getLockoutDuration();
+ int lockoutDuration
+ = pwPolicyState.getPolicy().getLockoutDuration();
if (lockoutDuration > 0)
{
notificationType = AccountStatusNotificationType.
--
Gitblit v1.10.0