From cbcf76a6ec3bf2be5785c5953ea67a98b0ab6c30 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 11 Dec 2023 17:14:59 +0700 Subject: [PATCH] Rename LDAPConfigurator.initializeConsumer() The LDAPConfigurator.initializeConsumer() has been renamed to initializeReplicationAgreement(). --- .../cms/servlet/csadmin/LDAPConfigurator.java | 12 ++++++++---- .../server/cli/SubsystemDBReplicationSetupCLI.java | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/base/server/src/main/java/com/netscape/cms/servlet/csadmin/LDAPConfigurator.java b/base/server/src/main/java/com/netscape/cms/servlet/csadmin/LDAPConfigurator.java index 943669b3825..bde6f55efe4 100644 --- a/base/server/src/main/java/com/netscape/cms/servlet/csadmin/LDAPConfigurator.java +++ b/base/server/src/main/java/com/netscape/cms/servlet/csadmin/LDAPConfigurator.java @@ -68,10 +68,14 @@ public LDAPConfigurator(LDAPConnection connection, LDAPConfig config) throws Exc this.config = config; String baseDN = config.getBaseDN(); - params.put("rootSuffix", baseDN); + if (baseDN != null) { + params.put("rootSuffix", baseDN); + } String database = config.getDatabase(); - params.put("database", database); + if (database != null) { + params.put("database", database); + } } public LDAPConfigurator(LDAPConnection connection, LDAPConfig config, String instanceID) throws Exception { @@ -972,7 +976,7 @@ public boolean setupReplicationAgreement( return created; } - public void initializeConsumer(String agreementName) throws Exception { + public void initializeReplicationAgreement(String agreementName) throws Exception { String baseDN = config.getBaseDN(); String replicaDN = "cn=replica,cn=\"" + baseDN + "\",cn=mapping tree,cn=config"; @@ -989,7 +993,7 @@ public void initializeConsumer(String agreementName) throws Exception { String status = getReplicationStatus(replicaDN, agreementName); if (!status.startsWith("Error (0) ") && !status.startsWith("0 ")) { - String message = "Replication consumer initialization failed " + + String message = "Replication agreement initialization failed " + "(against " + connection.getHost() + ":" + connection.getPort() + "): " + status; logger.error(message); throw new Exception(message); diff --git a/base/server/src/main/java/org/dogtagpki/server/cli/SubsystemDBReplicationSetupCLI.java b/base/server/src/main/java/org/dogtagpki/server/cli/SubsystemDBReplicationSetupCLI.java index 663ee0ef524..02d9cb9fbbe 100644 --- a/base/server/src/main/java/org/dogtagpki/server/cli/SubsystemDBReplicationSetupCLI.java +++ b/base/server/src/main/java/org/dogtagpki/server/cli/SubsystemDBReplicationSetupCLI.java @@ -181,8 +181,8 @@ public void setupReplication( logger.info("New replica number range: " + beginReplicaNumber + "-" + endReplicaNumber); dbConfig.putString("beginReplicaNumber", Integer.toString(beginReplicaNumber)); - logger.info("Initializing replication consumer"); - masterConfigurator.initializeConsumer(masterAgreementName); + logger.info("Initializing replication agreement"); + masterConfigurator.initializeReplicationAgreement(masterAgreementName); } finally { if (masterConn != null) masterConn.disconnect();