Class LDAPGenericObject

java.lang.Object
de.hybris.platform.ldap.connection.LDAPGenericObject

public class LDAPGenericObject extends Object
Implements a generic LDAP object to store the information requested from the LDAP server
  • Constructor Details

    • LDAPGenericObject

      public LDAPGenericObject(ConfigValueObject config) throws NamingException
      Creates a new instance of LdapGenericObject
      Throws:
      NamingException
    • LDAPGenericObject

      public LDAPGenericObject(ConfigValueObject config, Attributes attribs) throws NamingException
      Throws:
      NamingException
    • LDAPGenericObject

      public LDAPGenericObject(SearchResult searchResult, String base) throws NamingException
      Parameters:
      searchResult -
      base -
      Throws:
      NamingException
    • LDAPGenericObject

      public LDAPGenericObject(LdapContext context, String name, String base)
      Creates a new instance of LDAPGenericObject
      Parameters:
      context - The javax.naming.ldap.LdapContext containig the requested data
      name - the name of the object relative to the base
      base - the base name of the object
    • LDAPGenericObject

      public LDAPGenericObject(ConfigValueObject config, LdapContext context, String name, String base)
      Creates a new instance of LDAPGenericObject
      Parameters:
      context - The javax.naming.ldap.LdapContext containig the requested data
      name - the name of the object relative to the base
      base - the base name of the object
    • LDAPGenericObject

      public LDAPGenericObject(LdapContext context, String name, String base, String hybrisTypeCode)
      Creates a new instance of LDAPGenericObject
      Parameters:
      context - The javax.naming.ldap.LdapContext containig the requested data
      name - the name of the object relative to the base
      base - the base name of the object
      hybrisTypeCode - the code of the type which is mapped to the objectClass of the corresponding ldap value
    • LDAPGenericObject

      public LDAPGenericObject(ConfigValueObject config, LdapContext context, String name, String base, String hybrisTypeCode)
      Creates a new instance of LDAPGenericObject
      Parameters:
      context - The javax.naming.ldap.LdapContext containig the requested data
      name - the name of the object relative to the base
      base - the base name of the object
      hybrisTypeCode - the code of the type which is mapped to the objectClass of the corresponding ldap value
  • Method Details

    • getName

      public String getName()
      Retrieves the object's name relative to the base
      Returns:
      the relative name.
    • getBase

      public 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 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 Hashtable<String,List> getAttributes()
      Retrieves the attributes of the object as a HashTable containing Lists for each attribute.
      Returns:
      the attribute hash
    • getAttribute

      public List getAttribute(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(String key, List values)
      Add a attribute with its values to the generic object
      Parameters:
      key - The name of the attribute
      values - the List containing the values of the attribute represented as Strings
    • setAttribute

      public void setAttribute(String key, NamingEnumeration enumerationValues) throws NamingException
      Add a attribute with its values to the generic object
      Parameters:
      key - The name of the attribute
      enumerationValues - the NamingEnumeration containing the values of the attribute represented as Strings
      Throws:
      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(Attribute attribute) throws NamingException
      Add a attribute with its values to the generic object
      Parameters:
      attribute - The javax.naming.directory.Attribute to add to the generic object
      Throws:
      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(Attributes attributes) throws NamingException
      Add attributes with their values to the generic object
      Parameters:
      attributes - The javax.naming.directory.Attributes to add to the generic object
      Throws:
      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(String code)
    • getHybrisTypeCode

      public String getHybrisTypeCode()
    • getValue

      public String getValue()
    • getDN

      public String getDN()