diff --git a/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java b/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java index e536e2e6fd..b8d2ccf52d 100644 --- a/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java +++ b/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java @@ -18,8 +18,6 @@ */ package org.apache.directory.server.core.factory; - -import org.apache.commons.collections4.Factory; import org.apache.directory.server.core.api.DirectoryService; @@ -55,7 +53,7 @@ public interface DirectoryServiceFactory /** * Gets the partition factory. * - * @return the partition {@link Factory} + * @return the partition Factory * @throws Exception If the partition cannot be created */ PartitionFactory getPartitionFactory() throws Exception; diff --git a/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java b/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java index e1c25d8b0f..eb2b7ebe60 100644 --- a/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java +++ b/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java @@ -20,6 +20,7 @@ package org.apache.directory.server.core.schema; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -29,7 +30,6 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import org.apache.commons.codec.Charsets; import org.apache.directory.api.ldap.model.constants.MetaSchemaConstants; import org.apache.directory.api.ldap.model.constants.SchemaConstants; import org.apache.directory.api.ldap.model.cursor.EmptyCursor; @@ -358,7 +358,7 @@ private Value convert( AttributeType attributeType, Value value ) throws LdapExc { if ( !value.isHumanReadable() ) { - return new Value( attributeType, new String( value.getBytes(), Charsets.UTF_8 ) ); + return new Value( attributeType, new String( value.getBytes(), StandardCharsets.UTF_8 ) ); } } else @@ -1818,7 +1818,7 @@ private boolean checkHumanReadable( Attribute attribute ) throws LdapException { // we have a byte[] value. It should be a String UTF-8 encoded // Let's transform it - String valStr = new String( value.getBytes(), Charsets.UTF_8 ); + String valStr = new String( value.getBytes(), StandardCharsets.UTF_8 ); attribute.remove( value ); attribute.add( valStr ); isModified = true; diff --git a/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java b/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java index cc013a7f84..623b083cdb 100644 --- a/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java +++ b/test-framework/src/main/java/org/apache/directory/server/core/integ/CreateLdapConnectionPoolExtension.java @@ -23,6 +23,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.time.Duration; import org.apache.commons.pool2.PooledObjectFactory; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; @@ -174,23 +175,23 @@ private LdapConnectionPool createLdapConnectionPool( config.setBinaryAttributeDetector( binaryAttributeDetector ); } - GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig(); + GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig<>(); poolConfig.setLifo( createLdapConnectionPool.lifo() ); poolConfig.setMaxTotal( createLdapConnectionPool.maxActive() ); poolConfig.setMaxIdle( createLdapConnectionPool.maxIdle() ); - poolConfig.setMaxWaitMillis( createLdapConnectionPool.maxWait() ); - poolConfig.setMinEvictableIdleTimeMillis( createLdapConnectionPool - .minEvictableIdleTimeMillis() ); + poolConfig.setMaxWait( Duration.ofMillis( createLdapConnectionPool.maxWait() ) ); + poolConfig.setMinEvictableIdleDuration( Duration.ofMillis( createLdapConnectionPool + .minEvictableIdleTimeMillis() ) ); poolConfig.setMinIdle( createLdapConnectionPool.minIdle() ); poolConfig.setNumTestsPerEvictionRun( createLdapConnectionPool .numTestsPerEvictionRun() ); - poolConfig.setSoftMinEvictableIdleTimeMillis( createLdapConnectionPool - .softMinEvictableIdleTimeMillis() ); + poolConfig.setSoftMinEvictableIdleDuration( Duration.ofMillis( createLdapConnectionPool + .softMinEvictableIdleTimeMillis() ) ); poolConfig.setTestOnBorrow( createLdapConnectionPool.testOnBorrow() ); poolConfig.setTestOnReturn( createLdapConnectionPool.testOnReturn() ); poolConfig.setTestWhileIdle( createLdapConnectionPool.testWhileIdle() ); - poolConfig.setTimeBetweenEvictionRunsMillis( createLdapConnectionPool - .timeBetweenEvictionRunsMillis() ); + poolConfig.setTimeBetweenEvictionRuns( Duration.ofMillis( createLdapConnectionPool + .timeBetweenEvictionRunsMillis() ) ); poolConfig.setBlockWhenExhausted( createLdapConnectionPool .whenExhaustedAction() == 1 );