Skip to content

Commit

Permalink
Rename LDAPConfigurator.initializeConsumer()
Browse files Browse the repository at this point in the history
The LDAPConfigurator.initializeConsumer() has been renamed to
initializeReplicationAgreement().
  • Loading branch information
edewata committed Dec 11, 2023
1 parent 469c06a commit cbcf76a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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";
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cbcf76a

Please sign in to comment.