Class LdapManager


  • public class LdapManager
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LdapManager()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addGroupAttributes​(javax.naming.directory.BasicAttributes entry, Group group)  
      protected void addRoleAttributes​(javax.naming.directory.BasicAttributes entry, Role user)  
      protected void addUserAttributes​(javax.naming.directory.BasicAttributes entry, User user)  
      void apply​(Group group)  
      void apply​(User user)  
      boolean changePassword​(java.lang.String username, java.lang.String password)  
      protected java.util.Hashtable<java.lang.String,​java.lang.String> createAdminEnv()  
      protected java.util.Hashtable<java.lang.String,​java.lang.String> createEnvironment​(java.lang.String initialContextFactory, java.lang.String securityAuthentication, java.lang.String providerUrl, java.lang.String principal, java.lang.String credntials)  
      protected LdapUser createLdapUser​(java.lang.String username, java.util.Hashtable<java.lang.String,​java.lang.String> env)  
      protected java.util.Hashtable<java.lang.String,​java.lang.String> createSearchEnv()  
      protected java.util.Hashtable<java.lang.String,​java.lang.String> createSearchEnv​(java.lang.String username, java.lang.String password)  
      protected void delete​(java.lang.String entryDN, java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)  
      void delete​(Group group)  
      void delete​(Role role)  
      void delete​(User user)  
      protected java.util.List<java.lang.Object> getAttributeValueList​(java.util.List<javax.naming.directory.SearchResult> result, java.lang.String name)  
      protected LdapManager.DirContextHolder getDirContext​(java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)  
      java.lang.String[] getRoles​(LdapUser ldapUser, java.lang.String bindDn, java.lang.String accountFilter, java.lang.String groupFilter)  
      protected java.lang.String getSearchRoleName​(java.lang.String entryDn)  
      void init()  
      protected void insert​(java.lang.String entryDN, javax.naming.directory.Attributes entry, java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)  
      void insert​(Group group)  
      void insert​(Role role)  
      void insert​(User user)  
      org.dbflute.optional.OptionalEntity<FessUser> login​(java.lang.String username)  
      org.dbflute.optional.OptionalEntity<FessUser> login​(java.lang.String username, java.lang.String password)  
      protected void modify​(java.lang.String dn, java.util.List<javax.naming.directory.ModificationItem> modifyList, java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)  
      protected void modifyAddEntry​(java.util.List<javax.naming.directory.ModificationItem> modifyList, java.lang.String name, java.lang.String value)  
      protected void modifyDeleteEntry​(java.util.List<javax.naming.directory.ModificationItem> modifyList, java.lang.String name, java.lang.Object value)  
      protected void modifyGroupAttributes​(Group group, java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> adminEnv, java.lang.String entryDN, java.util.List<javax.naming.directory.SearchResult> result)  
      protected void modifyReplaceEntry​(java.util.List<javax.naming.directory.ModificationItem> modifyList, java.lang.String name, java.lang.String value)  
      protected void modifyUserAttributes​(User user, java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> adminEnv, java.lang.String userDN, java.util.List<javax.naming.directory.SearchResult> result)  
      protected void processSearchRoles​(java.util.List<javax.naming.directory.SearchResult> result, java.util.function.BiConsumer<java.lang.String,​java.lang.String> consumer)  
      protected void processSearchRoles​(java.util.List<javax.naming.directory.SearchResult> result, java.util.function.Consumer<java.lang.String> consumer)  
      protected void processSubRoles​(LdapUser ldapUser, java.lang.String bindDn, java.lang.String dn, java.lang.String groupFilter, java.util.Set<java.lang.String> roleSet)  
      protected void search​(java.lang.String baseDn, java.lang.String filter, java.lang.String[] returningAttrs, java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier, org.codelibs.fess.ldap.LdapManager.SearcConsumer consumer)  
      protected void setAttributeValue​(java.util.List<javax.naming.directory.SearchResult> result, java.lang.String name, java.util.function.Consumer<java.lang.Object> consumer)  
      void updateConfig()  
      protected void updateSearchRoles​(java.util.Set<java.lang.String> roleSet, java.lang.String entryDn)  
      protected boolean validate()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LdapManager

        public LdapManager()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • createEnvironment

        protected java.util.Hashtable<java.lang.String,​java.lang.String> createEnvironment​(java.lang.String initialContextFactory,
                                                                                                 java.lang.String securityAuthentication,
                                                                                                 java.lang.String providerUrl,
                                                                                                 java.lang.String principal,
                                                                                                 java.lang.String credntials)
      • createAdminEnv

        protected java.util.Hashtable<java.lang.String,​java.lang.String> createAdminEnv()
      • createSearchEnv

        protected java.util.Hashtable<java.lang.String,​java.lang.String> createSearchEnv​(java.lang.String username,
                                                                                               java.lang.String password)
      • createSearchEnv

        protected java.util.Hashtable<java.lang.String,​java.lang.String> createSearchEnv()
      • updateConfig

        public void updateConfig()
      • validate

        protected boolean validate()
      • login

        public org.dbflute.optional.OptionalEntity<FessUser> login​(java.lang.String username,
                                                                   java.lang.String password)
      • login

        public org.dbflute.optional.OptionalEntity<FessUser> login​(java.lang.String username)
      • createLdapUser

        protected LdapUser createLdapUser​(java.lang.String username,
                                          java.util.Hashtable<java.lang.String,​java.lang.String> env)
      • getRoles

        public java.lang.String[] getRoles​(LdapUser ldapUser,
                                           java.lang.String bindDn,
                                           java.lang.String accountFilter,
                                           java.lang.String groupFilter)
      • processSubRoles

        protected void processSubRoles​(LdapUser ldapUser,
                                       java.lang.String bindDn,
                                       java.lang.String dn,
                                       java.lang.String groupFilter,
                                       java.util.Set<java.lang.String> roleSet)
      • updateSearchRoles

        protected void updateSearchRoles​(java.util.Set<java.lang.String> roleSet,
                                         java.lang.String entryDn)
      • processSearchRoles

        protected void processSearchRoles​(java.util.List<javax.naming.directory.SearchResult> result,
                                          java.util.function.BiConsumer<java.lang.String,​java.lang.String> consumer)
                                   throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • processSearchRoles

        protected void processSearchRoles​(java.util.List<javax.naming.directory.SearchResult> result,
                                          java.util.function.Consumer<java.lang.String> consumer)
                                   throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • getSearchRoleName

        protected java.lang.String getSearchRoleName​(java.lang.String entryDn)
      • setAttributeValue

        protected void setAttributeValue​(java.util.List<javax.naming.directory.SearchResult> result,
                                         java.lang.String name,
                                         java.util.function.Consumer<java.lang.Object> consumer)
      • getAttributeValueList

        protected java.util.List<java.lang.Object> getAttributeValueList​(java.util.List<javax.naming.directory.SearchResult> result,
                                                                         java.lang.String name)
      • apply

        public void apply​(User user)
      • insert

        public void insert​(User user)
      • modifyUserAttributes

        protected void modifyUserAttributes​(User user,
                                            java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> adminEnv,
                                            java.lang.String userDN,
                                            java.util.List<javax.naming.directory.SearchResult> result)
      • addUserAttributes

        protected void addUserAttributes​(javax.naming.directory.BasicAttributes entry,
                                         User user)
      • delete

        public void delete​(User user)
      • insert

        public void insert​(Role role)
      • addRoleAttributes

        protected void addRoleAttributes​(javax.naming.directory.BasicAttributes entry,
                                         Role user)
      • delete

        public void delete​(Role role)
      • apply

        public void apply​(Group group)
      • insert

        public void insert​(Group group)
      • modifyGroupAttributes

        protected void modifyGroupAttributes​(Group group,
                                             java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> adminEnv,
                                             java.lang.String entryDN,
                                             java.util.List<javax.naming.directory.SearchResult> result)
      • addGroupAttributes

        protected void addGroupAttributes​(javax.naming.directory.BasicAttributes entry,
                                          Group group)
      • delete

        public void delete​(Group group)
      • changePassword

        public boolean changePassword​(java.lang.String username,
                                      java.lang.String password)
      • insert

        protected void insert​(java.lang.String entryDN,
                              javax.naming.directory.Attributes entry,
                              java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)
      • delete

        protected void delete​(java.lang.String entryDN,
                              java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)
      • search

        protected void search​(java.lang.String baseDn,
                              java.lang.String filter,
                              java.lang.String[] returningAttrs,
                              java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier,
                              org.codelibs.fess.ldap.LdapManager.SearcConsumer consumer)
      • modifyAddEntry

        protected void modifyAddEntry​(java.util.List<javax.naming.directory.ModificationItem> modifyList,
                                      java.lang.String name,
                                      java.lang.String value)
      • modifyReplaceEntry

        protected void modifyReplaceEntry​(java.util.List<javax.naming.directory.ModificationItem> modifyList,
                                          java.lang.String name,
                                          java.lang.String value)
      • modifyDeleteEntry

        protected void modifyDeleteEntry​(java.util.List<javax.naming.directory.ModificationItem> modifyList,
                                         java.lang.String name,
                                         java.lang.Object value)
      • modify

        protected void modify​(java.lang.String dn,
                              java.util.List<javax.naming.directory.ModificationItem> modifyList,
                              java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)
      • getDirContext

        protected LdapManager.DirContextHolder getDirContext​(java.util.function.Supplier<java.util.Hashtable<java.lang.String,​java.lang.String>> envSupplier)