Class LDAPConfigurator


  • public class LDAPConfigurator
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger logger  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addVLVs​(java.lang.String subsystem)  
      void createBaseEntry​(java.lang.String baseDN)  
      void createChangeLog()  
      void createContainers​(java.lang.String subsystem)  
      void createDatabaseEntry​(java.lang.String databaseDN, java.lang.String database, java.lang.String baseDN)  
      void createIndexes​(java.lang.String subsystem)  
      void createMappingEntry​(java.lang.String mappingDN, java.lang.String database, java.lang.String baseDN)  
      boolean createReplicaObject​(java.lang.String bindUser, int id)
      This method creates or updates a replica object.
      void createReplicationAgreement​(java.lang.String name, java.lang.String replicaHostname, int replicaPort, java.lang.String bindUser, java.lang.String replicaPassword, java.lang.String replicationSecurity)  
      void createReplicationManager​(java.lang.String bindUser, java.lang.String pwd)  
      void createSystemContainer()  
      void customizeFile​(java.io.File file, java.io.File tmpFile)  
      void deleteDatabase​(java.lang.String database, java.lang.String baseDN)  
      void deleteEntry​(java.lang.String dn)  
      void deleteVLVs()  
      java.util.List<netscape.ldap.LDAPEntry> findVLVs()  
      netscape.ldap.LDAPConnection getConnection()  
      netscape.ldap.LDAPEntry getEntry​(java.lang.String dn)  
      java.lang.String getInstanceDir()  
      java.util.Map<java.lang.String,​java.lang.String> getParams()  
      java.lang.String getReplicationStatus​(java.lang.String replicaDN, java.lang.String agreementName)  
      java.util.Collection<netscape.ldap.util.LDIFRecord> importLDIF​(java.lang.String filename, boolean ignoreErrors)  
      void importLDIFRecord​(netscape.ldap.util.LDIFRecord record, boolean ignoreErrors)  
      void importSchemaFile​(java.lang.String filename)  
      void importSchemaRecord​(netscape.ldap.util.LDIFRecord record)  
      void initDatabase()  
      void initializeConsumer​(java.lang.String agreementName)  
      boolean isReplicationDone​(java.lang.String replicaDN, java.lang.String agreementName)  
      void rebuildIndexes​(java.lang.String subsystem)  
      void reindexVLVs​(java.lang.String subsystem)  
      void setupACL​(java.lang.String subsystem)  
      void setupDatabaseManager()  
      boolean setupReplicationAgreement​(java.lang.String agreementName, java.lang.String bindUser, java.lang.String bindPassword, java.lang.String peerHostname, int peerPort, java.lang.String peerBindUser, java.lang.String peerBindPassword, java.lang.String security, int replicaID)  
      void setupSchema()  
      void validateDatabaseOwnership​(java.lang.String database, java.lang.String baseDN)  
      void waitForTask​(java.lang.String dn)  
      • Methods inherited from class java.lang.Object

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

      • logger

        public static final org.slf4j.Logger logger
    • Constructor Detail

      • LDAPConfigurator

        public LDAPConfigurator​(netscape.ldap.LDAPConnection connection,
                                LDAPConfig config)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • LDAPConfigurator

        public LDAPConfigurator​(netscape.ldap.LDAPConnection connection,
                                LDAPConfig config,
                                java.lang.String instanceID)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • getConnection

        public netscape.ldap.LDAPConnection getConnection()
      • getParams

        public java.util.Map<java.lang.String,​java.lang.String> getParams()
                                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • initDatabase

        public void initDatabase()
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setupSchema

        public void setupSchema()
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createContainers

        public void createContainers​(java.lang.String subsystem)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setupACL

        public void setupACL​(java.lang.String subsystem)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createIndexes

        public void createIndexes​(java.lang.String subsystem)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • rebuildIndexes

        public void rebuildIndexes​(java.lang.String subsystem)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setupDatabaseManager

        public void setupDatabaseManager()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findVLVs

        public java.util.List<netscape.ldap.LDAPEntry> findVLVs()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addVLVs

        public void addVLVs​(java.lang.String subsystem)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteVLVs

        public void deleteVLVs()
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • reindexVLVs

        public void reindexVLVs​(java.lang.String subsystem)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getEntry

        public netscape.ldap.LDAPEntry getEntry​(java.lang.String dn)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validateDatabaseOwnership

        public void validateDatabaseOwnership​(java.lang.String database,
                                              java.lang.String baseDN)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteEntry

        public void deleteEntry​(java.lang.String dn)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • waitForTask

        public void waitForTask​(java.lang.String dn)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createDatabaseEntry

        public void createDatabaseEntry​(java.lang.String databaseDN,
                                        java.lang.String database,
                                        java.lang.String baseDN)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createMappingEntry

        public void createMappingEntry​(java.lang.String mappingDN,
                                       java.lang.String database,
                                       java.lang.String baseDN)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createBaseEntry

        public void createBaseEntry​(java.lang.String baseDN)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • customizeFile

        public void customizeFile​(java.io.File file,
                                  java.io.File tmpFile)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importLDIF

        public java.util.Collection<netscape.ldap.util.LDIFRecord> importLDIF​(java.lang.String filename,
                                                                              boolean ignoreErrors)
                                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importLDIFRecord

        public void importLDIFRecord​(netscape.ldap.util.LDIFRecord record,
                                     boolean ignoreErrors)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importSchemaFile

        public void importSchemaFile​(java.lang.String filename)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importSchemaRecord

        public void importSchemaRecord​(netscape.ldap.util.LDIFRecord record)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteDatabase

        public void deleteDatabase​(java.lang.String database,
                                   java.lang.String baseDN)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createSystemContainer

        public void createSystemContainer()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createReplicationManager

        public void createReplicationManager​(java.lang.String bindUser,
                                             java.lang.String pwd)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInstanceDir

        public java.lang.String getInstanceDir()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createChangeLog

        public void createChangeLog()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createReplicaObject

        public boolean createReplicaObject​(java.lang.String bindUser,
                                           int id)
                                    throws java.lang.Exception
        This method creates or updates a replica object. If the object did not exist previously, it will add the object and return true. If the object already existed previously, it will add a new replica bind DN and return false. If any of these operation fails, it will throw the exception.
        Throws:
        java.lang.Exception
      • createReplicationAgreement

        public void createReplicationAgreement​(java.lang.String name,
                                               java.lang.String replicaHostname,
                                               int replicaPort,
                                               java.lang.String bindUser,
                                               java.lang.String replicaPassword,
                                               java.lang.String replicationSecurity)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setupReplicationAgreement

        public boolean setupReplicationAgreement​(java.lang.String agreementName,
                                                 java.lang.String bindUser,
                                                 java.lang.String bindPassword,
                                                 java.lang.String peerHostname,
                                                 int peerPort,
                                                 java.lang.String peerBindUser,
                                                 java.lang.String peerBindPassword,
                                                 java.lang.String security,
                                                 int replicaID)
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • initializeConsumer

        public void initializeConsumer​(java.lang.String agreementName)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isReplicationDone

        public boolean isReplicationDone​(java.lang.String replicaDN,
                                         java.lang.String agreementName)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getReplicationStatus

        public java.lang.String getReplicationStatus​(java.lang.String replicaDN,
                                                     java.lang.String agreementName)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception