Spring LDAP

org.springframework.ldap.core
Class LdapAttributes

java.lang.Object
  extended by javax.naming.directory.BasicAttributes
      extended by org.springframework.ldap.core.LdapAttributes
All Implemented Interfaces:
Serializable, Cloneable, Attributes

public class LdapAttributes
extends BasicAttributes

Extends BasicAttributes to add specialized support for DNs.

While DNs appear to be and can be treated as attributes, they have a special meaning in that they define the address to which the object is bound. DNs must conform to special formating rules and are typically required to be handled separately from other attributes.

This class makes this distinction between the DN and other attributes prominent and apparent.

Author:
Keith Barlow
See Also:
Serialized Form

Field Summary
protected  DistinguishedName dn
          Distinguished name to which the object is bound.
 
Constructor Summary
LdapAttributes()
          Default constructor.
LdapAttributes(boolean ignoreCase)
          Constructor for specifying whether or not the object is case sensitive.
LdapAttributes(DistinguishedName dn)
          Creates an LdapAttributes object with the specified DN.
LdapAttributes(DistinguishedName dn, boolean ignoreCase)
          Creates an LdapAttributes object with the specified DN and case sensitivity setting.
LdapAttributes(DistinguishedName dn, String attrID, Object val)
          Creates an LdapAttributes object with the specifying attribute and value and case sensitivity setting.
LdapAttributes(DistinguishedName dn, String attrID, Object val, boolean ignoreCase)
          Creates an LdapAttributes object for the supplied DN with the attribute specified.
LdapAttributes(String attrID, Object val)
          Creates an LdapAttributes object with the specified attribute.
LdapAttributes(String attrID, Object val, boolean ignoreCase)
          Creates an LdapAttributes object with the specifying attribute and value and case sensitivity setting.
 
Method Summary
 DistinguishedName getDN()
          Returns the distinguished name to which the object is bound.
 void setDN(DistinguishedName dn)
          Sets the distinguished name of the object.
 String toString()
          Returns a string representation of the object in LDIF format.
 
Methods inherited from class javax.naming.directory.BasicAttributes
clone, equals, get, getAll, getIDs, hashCode, isCaseIgnored, put, put, remove, size
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dn

protected DistinguishedName dn
Distinguished name to which the object is bound.

Constructor Detail

LdapAttributes

public LdapAttributes()
Default constructor.


LdapAttributes

public LdapAttributes(DistinguishedName dn)
Creates an LdapAttributes object with the specified DN.

Parameters:
dn - The DistinguishedName to which this object is bound.

LdapAttributes

public LdapAttributes(boolean ignoreCase)
Constructor for specifying whether or not the object is case sensitive.

Parameters:
ignoreCase - boolean indicator.

LdapAttributes

public LdapAttributes(DistinguishedName dn,
                      boolean ignoreCase)
Creates an LdapAttributes object with the specified DN and case sensitivity setting.

Parameters:
dn - The DistinguishedName to which this object is bound.
ignoreCase - boolean indicator.

LdapAttributes

public LdapAttributes(String attrID,
                      Object val)
Creates an LdapAttributes object with the specified attribute.

Parameters:
attrID - String ID of the attribute.
val - Value of the attribute.

LdapAttributes

public LdapAttributes(DistinguishedName dn,
                      String attrID,
                      Object val)
Creates an LdapAttributes object with the specifying attribute and value and case sensitivity setting.

Parameters:
dn - The DistinguishedName to which this object is bound.
attrID - String ID of the attribute.
val - Value of the attribute.

LdapAttributes

public LdapAttributes(String attrID,
                      Object val,
                      boolean ignoreCase)
Creates an LdapAttributes object with the specifying attribute and value and case sensitivity setting.

Parameters:
attrID - String ID of the attribute.
val - Value of the attribute.
ignoreCase - boolean indicator.

LdapAttributes

public LdapAttributes(DistinguishedName dn,
                      String attrID,
                      Object val,
                      boolean ignoreCase)
Creates an LdapAttributes object for the supplied DN with the attribute specified.

Parameters:
dn - The DistinguishedName to which this object is bound.
attrID - String ID of the attribute.
val - Value of the attribute.
ignoreCase - boolean indicator.
Method Detail

getDN

public DistinguishedName getDN()
Returns the distinguished name to which the object is bound.

Returns:
DistinguishedName specifying the name to which the object is bound.

setDN

public void setDN(DistinguishedName dn)
Sets the distinguished name of the object.

Parameters:
dn - DistinguishedName specifying the name to which the object is bound.

toString

public String toString()
Returns a string representation of the object in LDIF format.

Overrides:
toString in class BasicAttributes
Returns:
String formated to RFC2849 LDIF specifications.

Spring LDAP