*/
private void synchronizeConfig(Payload.Outbound payload, Server server,
SyncRequest sr) throws URISyntaxException {
logger.finer("ServerSynchronizer: synchronize config");
// find the domain.xml entry
ModTime domainXmlMT = null;
for (ModTime mt : sr.files) {
if (mt.name.equals("domain.xml")) {
domainXmlMT = mt;
break;
}
}
if (domainXmlMT == null) // couldn't find it, fake it
domainXmlMT = new ModTime("domain.xml", 0);
File configDir = env.getConfigDirPath();
if (!syncFile(domainRootUri, configDir, domainXmlMT, payload)) {
logger.fine("ServerSynchronizer: domain.xml HAS NOT CHANGED, " +
"thus no files will be synchronized");
return;
}
// get the set of all the config files we need to consider
Set<String> configFileSet = getConfigFileNames();
configFileSet.remove("domain.xml"); // already handled it
// add the list of file realm files
getRealmFileNames(server, configFileSet);
for (ModTime mt : sr.files) {
if (mt.name.equals("domain.xml")) // did domain.xml above
continue;
if (configFileSet.contains(mt.name)) {
// if client has file, remove it from set
configFileSet.remove(mt.name);
syncFile(domainRootUri, configDir, mt, payload);
} else
removeFile(domainRootUri, configDir, mt, payload);
}
// now do all the remaining files the client doesn't have
for (String name : configFileSet)
syncFile(domainRootUri, configDir, new ModTime(name, 0), payload);
}