if (is != null)
msg = new String(ReplManagerPlugin.getContent(is));
// this comes from the requesting ReplSlave
log.info("update for '" + topic + "' and msg='" + msg + "'");
if (REPL_REQUEST_UPDATE.equals(msg)) {
ClientProperty prop = (ClientProperty)attrMap.get("_sender");
if (prop == null)
throw new Exception("update for '" + msg + "' failed since no '_sender' specified");
String replManagerAddress = prop.getStringValue();
String replTopic = source.getTopic();
if (replTopic == null)
throw new Exception("update for '" + msg + "' failed since the property 'mom.topicName' has not been defined. Check your DbWatcher Configuration file");
prop = (ClientProperty)attrMap.get(SLAVE_NAME);
if (prop == null)
throw new Exception("update for '" + msg + "' failed since no '_slaveName' specified");
String slaveName = prop.getStringValue();
prop = (ClientProperty)attrMap.get(REPL_VERSION);
String requestedVersion = null;
if (prop != null)
requestedVersion = prop.getStringValue();
// this.dbSpecific.initiateUpdate(replTopic, destination, slaveName);
prop = (ClientProperty)attrMap.get(INITIAL_FILES_LOCATION);
String initialFilesLocation = null;
if (prop != null)
initialFilesLocation = prop.getStringValue();
prop = (ClientProperty)attrMap.get(INITIAL_UPDATE_ONLY_REGISTER);
boolean onlyRegister = false;
if (prop != null)
onlyRegister = prop.getBooleanValue();
// String slaveName, String replVersion, String initialFilesLocation, boolean onlyRegister
source.initialUpdate(replTopic, replManagerAddress, slaveName, requestedVersion, initialFilesLocation, onlyRegister);
}
else if (REPL_REQUEST_CANCEL_UPDATE.equals(msg)) {
// do cancel
ClientProperty prop = (ClientProperty)attrMap.get(SLAVE_NAME);
if (prop == null)
throw new Exception("update for '" + msg + "' failed since no '_slaveName' specified");
String slaveName = prop.getStringValue();
source.cancelUpdate(slaveName);
}
else if (REPL_REQUEST_RECREATE_TRIGGERS.equals(msg)) {
source.recreateTriggers();
}