Class LDAPGenericObject
- java.lang.Object
-
- de.hybris.platform.ldap.connection.LDAPGenericObject
-
public class LDAPGenericObject extends java.lang.ObjectImplements a generic LDAP object to store the information requested from the LDAP server
-
-
Constructor Summary
Constructors Constructor Description LDAPGenericObject(ConfigValueObject config)Creates a new instance of LdapGenericObjectLDAPGenericObject(ConfigValueObject config, javax.naming.directory.Attributes attribs)LDAPGenericObject(ConfigValueObject config, javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base)Creates a new instance of LDAPGenericObjectLDAPGenericObject(ConfigValueObject config, javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base, java.lang.String hybrisTypeCode)Creates a new instance of LDAPGenericObjectLDAPGenericObject(javax.naming.directory.SearchResult searchResult, java.lang.String base)LDAPGenericObject(javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base)Creates a new instance of LDAPGenericObjectLDAPGenericObject(javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base, java.lang.String hybrisTypeCode)Creates a new instance of LDAPGenericObject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAbsoluteName()Retrieves the absolute name of object, which is a combination of the base name and the relative namejava.util.ListgetAttribute(java.lang.String key)Retrieves a single named attribute as a List of Stringsjava.util.Hashtable<java.lang.String,java.util.List>getAttributes()Retrieves the attributes of the object as a HashTable containing Lists for each attribute.java.lang.StringgetBase()Retrieves the base name of the object.java.lang.StringgetDN()java.lang.StringgetHybrisTypeCode()java.lang.StringgetName()Retrieves the object's name relative to the basejava.lang.StringgetValue()voidsetAttribute(java.lang.String key, java.util.List values)Add a attribute with its values to the generic objectvoidsetAttribute(java.lang.String key, javax.naming.NamingEnumeration enumerationValues)Add a attribute with its values to the generic objectvoidsetAttribute(javax.naming.directory.Attribute attribute)Add a attribute with its values to the generic objectvoidsetAttributes(javax.naming.directory.Attributes attributes)Add attributes with their values to the generic objectvoidsetHybrisTypeCode(java.lang.String code)
-
-
-
Constructor Detail
-
LDAPGenericObject
public LDAPGenericObject(ConfigValueObject config) throws javax.naming.NamingException
Creates a new instance of LdapGenericObject- Throws:
javax.naming.NamingException
-
LDAPGenericObject
public LDAPGenericObject(ConfigValueObject config, javax.naming.directory.Attributes attribs) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
LDAPGenericObject
public LDAPGenericObject(javax.naming.directory.SearchResult searchResult, java.lang.String base) throws javax.naming.NamingException- Parameters:
searchResult-base-- Throws:
javax.naming.NamingException
-
LDAPGenericObject
public LDAPGenericObject(javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base)Creates a new instance of LDAPGenericObject- Parameters:
context- The javax.naming.ldap.LdapContext containig the requested dataname- the name of the object relative to the basebase- the base name of the object
-
LDAPGenericObject
public LDAPGenericObject(ConfigValueObject config, javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base)
Creates a new instance of LDAPGenericObject- Parameters:
context- The javax.naming.ldap.LdapContext containig the requested dataname- the name of the object relative to the basebase- the base name of the object
-
LDAPGenericObject
public LDAPGenericObject(javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base, java.lang.String hybrisTypeCode)Creates a new instance of LDAPGenericObject- Parameters:
context- The javax.naming.ldap.LdapContext containig the requested dataname- the name of the object relative to the basebase- the base name of the objecthybrisTypeCode- the code of the type which is mapped to the objectClass of the corresponding ldap value
-
LDAPGenericObject
public LDAPGenericObject(ConfigValueObject config, javax.naming.ldap.LdapContext context, java.lang.String name, java.lang.String base, java.lang.String hybrisTypeCode)
Creates a new instance of LDAPGenericObject- Parameters:
context- The javax.naming.ldap.LdapContext containig the requested dataname- the name of the object relative to the basebase- the base name of the objecthybrisTypeCode- the code of the type which is mapped to the objectClass of the corresponding ldap value
-
-
Method Detail
-
getName
public java.lang.String getName()
Retrieves the object's name relative to the base- Returns:
- the relative name.
-
getBase
public java.lang.String getBase()
Retrieves the base name of the object. In most cases this is the search base used to request the objects from the LDAP server- Returns:
- the base name
-
getAbsoluteName
public java.lang.String getAbsoluteName()
Retrieves the absolute name of object, which is a combination of the base name and the relative name- Returns:
- the absolute name.
-
getAttributes
public java.util.Hashtable<java.lang.String,java.util.List> getAttributes()
Retrieves the attributes of the object as a HashTable containing Lists for each attribute.- Returns:
- the attribute hash
-
getAttribute
public java.util.List getAttribute(java.lang.String key)
Retrieves a single named attribute as a List of Strings- Parameters:
key- the name of attribute, eg. "cn"- Returns:
- the List of all requested attribute values
-
setAttribute
public void setAttribute(java.lang.String key, java.util.List values)Add a attribute with its values to the generic object- Parameters:
key- The name of the attributevalues- the List containing the values of the attribute represented as Strings
-
setAttribute
public void setAttribute(java.lang.String key, javax.naming.NamingEnumeration enumerationValues) throws javax.naming.NamingExceptionAdd a attribute with its values to the generic object- Parameters:
key- The name of the attributeenumerationValues- the NamingEnumeration containing the values of the attribute represented as Strings- Throws:
javax.naming.NamingException- if a naming exception is encountered while attempting to retrieve the elements. See javax.naming.NamingException and its subclasses for the possible naming exceptions.
-
setAttribute
public void setAttribute(javax.naming.directory.Attribute attribute) throws javax.naming.NamingExceptionAdd a attribute with its values to the generic object- Parameters:
attribute- The javax.naming.directory.Attribute to add to the generic object- Throws:
javax.naming.NamingException- if a naming exception is encountered while attempting to retrieve the elements. See javax.naming.NamingException and its subclasses for the possible naming exceptions.
-
setAttributes
public void setAttributes(javax.naming.directory.Attributes attributes) throws javax.naming.NamingExceptionAdd attributes with their values to the generic object- Parameters:
attributes- The javax.naming.directory.Attributes to add to the generic object- Throws:
javax.naming.NamingException- if a naming exception is encountered while attempting to retrieve the elements. See javax.naming.NamingException and its subclasses for the possible naming exceptions.
-
setHybrisTypeCode
public void setHybrisTypeCode(java.lang.String code)
-
getHybrisTypeCode
public java.lang.String getHybrisTypeCode()
-
getValue
public java.lang.String getValue()
-
getDN
public java.lang.String getDN()
-
-