directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [directory-fortress-core] 01/01: FC-238 - Migrate to LDAP API 2.0
Date Tue, 22 Jun 2021 13:40:55 GMT
This is an automated email from the ASF dual-hosted git repository.

smckinney pushed a commit to branch FC-238
in repository https://gitbox.apache.org/repos/asf/directory-fortress-core.git

commit 3c1ac81d77138e9a963d1a07bdc59b6d5e308e7e
Author: Shawn McKinney <smckinney@symas.com>
AuthorDate: Tue Jun 22 08:40:46 2021 -0500

    FC-238 - Migrate to LDAP API 2.0
---
 pom.xml                                            | 28 ++++++++++++-
 .../fortress/core/ant/FortressAntTask.java         |  2 +-
 .../fortress/core/cli/CommandLineInterpreter.java  |  2 +-
 .../fortress/core/impl/AcceleratorDAO.java         |  2 +-
 .../fortress/core/impl/AccessMgrImpl.java          |  2 +-
 .../directory/fortress/core/impl/AdminMgrImpl.java |  2 +-
 .../directory/fortress/core/impl/AdminRoleDAO.java |  2 +-
 .../directory/fortress/core/impl/AdminRoleP.java   |  2 +-
 .../fortress/core/impl/AdminRoleUtil.java          |  2 +-
 .../fortress/core/impl/DelAccessMgrImpl.java       |  2 +-
 .../fortress/core/impl/DelAdminMgrImpl.java        |  2 +-
 .../directory/fortress/core/impl/GroupMgrImpl.java |  2 +-
 .../directory/fortress/core/impl/GroupP.java       |  2 +-
 .../directory/fortress/core/impl/HierUtil.java     |  2 +-
 .../directory/fortress/core/impl/PermDAO.java      |  2 +-
 .../apache/directory/fortress/core/impl/PermP.java |  2 +-
 .../directory/fortress/core/impl/PsoUtil.java      |  2 +-
 .../fortress/core/impl/ReviewMgrImpl.java          |  2 +-
 .../directory/fortress/core/impl/RoleDAO.java      |  2 +-
 .../apache/directory/fortress/core/impl/RoleP.java |  2 +-
 .../directory/fortress/core/impl/RoleUtil.java     |  2 +-
 .../directory/fortress/core/impl/SDUtil.java       |  2 +-
 .../apache/directory/fortress/core/impl/SdDAO.java |  2 +-
 .../directory/fortress/core/impl/UserDAO.java      | 32 +++++++++------
 .../apache/directory/fortress/core/impl/UserP.java |  2 +-
 .../directory/fortress/core/impl/UsoUtil.java      |  3 +-
 .../fortress/core/ldap/LdapConnectionProvider.java | 20 +++++----
 .../fortress/core/ldap/LdapDataProvider.java       | 48 ++++++++++++++++++----
 .../apache/directory/fortress/core/util/VUtil.java |  2 +-
 29 files changed, 127 insertions(+), 52 deletions(-)

diff --git a/pom.xml b/pom.xml
index e7b6371..08954e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -215,6 +215,19 @@
     <dependency>
       <groupId>org.apache.directory.api</groupId>
       <artifactId>api-all</artifactId>
+      <version>2.0.2</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+      <version>4.4</version>
+    </dependency>
+
+<!--
+    <dependency>
+      <groupId>org.apache.directory.api</groupId>
+      <artifactId>api-all</artifactId>
       <version>${version.api.all}</version>
       <type>jar</type>
       <exclusions>
@@ -222,13 +235,14 @@
           <groupId>xml-apis</groupId>
           <artifactId>xml-apis</artifactId>
         </exclusion>
-        <!-- CVE-2018-1000632 -->
+        &lt;!&ndash; CVE-2018-1000632 &ndash;&gt;
         <exclusion>
           <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.dom4j</artifactId>
         </exclusion>
       </exclusions>
     </dependency>
+-->
 
     <dependency>
       <groupId>org.apache.ant</groupId>
@@ -493,6 +507,18 @@
       <version>${version.log4j}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+      <version>4.4</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.2.2</version>
+      <scope>compile</scope>
+    </dependency>
 
   </dependencies>
 
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java b/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
index 2f63102..8775744 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
@@ -26,7 +26,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.AdminMgr;
 import org.apache.directory.fortress.core.AdminMgrFactory;
