Class LdapUtil
- java.lang.Object
-
- org.apache.directory.fortress.core.util.LdapUtil
-
public class LdapUtil extends Object
This utility is a singleton and has getters / setters to access properties for filtering data bound for ldap. It is used by the Config and LdapDataProvider classes to provide escape ldap data to prevent unauthorized or inadvertent tampering with operations on the server.This class is not thread safe.
- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description LdapUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LdapUtil
getInstance()
Provided synchronized access to this.int
getLdapFilterSize()
Return the number of entries in the filter list.char[]
getLdapMetaChars()
Contains the unsafe characters set by fortress.properties named ldap.filter.String[]
getLdapReplVals()
Contains the safe replacement characters.boolean
isLdapfilterSizeFound()
The ldap.filter.size specifies the number of entries in the set of ldap filter properties.void
setLdapFilterSize(int ldapFilterSize)
Set the number of entries in the filter list.void
setLdapfilterSizeFound(boolean ldapfilterSizeFound)
Associated with fortress.property named ldap.filter.size.void
setLdapMetaChars(char[] ldapMetaChars)
Set the unsafe characters by using ldap.filter specified by fortress.properties.void
setLdapReplVals(String[] ldapReplVals)
Set the ldap replacement chars.
-
-
-
Method Detail
-
getInstance
public static LdapUtil getInstance()
Provided synchronized access to this.- Returns:
- a reference to singleton instance of this class.
-
isLdapfilterSizeFound
public boolean isLdapfilterSizeFound()
The ldap.filter.size specifies the number of entries in the set of ldap filter properties.- Returns:
- true if the property value was found in the fortress configs.
-
setLdapfilterSizeFound
public void setLdapfilterSizeFound(boolean ldapfilterSizeFound)
Associated with fortress.property named ldap.filter.size. If the size matches the number of entries found in properties this will be set to 'true'.- Parameters:
ldapfilterSizeFound
- true indicates the ldap.filter.size prop was set.
-
getLdapFilterSize
public int getLdapFilterSize()
Return the number of entries in the filter list. ldap.filter.size- Returns:
- the number of entries in set.
-
setLdapFilterSize
public void setLdapFilterSize(int ldapFilterSize)
Set the number of entries in the filter list. ldap.filter.size- Parameters:
ldapFilterSize
- corresponds to the number of entries in the ldap filter set.
-
getLdapMetaChars
public char[] getLdapMetaChars()
Contains the unsafe characters set by fortress.properties named ldap.filter.- Returns:
- the set of unsafe characters.
-
setLdapMetaChars
public void setLdapMetaChars(char[] ldapMetaChars)
Set the unsafe characters by using ldap.filter specified by fortress.properties.- Parameters:
ldapMetaChars
- contains the set of unsafe chars
-
getLdapReplVals
public String[] getLdapReplVals()
Contains the safe replacement characters.- Returns:
- the safe character set.
-
setLdapReplVals
public void setLdapReplVals(String[] ldapReplVals)
Set the ldap replacement chars.- Parameters:
ldapReplVals
- contains the set of encoded chars
-
-