Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -174,23 +175,23 @@ private LdapConnectionPool createLdapConnectionPool(
config.setBinaryAttributeDetector( binaryAttributeDetector );
}

GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
GenericObjectPoolConfig<LdapConnection> 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 );

Expand Down
Loading