Class DefaultDnFactory
- java.lang.Object
-
- org.apache.directory.api.ldap.model.name.DefaultDnFactory
-
- All Implemented Interfaces:
DnFactory
public class DefaultDnFactory extends Object implements DnFactory
The default Dn factory implementation.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description private com.github.benmanes.caffeine.cache.Cache<String,Dn>dnCacheThe cache for DNsprivate booleanenableStatsFlag to enable statsprivate inthitCountprivate static org.slf4j.LoggerLOGprivate intmissCountprivate SchemaManagerschemaManagerThe schema manager
-
Constructor Summary
Constructors Constructor Description DefaultDnFactory(SchemaManager schemaManager, int cacheSize)Instantiates a new default Dn factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dncreate(String dn)Creates a Dn form a user provided Dn.Dncreate(String... upRdns)Creates a Dn from user provided RDNs.
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
schemaManager
private SchemaManager schemaManager
The schema manager
-
enableStats
private boolean enableStats
Flag to enable stats
-
hitCount
private int hitCount
-
missCount
private int missCount
-
-
Constructor Detail
-
DefaultDnFactory
public DefaultDnFactory(SchemaManager schemaManager, int cacheSize)
Instantiates a new default Dn factory.- Parameters:
schemaManager- The SchemaManager instancecacheSize- The cache size used to store DNs
-
-
Method Detail
-
create
public Dn create(String dn) throws LdapInvalidDnException
Creates a Dn form a user provided Dn.- Specified by:
createin interfaceDnFactory- Parameters:
dn- the user provided Dn- Returns:
- the created Dn
- Throws:
LdapInvalidDnException- if the string isn't a valid Dn
-
create
public Dn create(String... upRdns) throws LdapInvalidDnException
Creates a Dn from user provided RDNs.- Specified by:
createin interfaceDnFactory- Parameters:
upRdns- the user provided RDNs- Returns:
- the created Dn
- Throws:
LdapInvalidDnException- if one of the strings isn't a valid Rdn
-
-