Repository: knox
Updated Branches:
  refs/heads/master 645f4efa3 -> bf956d73c


KNOX-1474 - Bump apacheds dependency version to 2.0.0-AM24

Signed-off-by: Kevin Risden <kris...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/bf956d73
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/bf956d73
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/bf956d73

Branch: refs/heads/master
Commit: bf956d73cdf7a94729ada417b1e069079e9b402b
Parents: 645f4ef
Author: Kevin Risden <kris...@apache.org>
Authored: Fri Sep 28 11:38:59 2018 -0400
Committer: Kevin Risden <kris...@apache.org>
Committed: Tue Oct 2 09:44:06 2018 -0400

----------------------------------------------------------------------
 gateway-demo-ldap/pom.xml                             |  5 +++++
 .../gateway/security/ldap/SimpleDirectoryService.java |  3 ++-
 .../security/ldap/SimpleLdapDirectoryServer.java      | 14 ++++++--------
 pom.xml                                               |  7 ++++---
 4 files changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/bf956d73/gateway-demo-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-demo-ldap/pom.xml b/gateway-demo-ldap/pom.xml
index 18649ca..704ee20 100644
--- a/gateway-demo-ldap/pom.xml
+++ b/gateway-demo-ldap/pom.xml
@@ -52,6 +52,11 @@
         </dependency>
 
         <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/knox/blob/bf956d73/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleDirectoryService.java
----------------------------------------------------------------------
diff --git 
a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleDirectoryService.java
 
b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleDirectoryService.java
index d3164f6..8b61003 100644
--- 
a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleDirectoryService.java
+++ 
b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleDirectoryService.java
@@ -17,6 +17,7 @@
  */
 package org.apache.knox.gateway.security.ldap;
 
+import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.server.core.DefaultDirectoryService;
 
 public class SimpleDirectoryService extends DefaultDirectoryService {
@@ -26,7 +27,7 @@ public class SimpleDirectoryService extends 
DefaultDirectoryService {
   }
 
   @Override
-  protected void showSecurityWarnings() throws Exception {
+  protected void showSecurityWarnings() throws LdapException {
     // NoOp - This prevents confusing warnings from being output.
   }
 

http://git-wip-us.apache.org/repos/asf/knox/blob/bf956d73/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
----------------------------------------------------------------------
diff --git 
a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
 
b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
index df76f3e..5245104 100644
--- 
a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
+++ 
b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
@@ -17,11 +17,11 @@
  */
 package org.apache.knox.gateway.security.ldap;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.directory.api.ldap.model.entry.DefaultModification;
 import org.apache.directory.api.ldap.model.entry.ModificationOperation;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.partition.Partition;
@@ -46,8 +46,6 @@ public class SimpleLdapDirectoryServer {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(SimpleLdapDirectoryServer.class);
 
-  private DirectoryServiceFactory factory;
-
   private DirectoryService service;
 
   private LdapServer server;
@@ -57,7 +55,7 @@ public class SimpleLdapDirectoryServer {
       throw new FileNotFoundException( usersLdif.getAbsolutePath() );
     }
 
-    DirectoryService directoryService = null;
+    DirectoryService directoryService;
     try {
       // creating the instance here so that
       // we we can set some properties like accesscontrol, anon access
@@ -71,13 +69,13 @@ public class SimpleLdapDirectoryServer {
       throw new RuntimeException( e );
     }
 
-    PartitionFactory partitionFactory = null;
+    PartitionFactory partitionFactory;
     try {
       String typeName = System.getProperty( "apacheds.partition.factory" );
 
       if ( typeName != null ) {
-        Class<? extends PartitionFactory> type = ( Class<? extends 
PartitionFactory> ) Class.forName( typeName );
-        partitionFactory = type.newInstance();
+        Class<? extends PartitionFactory> type = Class.forName( typeName 
).asSubclass(PartitionFactory.class);
+        partitionFactory = type.getDeclaredConstructor().newInstance();
       } else {
         partitionFactory = new JdbmPartitionFactory();
       }
@@ -86,7 +84,7 @@ public class SimpleLdapDirectoryServer {
       throw new RuntimeException( e );
     }
 
-    factory = new DefaultDirectoryServiceFactory( directoryService, 
partitionFactory );
+    DirectoryServiceFactory factory = new 
DefaultDirectoryServiceFactory(directoryService, partitionFactory);
     factory.init( UUID.randomUUID().toString() );
     service = factory.getDirectoryService();
 

http://git-wip-us.apache.org/repos/asf/knox/blob/bf956d73/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b321f09..1d1355a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -140,7 +140,8 @@
         <gateway-group>org.apache.knox</gateway-group>
 
         <!-- Dependencies sorted alphabetically -->
-        <apacheds-version>2.0.0-M16</apacheds-version>
+        <apacheds.version>2.0.0-M24</apacheds.version>
+        <apacheds-jdbm.version>2.0.0-M5</apacheds-jdbm.version>
         <checkstyle.version>8.12</checkstyle.version>
         <commons-beanutils.version>1.9.3</commons-beanutils.version>
         <commons-cli.version>1.4</commons-cli.version>
@@ -1234,12 +1235,12 @@
             <dependency>
                 <groupId>org.apache.directory.server</groupId>
                 <artifactId>apacheds-jdbm</artifactId>
-                <version>2.0.0-M5</version>
+                <version>${apacheds-jdbm.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.directory.server</groupId>
                 <artifactId>apacheds-all</artifactId>
-                <version>${apacheds-version}</version>
+                <version>${apacheds.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>ldapsdk</groupId>

Reply via email to