Class LDAPGenericObject


  • public class LDAPGenericObject
    extends java.lang.Object
    Implements 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 LdapGenericObject
      LDAPGenericObject​(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 LDAPGenericObject
      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
      LDAPGenericObject​(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 LDAPGenericObject
      LDAPGenericObject​(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.String getAbsoluteName()
      Retrieves the absolute name of object, which is a combination of the base name and the relative name
      java.util.List getAttribute​(java.lang.String key)
      Retrieves a single named attribute as a List of Strings
      java.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.String getBase()
      Retrieves the base name of the object.
      java.lang.String getDN()  
      java.lang.String getHybrisTypeCode()  
      java.lang.String getName()
      Retrieves the object's name relative to the base
      java.lang.String getValue()  
      void setAttribute​(java.lang.String key, java.util.List values)
      Add a attribute with its values to the generic object
      void setAttribute​(java.lang.String key, javax.naming.NamingEnumeration enumerationValues)
      Add a attribute with its values to the generic object
      void setAttribute​(javax.naming.directory.Attribute attribute)
      Add a attribute with its values to the generic object
      void setAttributes​(javax.naming.directory.Attributes attributes)
      Add attributes with their values to the generic object
      void setHybrisTypeCode​(java.lang.String code)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 data
        name - the name of the object relative to the base
        base - 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 data
        name - the name of the object relative to the base
        base - 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 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,
                                 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 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 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 attribute
        values - 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.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:
        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.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:
        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.NamingException
        Add 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()