|
Spring LDAP Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.ldap.support.LdapUtils
public final class LdapUtils
Generic utility methods for working with LDAP. Mainly for internal use within the framework, but also useful for custom code.
Method Summary | |
---|---|
static void |
closeContext(DirContext context)
Close the given JNDI Context and ignore any thrown exception. |
static void |
collectAttributeValues(Attributes attributes,
String name,
Collection collection)
Collect all the values of a the specified attribute from the supplied Attributes. |
static String |
convertCompositeNameToString(CompositeName compositeName)
Converts a CompositeName to a String in a way that avoids escaping problems, such as the dreaded "triple backslash" problem. |
static NamingException |
convertLdapException(NamingException ex)
Convert the specified checked NamingException to a Spring LDAP runtime
NamingException
equivalent. |
static Class |
getActualTargetClass(DirContext context)
Get the actual class of the supplied DirContext instance; LdapContext or DirContext. |
static void |
iterateAttributeValues(Attribute attribute,
AttributeValueCallbackHandler callbackHandler)
Iterate through all the values of the specified Attribute calling back to the specified callbackHandler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void closeContext(DirContext context)
finally
blocks in JNDI code.
context
- the JNDI Context to close (may be null
)public static NamingException convertLdapException(NamingException ex)
NamingException
to a Spring LDAP runtime
NamingException
equivalent.
ex
- the original checked NamingException to convert
public static Class getActualTargetClass(DirContext context)
context
- the DirContext instance to check.
public static void collectAttributeValues(Attributes attributes, String name, Collection collection)
attributes
- The Attributes; not null
.name
- The name of the Attribute to get values for.collection
- the collection to collect the values in.
NoSuchAttributeException
- if no attribute with the specified name
exists.public static void iterateAttributeValues(Attribute attribute, AttributeValueCallbackHandler callbackHandler)
attribute
- the Attribute to work with; not null
.callbackHandler
- the callbackHandler; not null
.public static String convertCompositeNameToString(CompositeName compositeName)
compositeName
- The CompositeName to convert
name
|
Spring LDAP Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |