Package org.apache.shiro.realm.ldap
Class LdapUtils
- java.lang.Object
-
- org.apache.shiro.realm.ldap.LdapUtils
-
public final class LdapUtils extends Object
Utility class providing static methods to make working with LDAP easier.- Since:
- 0.2
-
-
Constructor Summary
Constructors Constructor Description LdapUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeContext(LdapContext ctx)
Closes an LDAP context, logging any errors, but not throwing an exception if there is a failure.static void
closeEnumeration(NamingEnumeration ne)
static Collection<String>
getAllAttributeValues(Attribute attr)
Helper method used to retrieve all attribute values from a particular context attribute.
-
-
-
Method Detail
-
closeContext
public static void closeContext(LdapContext ctx)
Closes an LDAP context, logging any errors, but not throwing an exception if there is a failure.- Parameters:
ctx
- the LDAP context to close.
-
getAllAttributeValues
public static Collection<String> getAllAttributeValues(Attribute attr) throws NamingException
Helper method used to retrieve all attribute values from a particular context attribute.- Parameters:
attr
- the LDAP attribute.- Returns:
- the values of the attribute.
- Throws:
NamingException
- if there is an LDAP error while reading the values.
-
closeEnumeration
public static void closeEnumeration(NamingEnumeration ne)
-
-