diff --git a/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
b/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
index 3ea19fd..8a6d32f 100755
--- a/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
+++ b/src/main/java/org/apache/directory/fortress/core/cli/CommandLineInterpreter.java
@@ -31,7 +31,7 @@ import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.*;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AcceleratorDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/AcceleratorDAO.java
index ee68c68..a778707 100644
--- a/src/main/java/org/apache/directory/fortress/core/impl/AcceleratorDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AcceleratorDAO.java
@@ -23,7 +23,7 @@ package org.apache.directory.fortress.core.impl;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
index 5a53206..0371cd7 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AccessMgrImpl.java
@@ -24,7 +24,7 @@ import java.io.Serializable;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.annotation.AdminPermissionOperation;
 import org.apache.directory.fortress.core.AccessMgr;
 import org.apache.directory.fortress.core.GlobalErrIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
index 078ad74..66e15de 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AdminMgrImpl.java
@@ -25,7 +25,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.annotation.AdminPermissionOperation;
 import org.apache.directory.fortress.core.AdminMgr;
 import org.apache.directory.fortress.core.FinderException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleDAO.java
index 0ce2cb1..8a19af4 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleDAO.java
@@ -23,7 +23,7 @@ package org.apache.directory.fortress.core.impl;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleP.java b/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleP.java
index cc4b777..e7359d9 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleP.java
@@ -23,7 +23,7 @@ package org.apache.directory.fortress.core.impl;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleUtil.java
index d28bd1f..6ad007b 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AdminRoleUtil.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.SecurityException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/DelAccessMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/DelAccessMgrImpl.java
index 09c06ec..42581bf 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/DelAccessMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/DelAccessMgrImpl.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.annotation.AdminPermissionOperation;
 import org.apache.directory.fortress.core.DelAccessMgr;
 import org.apache.directory.fortress.core.GlobalErrIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/DelAdminMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/DelAdminMgrImpl.java
index ae26866..375c8c2 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/DelAdminMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/DelAdminMgrImpl.java
@@ -23,7 +23,7 @@ import java.io.Serializable;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.annotation.AdminPermissionOperation;
 import org.apache.directory.fortress.core.AdminMgr;
 import org.apache.directory.fortress.core.AdminMgrFactory;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
index 1048858..f25cf47 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/GroupMgrImpl.java
@@ -23,7 +23,7 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.annotation.AdminPermissionOperation;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GroupMgr;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java b/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
index c97dbb8..018d110 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/GroupP.java
@@ -23,7 +23,7 @@ package org.apache.directory.fortress.core.impl;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.api.util.Strings;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
index 991766a..a8aaf1a 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
@@ -28,7 +28,7 @@ import java.util.Set;
 import java.util.TreeSet;
 import java.util.concurrent.locks.ReadWriteLock;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.core.model.Graphable;
 import org.apache.directory.fortress.core.model.Hier;
 import org.apache.directory.fortress.core.model.Relationship;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
index 9b674a2..423cfba 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PermDAO.java
@@ -26,7 +26,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PermP.java b/src/main/java/org/apache/directory/fortress/core/impl/PermP.java
index c2561b3..1d0b687 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/PermP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PermP.java
@@ -23,7 +23,7 @@ package org.apache.directory.fortress.core.impl;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/PsoUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/PsoUtil.java
index 5c04994..f2fb6f6 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/PsoUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/PsoUtil.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.SecurityException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java b/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java
index 79a15ca..d3e2701 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/ReviewMgrImpl.java
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.directory.fortress.annotation.AdminPermissionOperation;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.ReviewMgr;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
index 4dcb9c1..bf0901e 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleDAO.java
@@ -23,7 +23,7 @@ package org.apache.directory.fortress.core.impl;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
index d0b8b26..15929a1 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
@@ -22,7 +22,7 @@ package org.apache.directory.fortress.core.impl;
 
 import java.util.List;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleUtil.java
index e2d21bd..be41af6 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/RoleUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleUtil.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.SecurityException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/SDUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/SDUtil.java
index 696417b..1b3aeca 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/SDUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/SDUtil.java
@@ -28,7 +28,7 @@ import net.sf.ehcache.search.Query;
 import net.sf.ehcache.search.Result;
 import net.sf.ehcache.search.Results;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.fortress.core.*;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/SdDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/SdDAO.java
