Class LdapClient


  • @Component
    public class LdapClient
    extends Object
    Class for Ldap access.
    • Constructor Detail

      • LdapClient

        @Autowired
        public LdapClient​(org.springframework.core.env.Environment env,
                          org.springframework.ldap.core.LdapTemplate ldapTemplate,
                          TaskanaEngineConfiguration taskanaEngineConfiguration)
    • Method Detail

      • searchUsersAndGroups

        public List<AccessIdRepresentationModel> searchUsersAndGroups​(String name)
                                                               throws pro.taskana.common.api.exceptions.InvalidArgumentException
        Search LDAP for matching users or groups.
        Parameters:
        name - lookup string for names or groups
        Returns:
        a list of AccessIdResources sorted by AccessId and limited to maxNumberOfReturnedAccessIds
        Throws:
        pro.taskana.common.api.exceptions.InvalidArgumentException - if input is shorter than minSearchForLength
      • searchUsersByNameOrAccessIdInUserRole

        public List<AccessIdRepresentationModel> searchUsersByNameOrAccessIdInUserRole​(String nameOrAccessId)
                                                                                throws pro.taskana.common.api.exceptions.InvalidArgumentException
        Throws:
        pro.taskana.common.api.exceptions.InvalidArgumentException
      • searchUsersByNameOrAccessId

        public List<AccessIdRepresentationModel> searchUsersByNameOrAccessId​(String name)
                                                                      throws pro.taskana.common.api.exceptions.InvalidArgumentException
        Throws:
        pro.taskana.common.api.exceptions.InvalidArgumentException
      • searchGroupsByName

        public List<AccessIdRepresentationModel> searchGroupsByName​(String name)
                                                             throws pro.taskana.common.api.exceptions.InvalidArgumentException
        Throws:
        pro.taskana.common.api.exceptions.InvalidArgumentException
      • searchGroupsAccessIdIsMemberOf

        public List<AccessIdRepresentationModel> searchGroupsAccessIdIsMemberOf​(String accessId)
                                                                         throws pro.taskana.common.api.exceptions.InvalidArgumentException
        Throws:
        pro.taskana.common.api.exceptions.InvalidArgumentException
      • validateAccessId

        public boolean validateAccessId​(String name)
        Validates a given AccessId / name.
        Parameters:
        name - lookup string for names or groups
        Returns:
        whether the given name is valid or not
      • getUserSearchBase

        public String getUserSearchBase()
      • getUserSearchFilterName

        public String getUserSearchFilterName()
      • getUserSearchFilterValue

        public String getUserSearchFilterValue()
      • getUserFirstnameAttribute

        public String getUserFirstnameAttribute()
      • getUserLastnameAttribute

        public String getUserLastnameAttribute()
      • getUserIdAttribute

        public String getUserIdAttribute()
      • getUserMemberOfGroupAttribute

        public String getUserMemberOfGroupAttribute()
      • getGroupSearchBase

        public String getGroupSearchBase()
      • getBaseDn

        public String getBaseDn()
      • getGroupSearchFilterName

        public String getGroupSearchFilterName()
      • getGroupSearchFilterValue

        public String getGroupSearchFilterValue()
      • getGroupNameAttribute

        public String getGroupNameAttribute()
      • calcMinSearchForLength

        public int calcMinSearchForLength​(int defaultValue)
      • getMinSearchForLength

        public int getMinSearchForLength()
      • calcMaxNumberOfReturnedAccessIds

        public int calcMaxNumberOfReturnedAccessIds​(int defaultValue)
      • getMaxNumberOfReturnedAccessIds

        public int getMaxNumberOfReturnedAccessIds()
      • getGroupsOfUser

        public String getGroupsOfUser()
      • isUser

        public boolean isUser​(String accessId)