org.ldaptive.provider.jndi
Class JndiUtils

java.lang.Object
  extended by org.ldaptive.provider.jndi.JndiUtils

public class JndiUtils
extends Object

Provides methods for converting between JNDI specific objects and ldaptive specific objects.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Field Summary
static boolean DEFAULT_IGNORE_CASE
          Whether to ignore case when creating basic attributes.
 
Constructor Summary
JndiUtils()
          Default constructor.
JndiUtils(SortBehavior sb)
          Creates a new jndi util.
 
Method Summary
 ModificationItem[] fromAttributeModification(AttributeModification[] mods)
          Returns jndi modification items using the supplied attribute modifications.
 Attribute fromLdapAttribute(LdapAttribute attr)
          Returns a jndi attribute that represents the values in the supplied ldap attribute.
 Attributes fromLdapAttributes(Collection<LdapAttribute> attrs)
          Returns a jndi attributes that represents the values in the supplied ldap attributes.
 SearchResult fromSearchEntry(SearchEntry entry)
          Returns a jndi search result that represents the supplied search entry.
static 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 String getAuthenticationType(Mechanism m)
          Returns the JNDI authentication string for the supplied authentication type.
static String getQualityOfProtection(QualityOfProtection qop)
          Returns the SASL quality of protection string for the supplied enum.
static String getSecurityStrength(SecurityStrength ss)
          Returns the SASL security strength string for the supplied enum.
 LdapAttribute toLdapAttribute(Attribute attr)
          Returns an ldap attribute using the supplied jndi attribute.
 SearchEntry toSearchEntry(SearchResult result)
          Returns a search entry using the supplied jndi search result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IGNORE_CASE

public static final boolean DEFAULT_IGNORE_CASE
Whether to ignore case when creating basic attributes.

See Also:
Constant Field Values
Constructor Detail

JndiUtils

public JndiUtils()
Default constructor.


JndiUtils

public JndiUtils(SortBehavior sb)
Creates a new jndi util.

Parameters:
sb - sort behavior
Method Detail

fromLdapAttribute

public Attribute fromLdapAttribute(LdapAttribute attr)
Returns a jndi attribute that represents the values in the supplied ldap attribute.

Parameters:
attr - ldap attribute
Returns:
jndi attribute

toLdapAttribute

public LdapAttribute toLdapAttribute(Attribute attr)
                              throws NamingException
Returns an ldap attribute using the supplied jndi attribute.

Parameters:
attr - jndi attribute
Returns:
ldap attribute
Throws:
NamingException - if the attribute values cannot be read

fromLdapAttributes

public Attributes fromLdapAttributes(Collection<LdapAttribute> attrs)
Returns a jndi attributes that represents the values in the supplied ldap attributes.

Parameters:
attrs - ldap attributes
Returns:
jndi attributes

fromSearchEntry

public SearchResult fromSearchEntry(SearchEntry entry)
Returns a jndi search result that represents the supplied search entry.

Parameters:
entry - search entry
Returns:
jndi search result

toSearchEntry

public SearchEntry toSearchEntry(SearchResult result)
                          throws NamingException
Returns a search entry using the supplied jndi search result.

Parameters:
result - jndi search result
Returns:
search entry
Throws:
NamingException - if the search result cannot be read

fromAttributeModification

public ModificationItem[] fromAttributeModification(AttributeModification[] mods)
Returns jndi modification items using the supplied attribute modifications.

Parameters:
mods - attribute modifications
Returns:
jndi modification items

fromSortKey

public static SortKey[] fromSortKey(SortKey[] keys)
Returns jndi sort keys using the supplied sort keys.

Parameters:
keys - sort keys
Returns:
jndi sort keys

getAttributeModification

protected static int getAttributeModification(AttributeModificationType type)
Returns the jndi modification integer constant for the supplied attribute modification type.

Parameters:
type - attribute modification type
Returns:
integer constant

getQualityOfProtection

public static String getQualityOfProtection(QualityOfProtection qop)
Returns the SASL quality of protection string for the supplied enum.

Parameters:
qop - quality of protection enum
Returns:
SASL quality of protection string

getSecurityStrength

public static String getSecurityStrength(SecurityStrength ss)
Returns the SASL security strength string for the supplied enum.

Parameters:
ss - security strength enum
Returns:
SASL security strength string

getAuthenticationType

public static String getAuthenticationType(Mechanism m)
Returns the JNDI authentication string for the supplied authentication type.

Parameters:
m - sasl mechanism
Returns:
JNDI authentication string


Copyright © 2003-2015 Virginia Tech. All Rights Reserved.