public class JndiUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_IGNORE_CASE
Whether to ignore case when creating basic attributes.
|
private SortBehavior |
sortBehavior
Ldap result sort behavior.
|
| Constructor and Description |
|---|
JndiUtils()
Default constructor.
|
JndiUtils(SortBehavior sb)
Creates a new jndi util.
|
| Modifier and Type | Method and Description |
|---|---|
javax.naming.directory.ModificationItem[] |
fromAttributeModification(AttributeModification[] mods)
Returns jndi modification items using the supplied attribute modifications.
|
javax.naming.directory.Attribute |
fromLdapAttribute(LdapAttribute attr)
Returns a jndi attribute that represents the values in the supplied ldap attribute.
|
javax.naming.directory.Attributes |
fromLdapAttributes(java.util.Collection<LdapAttribute> attrs)
Returns a jndi attributes that represents the values in the supplied ldap attributes.
|
javax.naming.directory.SearchResult |
fromSearchEntry(SearchEntry entry)
Returns a jndi search result that represents the supplied search entry.
|
static javax.naming.ldap.SortKey[] |
fromSortKey(SortKey[] keys)
Returns jndi sort keys using the supplied sort keys.
|
protected static int |
getAttributeModification(AttributeModificationType type)
Returns the jndi modification integer constant for the supplied attribute modification type.
|
static java.lang.String |
getAuthenticationType(Mechanism m)
Returns the JNDI authentication string for the supplied authentication type.
|
static java.lang.String |
getQualityOfProtection(QualityOfProtection qop)
Returns the SASL quality of protection string for the supplied enum.
|
static java.lang.String |
getSecurityStrength(SecurityStrength ss)
Returns the SASL security strength string for the supplied enum.
|
LdapAttribute |
toLdapAttribute(javax.naming.directory.Attribute attr)
Returns an ldap attribute using the supplied jndi attribute.
|
SearchEntry |
toSearchEntry(javax.naming.directory.SearchResult result)
Returns a search entry using the supplied jndi search result.
|
public static final boolean DEFAULT_IGNORE_CASE
private final SortBehavior sortBehavior
public JndiUtils()
public JndiUtils(SortBehavior sb)
sb - sort behaviorpublic javax.naming.directory.Attribute fromLdapAttribute(LdapAttribute attr)
attr - ldap attributepublic LdapAttribute toLdapAttribute(javax.naming.directory.Attribute attr) throws javax.naming.NamingException
attr - jndi attributejavax.naming.NamingException - if the attribute values cannot be readpublic javax.naming.directory.Attributes fromLdapAttributes(java.util.Collection<LdapAttribute> attrs)
attrs - ldap attributespublic javax.naming.directory.SearchResult fromSearchEntry(SearchEntry entry)
entry - search entrypublic SearchEntry toSearchEntry(javax.naming.directory.SearchResult result) throws javax.naming.NamingException
result - jndi search resultjavax.naming.NamingException - if the search result cannot be readpublic javax.naming.directory.ModificationItem[] fromAttributeModification(AttributeModification[] mods)
mods - attribute modificationspublic static javax.naming.ldap.SortKey[] fromSortKey(SortKey[] keys)
keys - sort keysprotected static int getAttributeModification(AttributeModificationType type)
type - attribute modification typepublic static java.lang.String getQualityOfProtection(QualityOfProtection qop)
qop - quality of protection enumpublic static java.lang.String getSecurityStrength(SecurityStrength ss)
ss - security strength enumpublic static java.lang.String getAuthenticationType(Mechanism m)
m - sasl mechanism