Package edu.vt.middleware.ldap.bean
Class AbstractLdapAttributes<T extends java.util.Map<java.lang.String,LdapAttribute>>
- java.lang.Object
-
- edu.vt.middleware.ldap.bean.AbstractLdapBean
-
- 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 java.util.Map<java.lang.String,LdapAttribute>> extends AbstractLdapBean implements LdapAttributes
AbstractLdapAttributesprovides a base implementation ofLdapAttributeswhere the underlying attributes are backed by aMap.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected TattributesAttributes contained in this bean.static booleanDEFAULT_IGNORE_CASEWhether to ignore case when creatingBasicAttributes.protected static intHASH_CODE_SEEDhash code seed.-
Fields inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
beanFactory, logger
-
-
Constructor Summary
Constructors Constructor Description AbstractLdapAttributes(LdapBeanFactory lbf)Creates a newAbstractLdapAttributeswith the supplied ldap bean factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(LdapAttribute a)This adds a new attribute to thisLdapAttributes.voidaddAttribute(java.lang.String name, java.lang.Object value)This adds a new attribute to thisLdapAttributeswith the supplied name and value.voidaddAttribute(java.lang.String name, java.util.List<?> values)This adds a new attribute to thisLdapAttributeswith the supplied name and values.voidaddAttributes(java.util.Collection<LdapAttribute> c)This adds aCollectionof attributes to thisLdapAttributes.voidaddAttributes(javax.naming.directory.Attributes a)This adds the attributes in the suppliedAttributesto thisLdapAttributes.voidclear()This removes all attributes from thisLdapAttributes.LdapAttributegetAttribute(java.lang.String name)This returns theLdapAttributefor thisLdapAttributeswith the supplied name.java.lang.String[]getAttributeNames()This returns an array of all the attribute names for thisLdapAttributes.java.util.Collection<LdapAttribute>getAttributes()This returns aCollectionofLdapAttributefor thisLdapAttributes.inthashCode()This returns the hash code for this object.voidremoveAttribute(LdapAttribute a)This removes an attribute from thisLdapAttributes.voidremoveAttribute(java.lang.String name)This removes the attribute with the supplied name.voidremoveAttributes(java.util.Collection<LdapAttribute> c)This removes aCollectionof attributes from thisLdapAttributes.voidremoveAttributes(javax.naming.directory.Attributes a)This removes the attributes in the suppliedAttributesfrom thisLdapAttributes.intsize()This returns the number of attributes in this attributes.javax.naming.directory.AttributestoAttributes()This returns anAttributesthat represents this entry.java.lang.StringtoString()This returns a string representation of this object.-
Methods inherited from class edu.vt.middleware.ldap.bean.AbstractLdapBean
equals
-
-
-
-
Field Detail
-
DEFAULT_IGNORE_CASE
public static final boolean DEFAULT_IGNORE_CASE
Whether to ignore case when creatingBasicAttributes.- 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 java.util.Map<java.lang.String,LdapAttribute> attributes
Attributes contained in this bean.
-
-
Constructor Detail
-
AbstractLdapAttributes
public AbstractLdapAttributes(LdapBeanFactory lbf)
Creates a newAbstractLdapAttributeswith the supplied ldap bean factory.- Parameters:
lbf-LdapBeanFactory
-
-
Method Detail
-
getAttributes
public java.util.Collection<LdapAttribute> getAttributes()
This returns aCollectionofLdapAttributefor thisLdapAttributes.- Specified by:
getAttributesin interfaceLdapAttributes- Returns:
List
-
getAttribute
public LdapAttribute getAttribute(java.lang.String name)
This returns theLdapAttributefor thisLdapAttributeswith the supplied name.- Specified by:
getAttributein interfaceLdapAttributes- Parameters:
name-String- Returns:
LdapAttribute
-
getAttributeNames
public java.lang.String[] getAttributeNames()
This returns an array of all the attribute names for thisLdapAttributes.- Specified by:
getAttributeNamesin interfaceLdapAttributes- Returns:
String[]
-
addAttribute
public void addAttribute(LdapAttribute a)
This adds a new attribute to thisLdapAttributes.- Specified by:
addAttributein interfaceLdapAttributes- Parameters:
a-LdapAttribute
-
addAttribute
public void addAttribute(java.lang.String name, java.lang.Object value)This adds a new attribute to thisLdapAttributeswith the supplied name and value.- Specified by:
addAttributein interfaceLdapAttributes- Parameters:
name-Stringvalue-Object
-
addAttribute
public void addAttribute(java.lang.String name, java.util.List<?> values)This adds a new attribute to thisLdapAttributeswith the supplied name and values.- Specified by:
addAttributein interfaceLdapAttributes- Parameters:
name-Stringvalues-List
-
addAttributes
public void addAttributes(java.util.Collection<LdapAttribute> c)
This adds aCollectionof attributes to thisLdapAttributes. The collection should containLdapAttributeobjects.- Specified by:
addAttributesin interfaceLdapAttributes- Parameters:
c-Collection
-
addAttributes
public void addAttributes(javax.naming.directory.Attributes a) throws javax.naming.NamingExceptionThis adds the attributes in the suppliedAttributesto thisLdapAttributes.- Specified by:
addAttributesin interfaceLdapAttributes- Parameters:
a-Attributes- Throws:
javax.naming.NamingException- if the attributes cannot be read
-
removeAttribute
public void removeAttribute(LdapAttribute a)
This removes an attribute from thisLdapAttributes.- Specified by:
removeAttributein interfaceLdapAttributes- Parameters:
a-LdapAttribute
-
removeAttribute
public void removeAttribute(java.lang.String name)
This removes the attribute with the supplied name.- Specified by:
removeAttributein interfaceLdapAttributes- Parameters:
name-String
-
removeAttributes
public void removeAttributes(java.util.Collection<LdapAttribute> c)
This removes aCollectionof attributes from thisLdapAttributes. The collection should containLdapAttributeobjects.- Specified by:
removeAttributesin interfaceLdapAttributes- Parameters:
c-Collection
-
removeAttributes
public void removeAttributes(javax.naming.directory.Attributes a) throws javax.naming.NamingExceptionThis removes the attributes in the suppliedAttributesfrom thisLdapAttributes.- Specified by:
removeAttributesin interfaceLdapAttributes- Parameters:
a-Attributes- Throws:
javax.naming.NamingException- if the attributes cannot be read
-
size
public int size()
This returns the number of attributes in this attributes.- Specified by:
sizein interfaceLdapAttributes- Returns:
int
-
clear
public void clear()
This removes all attributes from thisLdapAttributes.- Specified by:
clearin interfaceLdapAttributes
-
hashCode
public int hashCode()
This returns the hash code for this object.- Specified by:
hashCodein classAbstractLdapBean- Returns:
int
-
toString
public java.lang.String toString()
This returns a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
String
-
toAttributes
public javax.naming.directory.Attributes toAttributes()
This returns anAttributesthat represents this entry.- Specified by:
toAttributesin interfaceLdapAttributes- Returns:
Attributes
-
-