edu.vt.middleware.ldap.bean
Class AbstractLdapAttributes<T extends Map<String,LdapAttribute>>

java.lang.Object
  extended by edu.vt.middleware.ldap.bean.AbstractLdapBean
      extended by edu.vt.middleware.ldap.bean.AbstractLdapAttributes<T>
Type Parameters:
T - type of backing map
All Implemented Interfaces:
LdapAttributes
Direct Known Subclasses:
OrderedLdapBeanFactory.OrderedLdapAttributes, SortedLdapBeanFactory.SortedLdapAttributes, UnorderedLdapBeanFactory.UnorderedLdapAttributes

public abstract class AbstractLdapAttributes<T extends Map<String,LdapAttribute>>
extends AbstractLdapBean
implements LdapAttributes

AbstractLdapAttributes provides a base implementation of LdapAttributes where the underlying attributes are backed by a Map.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services

Field Summary
protected  T attributes
          Attributes contained in this bean.
static boolean DEFAULT_IGNORE_CASE
          Whether to ignore case when creating BasicAttributes.
protected static int HASH_CODE_SEED
          hash code seed.
 
Fields inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
beanFactory, logger
 
Constructor Summary
AbstractLdapAttributes(LdapBeanFactory lbf)
          Creates a new AbstractLdapAttributes with the supplied ldap bean factory.
 
Method Summary
 void addAttribute(LdapAttribute a)
          This adds a new attribute to this LdapAttributes.
 void addAttribute(String name, List<?> values)
          This adds a new attribute to this LdapAttributes with the supplied name and values.
 void addAttribute(String name, Object value)
          This adds a new attribute to this LdapAttributes with the supplied name and value.
 void addAttributes(Attributes a)
          This adds the attributes in the supplied Attributes to this LdapAttributes.
 void addAttributes(Collection<LdapAttribute> c)
          This adds a Collection of attributes to this LdapAttributes.
 void clear()
          This removes all attributes from this LdapAttributes.
 LdapAttribute getAttribute(String name)
          This returns the LdapAttribute for this LdapAttributes with the supplied name.
 String[] getAttributeNames()
          This returns an array of all the attribute names for this LdapAttributes.
 Collection<LdapAttribute> getAttributes()
          This returns a Collection of LdapAttribute for this LdapAttributes.
 int hashCode()
          This returns the hash code for this object.
 void removeAttribute(LdapAttribute a)
          This removes an attribute from this LdapAttributes.
 void removeAttribute(String name)
          This removes the attribute with the supplied name.
 void removeAttributes(Attributes a)
          This removes the attributes in the supplied Attributes from this LdapAttributes.
 void removeAttributes(Collection<LdapAttribute> c)
          This removes a Collection of attributes from this LdapAttributes.
 int size()
          This returns the number of attributes in this attributes.
 Attributes toAttributes()
          This returns an Attributes that represents this entry.
 String toString()
          This returns a string representation of this object.
 
Methods inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_IGNORE_CASE

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

See Also:
Constant Field Values

HASH_CODE_SEED

protected static final int HASH_CODE_SEED
hash code seed.

See Also:
Constant Field Values

attributes

protected T extends Map<String,LdapAttribute> attributes
Attributes contained in this bean.

Constructor Detail

AbstractLdapAttributes

public AbstractLdapAttributes(LdapBeanFactory lbf)
Creates a new AbstractLdapAttributes with the supplied ldap bean factory.

Parameters:
lbf - LdapBeanFactory
Method Detail

getAttributes

public Collection<LdapAttribute> getAttributes()
This returns a Collection of LdapAttribute for this LdapAttributes.

Specified by:
getAttributes in interface LdapAttributes
Returns:
List

getAttribute

public LdapAttribute getAttribute(String name)
This returns the LdapAttribute for this LdapAttributes with the supplied name.

Specified by:
getAttribute in interface LdapAttributes
Parameters:
name - String
Returns:
LdapAttribute

getAttributeNames

public String[] getAttributeNames()
This returns an array of all the attribute names for this LdapAttributes.

Specified by:
getAttributeNames in interface LdapAttributes
Returns:
String[]

addAttribute

public void addAttribute(LdapAttribute a)
This adds a new attribute to this LdapAttributes.

Specified by:
addAttribute in interface LdapAttributes
Parameters:
a - LdapAttribute

addAttribute

public void addAttribute(String name,
                         Object value)
This adds a new attribute to this LdapAttributes with the supplied name and value.

Specified by:
addAttribute in interface LdapAttributes
Parameters:
name - String
value - Object

addAttribute

public void addAttribute(String name,
                         List<?> values)
This adds a new attribute to this LdapAttributes with the supplied name and values.

Specified by:
addAttribute in interface LdapAttributes
Parameters:
name - String
values - List

addAttributes

public void addAttributes(Collection<LdapAttribute> c)
This adds a Collection of attributes to this LdapAttributes. The collection should contain LdapAttribute objects.

Specified by:
addAttributes in interface LdapAttributes
Parameters:
c - Collection

addAttributes

public void addAttributes(Attributes a)
                   throws NamingException
This adds the attributes in the supplied Attributes to this LdapAttributes.

Specified by:
addAttributes in interface LdapAttributes
Parameters:
a - Attributes
Throws:
NamingException - if the attributes cannot be read

removeAttribute

public void removeAttribute(LdapAttribute a)
This removes an attribute from this LdapAttributes.

Specified by:
removeAttribute in interface LdapAttributes
Parameters:
a - LdapAttribute

removeAttribute

public void removeAttribute(String name)
This removes the attribute with the supplied name.

Specified by:
removeAttribute in interface LdapAttributes
Parameters:
name - String

removeAttributes

public void removeAttributes(Collection<LdapAttribute> c)
This removes a Collection of attributes from this LdapAttributes. The collection should contain LdapAttribute objects.

Specified by:
removeAttributes in interface LdapAttributes
Parameters:
c - Collection

removeAttributes

public void removeAttributes(Attributes a)
                      throws NamingException
This removes the attributes in the supplied Attributes from this LdapAttributes.

Specified by:
removeAttributes in interface LdapAttributes
Parameters:
a - Attributes
Throws:
NamingException - if the attributes cannot be read

size

public int size()
This returns the number of attributes in this attributes.

Specified by:
size in interface LdapAttributes
Returns:
int

clear

public void clear()
This removes all attributes from this LdapAttributes.

Specified by:
clear in interface LdapAttributes

hashCode

public int hashCode()
This returns the hash code for this object.

Specified by:
hashCode in class AbstractLdapBean
Returns:
int

toString

public String toString()
This returns a string representation of this object.

Overrides:
toString in class Object
Returns:
String

toAttributes

public Attributes toAttributes()
This returns an Attributes that represents this entry.

Specified by:
toAttributes in interface LdapAttributes
Returns:
Attributes


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