Class LDAPManager

All Implemented Interfaces:
ItemLifecycleListener, Serializable

public class LDAPManager extends GeneratedLDAPManager
See Also:
  • Constructor Details

    • LDAPManager

      public LDAPManager()
  • Method Details

    • getInstance

      public static LDAPManager getInstance()
    • getConfig

      public final LDAPConfigProxyItem getConfig()
    • getPlatformUserLogins

      protected final Collection getPlatformUserLogins()
    • browseLDAP

      public Collection<LDAPGenericObject> browseLDAP(String searchbase, String filter, String[] attrs) throws NamingException
      Throws:
      NamingException
    • browseLDAP

      public Collection<LDAPGenericObject> browseLDAP(String searchbase, String filter, String[] attrs, int limit) throws NamingException
      Throws:
      NamingException
    • browseLDAP

      public Collection<LDAPGenericObject> browseLDAP(LDAPConfigProxyItem config, String searchbase, String personObjectClass, String searchfield, String searchOperation, String searchvalue, String[] attrs) throws NamingException
      Performs a directory sub tree search (i.e. of the next level and all subsequent levels below)

      by generating an search expressions with the help of the assigned parameters

      sample:

      the method call browseLDAP("dc=hybris,dc=de", "inetOrgPerson", "cn", "=", "*", new String[] {"cn", "sn", "modifyTimestamp", "creationTimestamp", "displayName"})

      will perform the search (&(objectclass=inetOrgPerson)(cn=*))

      Parameters:
      searchbase - the domain name (relative to initial context in ldap) to seach from.
      personObjectClass -
      searchfield -
      searchOperation -
      searchvalue -
      attrs - an array of strings containing the names of attributes to search. (null = all, empty array = none)
      Returns:
      Collection of LDAPGenericObjects
      Throws:
      NamingException
    • checkPassword

      public boolean checkPassword(User user, char[] plainPassword)
      Handles the LDAP authentification process

      This process passes the following steps:

      1. Loading the configured LDAP searchbase (User attribute). -- This value is mandatory! 2. Loading the configured LDAP account (User attribute). -- This value is optional! Note: If this value is , the hybris (hmc) login will be used instead! 3. Loading the configured domain (User attribute). -- This value is optional (Only usefull in an ActiveDirectory environement) 4. Calling checkPassword(final String searchbase, final String login, final char[] plainPassword ), with the submitted/acquired values

      Parameters:
      user - the hybris (hmc) user
      plainPassword - the ldap password
      Returns:
      success
    • checkPassword

      public boolean checkPassword(String searchbase, String login, char[] plainPassword) throws NamingException
      Throws:
      NamingException
    • createEssentialData

      public void createEssentialData(Map _values, JspContext jspc) throws Exception
      Overrides:
      createEssentialData in class Extension
      Throws:
      Exception
    • createDefaultLDIFImportCronJob

      @Deprecated(since="ages", forRemoval=false) public LDIFImportCronJob createDefaultLDIFImportCronJob(boolean enableCodeExecution)
      Deprecated.
      since ages
    • createDefaultLDIFImportCronJob

      public LDIFImportCronJob createDefaultLDIFImportCronJob()
    • createDefaultLDIFGroupImportCronJob

      public LDIFGroupImportCronJob createDefaultLDIFGroupImportCronJob()
    • createDefaultLDIFImportCronJob

      @Deprecated(since="ages", forRemoval=false) public LDIFImportCronJob createDefaultLDIFImportCronJob(LDIFImportJob ldifImportJob)
      Deprecated.
      since ages
    • createDefaultLDIFImportCronJob

      public LDIFImportCronJob createDefaultLDIFImportCronJob(LDIFImportJob ldifImportJob, boolean enableCodeExecution)
    • createDefaultLDIFGroupImportCronJob

      public LDIFGroupImportCronJob createDefaultLDIFGroupImportCronJob(LDIFGroupImportJob ldifImportJob, boolean enableCodeExecution)
    • getOrCreateLDIFImportJob

      public LDIFImportJob getOrCreateLDIFImportJob()
    • getOrCreateLDIFGroupImportJob

      public LDIFGroupImportJob getOrCreateLDIFGroupImportJob()
    • createLDIFImportJob

      public LDIFImportJob createLDIFImportJob(Map attributeValues)
      Overrides:
      createLDIFImportJob in class GeneratedLDAPManager
    • isCreatorDisabled

      public boolean isCreatorDisabled()
      Part of DataCreator interface. This default implementation returns false.
      Overrides:
      isCreatorDisabled in class Extension
      Returns:
      false
    • cleanse

      public String cleanse(String input)