index 1a51ca5..d2b315c 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/SdDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/SdDAO.java
@@ -25,7 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
index e9248ee..36eaf0a 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
@@ -27,10 +27,11 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
 import org.apache.directory.api.ldap.model.cursor.SearchCursor;
@@ -50,6 +51,7 @@ import org.apache.directory.api.ldap.model.exception.LdapNoPermissionException;
 import org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException;
 import org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException;
 import org.apache.directory.api.ldap.model.message.BindResponse;
+import org.apache.directory.api.ldap.model.message.Control;
 import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.api.ldap.model.message.SearchScope;
 import org.apache.directory.fortress.core.CfgException;
@@ -71,6 +73,7 @@ import org.apache.directory.ldap.client.api.LdapConnection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyErrorEnum.*;
 import static org.apache.directory.fortress.core.impl.RoleDAO.IS_RFC2307;
 
 
@@ -834,13 +837,16 @@ final class UserDAO extends LdapDataProvider implements PropUpdater
                 session.setErrorId( GlobalErrIds.USER_PW_INVLD );
             }
 
-            PasswordPolicy respCtrl = getPwdRespCtrl( bindResponse );
+            //PasswordPolicy respCtrl = getPwdRespCtrl( bindResponse );
+/*
+            PasswordPolicyResponse respCtrl = getPwdRespCtrl( bindResponse );
 
             if ( respCtrl != null )
             {
                 // check IETF password policies here
                 checkPwPolicies( session, respCtrl );
             }
+*/
 
             if ( session.getErrorId() == 0 )
             {
@@ -871,7 +877,7 @@ final class UserDAO extends LdapDataProvider implements PropUpdater
     }
 
 
-    private void checkPwPolicies( PwMessage pwMsg, PasswordPolicy respCtrl )
+    private void checkPwPolicies( PwMessage pwMsg, PasswordPolicyResponse respCtrl )
     {
         int rc = 0;
         boolean result = false;
@@ -879,28 +885,30 @@ final class UserDAO extends LdapDataProvider implements PropUpdater
         if ( respCtrl != null )
         {
             // LDAP has notified of password violation:
-            if ( respCtrl.hasResponse() )
+//            if ( respCtrl.hasResponse() )
+            if ( true )
             {
                 String errMsg = null;
-                if ( respCtrl.getResponse() != null )
+/*                if ( respCtrl.getResponse() != null )*/
+                if ( true )
                 {
-                    if ( respCtrl.getResponse().getTimeBeforeExpiration() > 0 )
+                    if ( respCtrl.getTimeBeforeExpiration() > 0 )
                     {
-                        pwMsg.setExpirationSeconds( respCtrl.getResponse().getTimeBeforeExpiration()
);
+                        pwMsg.setExpirationSeconds( respCtrl.getTimeBeforeExpiration() );
                         pwMsg.setWarning( new ObjectFactory().createWarning( GlobalPwMsgIds
                             .PASSWORD_EXPIRATION_WARNING, "PASSWORD WILL EXPIRE", Warning.Type.PASSWORD
) );
                     }
-                    if ( respCtrl.getResponse().getGraceAuthNRemaining() > 0 )
+                    if ( respCtrl.getGraceAuthNRemaining() > 0 )
                     {
-                        pwMsg.setGraceLogins( respCtrl.getResponse().getGraceAuthNRemaining()
);
+                        pwMsg.setGraceLogins( respCtrl.getGraceAuthNRemaining() );
                         pwMsg.setWarning( new ObjectFactory().createWarning( GlobalPwMsgIds.PASSWORD_GRACE_WARNING,
                             "PASSWORD IN GRACE", Warning.Type.PASSWORD ) );
                     }
 
-                    if ( respCtrl.getResponse().getPasswordPolicyError() != null )
+                    if ( respCtrl.getPasswordPolicyError() != null )
                     {
 
-                        switch ( respCtrl.getResponse().getPasswordPolicyError() )
+                        switch ( respCtrl.getPasswordPolicyError() )
                         {
 
                             case CHANGE_AFTER_RESET:
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserP.java b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
index c9e2af3..34adb3a 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
@@ -25,7 +25,7 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Set;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.GlobalIds;
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UsoUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/UsoUtil.java
index 54cc16a..119096a 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UsoUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UsoUtil.java
@@ -24,7 +24,8 @@ import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
-import org.apache.commons.collections.CollectionUtils;
+//import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.*;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.SecurityException;
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/LdapConnectionProvider.java
b/src/main/java/org/apache/directory/fortress/core/ldap/LdapConnectionProvider.java
index 0a46cb0..c0ed8c9 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/LdapConnectionProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/LdapConnectionProvider.java
@@ -25,6 +25,7 @@ import java.util.List;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.pool.PoolableObjectFactory;
 import org.apache.commons.pool.impl.GenericObjectPool;
+import org.apache.commons.pool2.PooledObjectFactory;
 import org.apache.directory.api.ldap.codec.api.LdapApiService;
 import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory;
 import org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService;
@@ -166,6 +167,8 @@ public class LdapConnectionProvider
         }
 
         config.setCredentials( adminPw );
+        // TODO: FIXME #4
+/*
         try
         {
             List<String> listExOps = new ArrayList<>();
@@ -188,14 +191,17 @@ public class LdapConnectionProvider
             String error = "Exception caught initializing Admin Pool: " + ex;
             throw new CfgRuntimeException( GlobalErrIds.FT_APACHE_LDAP_POOL_INIT_FAILED,
error, ex );
         }
+*/
 
-        PoolableObjectFactory<LdapConnection> poolFactory = new ValidatingPoolableLdapConnectionFactory(
config );
+        // TODO: FIXME #1
+        PooledObjectFactory<LdapConnection> poolFactory = new ValidatingPoolableLdapConnectionFactory(
config );
+        //PoolableObjectFactory<LdapConnection> poolFactory = new ValidatingPoolableLdapConnectionFactory(
config );
 
         // Create the Admin pool
         adminPool = new LdapConnectionPool( poolFactory );
         adminPool.setTestOnBorrow( testOnBorrow );
-        adminPool.setWhenExhaustedAction( GenericObjectPool.WHEN_EXHAUSTED_GROW );
-        adminPool.setMaxActive( max );
+        //adminPool.setWhenExhaustedAction( GenericObjectPool.WHEN_EXHAUSTED_GROW );
+        //adminPool.setMaxActive( max );
         adminPool.setMinIdle( min );
         adminPool.setMaxIdle( -1 );
         adminPool.setTestWhileIdle( testWhileIdle );
@@ -205,8 +211,8 @@ public class LdapConnectionProvider
         // Create the User pool
         userPool = new LdapConnectionPool( poolFactory );
         userPool.setTestOnBorrow( testOnBorrow );
-        userPool.setWhenExhaustedAction( GenericObjectPool.WHEN_EXHAUSTED_GROW );
-        userPool.setMaxActive( max );
+        //userPool.setWhenExhaustedAction( GenericObjectPool.WHEN_EXHAUSTED_GROW );
+        //userPool.setMaxActive( max );
         userPool.setMinIdle( min );
         userPool.setMaxIdle( -1 );
         userPool.setTestWhileIdle( testWhileIdle );
@@ -249,8 +255,8 @@ public class LdapConnectionProvider
             poolFactory = new ValidatingPoolableLdapConnectionFactory( logConfig );
             logPool = new LdapConnectionPool( poolFactory );
             logPool.setTestOnBorrow( testOnBorrow );
-            logPool.setWhenExhaustedAction( GenericObjectPool.WHEN_EXHAUSTED_GROW );
-            logPool.setMaxActive( logmax );
+            //logPool.setWhenExhaustedAction( GenericObjectPool.WHEN_EXHAUSTED_GROW );
+            //logPool.setMaxActive( logmax );
             logPool.setMinIdle( logmin );
             logPool.setTestWhileIdle( testWhileIdle );
             logPool.setTimeBetweenEvictionRunsMillis( logTimeBetweenEvictionRunMillis );
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
index 768b985..61504ad 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/LdapDataProvider.java
@@ -30,9 +30,26 @@ import java.util.Set;
 import java.util.TreeSet;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
-import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyImpl;
-import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyDecorator;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory;
+import org.apache.directory.api.ldap.codec.osgi.DefaultLdapCodecService;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequest;
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequestImpl;
+
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyImpl;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyDecorator;
+
+
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicy;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyImpl;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyDecorator;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.*;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequest;
+//import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyRequestImpl;
+
+
+import org.apache.directory.api.ldap.extras.controls.ppolicy.PasswordPolicyResponse;
+import org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyResponseFactory;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.cursor.CursorException;
 import org.apache.directory.api.ldap.model.cursor.SearchCursor;
@@ -78,7 +95,7 @@ public abstract class LdapDataProvider
     private static final String CLS_NM = LdapDataProvider.class.getName();
     private static final int MAX_DEPTH = 100;
     private static final LdapCounters COUNTERS = new LdapCounters();
-    private static final PasswordPolicy PP_REQ_CTRL = new PasswordPolicyImpl();
+    private static final PasswordPolicyRequest PP_REQ_CTRL = new PasswordPolicyRequestImpl();
 
     /**
      * Given a contextId and a fortress param name return the LDAP dn.
@@ -255,6 +272,7 @@ public abstract class LdapDataProvider
         }
         AddRequest addRequest = new AddRequestImpl();
         addRequest.setEntry( entry );
+        // TODO: FIXME #2
         if ( setRelaxControl )
         {
             addRequest.addControl( new RelaxControlImpl() );
@@ -332,6 +350,7 @@ public abstract class LdapDataProvider
         {
             modRequest.addModification( mod );
         }
+        // TODO: FIXME #2
         if ( setRelaxControl )
         {
             modRequest.addControl( new RelaxControlImpl() );
@@ -750,7 +769,7 @@ public abstract class LdapDataProvider
             Attribute attr = entry.get( attributeName );
             if ( attr != null )
             {
-                for ( Value<?> value : attr )
+                for ( Value value : attr )
                 {
                     attrValues.add( value.getString() );
                 }
@@ -802,7 +821,7 @@ public abstract class LdapDataProvider
 
         if ( entry != null && entry.containsAttribute( attributeName ) )
         {
-            for ( Value<?> value : entry.get( attributeName ) )
+            for ( Value value : entry.get( attributeName ) )
             {
                 attrValues.add( value.getString() );
             }
@@ -861,6 +880,7 @@ public abstract class LdapDataProvider
     }
 
 
+/*
     protected String getRdnValue( String dn )
     {
         try
@@ -872,6 +892,7 @@ public abstract class LdapDataProvider
             return null;
         }
     }
+*/
 
 
     /**
@@ -1208,7 +1229,18 @@ public abstract class LdapDataProvider
      * @param resp contains reference to LDAP pw policy response.
      * @return PasswordPolicy response control.
      */
-    protected PasswordPolicy getPwdRespCtrl( Response resp )
+    protected PasswordPolicyResponse getPwdRespCtrl(Response resp )
+    {
+        // TODO: FIXME #3
+        LdapApiService codec = new DefaultLdapCodecService();
+        PasswordPolicyResponseFactory factory = ( PasswordPolicyResponseFactory ) codec.getResponseControlFactories().
+                get( PasswordPolicyResponse.OID );
+        PasswordPolicyResponse passwordPolicyResponse = factory.newControl();
+        return passwordPolicyResponse;
+    }
+
+/*
+    protected PasswordPolicy getPwdRespCtrl(Response resp )
     {
         Control control = resp.getControls().get( PP_REQ_CTRL.getOid() );
         if ( control == null )
@@ -1220,6 +1252,7 @@ public abstract class LdapDataProvider
     }
 
 
+*/
     /**
      * Calls the PoolMgr to perform an LDAP bind for a user/password combination.  This function
is valid
      * if and only if the user entity is a member of the USERS data set.
@@ -1237,6 +1270,7 @@ public abstract class LdapDataProvider
         BindRequest bindReq = new BindRequestImpl();
         bindReq.setDn( userDn );
         bindReq.setCredentials( password );
+        // TODO: FIX ME
         bindReq.addControl( PP_REQ_CTRL );
         return connection.bind( bindReq );
     }
diff --git a/src/main/java/org/apache/directory/fortress/core/util/VUtil.java b/src/main/java/org/apache/directory/fortress/core/util/VUtil.java
index 56bd5a5..ac7d4c2 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/VUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/VUtil.java
@@ -27,7 +27,7 @@ import java.util.Enumeration;
 import java.util.List;
 import java.util.Properties;
 
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.CfgException;

Mime
View raw message