*
* @throws RepositoryConfigurationException
*/
private void readParamsFromFile()
{
PropertiesParam pps = initParams.getPropertiesParam("replication-properties");
// initialize replication params;
testMode = pps.getProperty("test-mode");
enabled = pps.getProperty("enabled");
mode = pps.getProperty("mode");
bindIPAddress = pps.getProperty("bind-ip-address");
channelConfig = pps.getProperty("channel-config");
channelName = pps.getProperty("channel-name");
recDir = pps.getProperty("recovery-dir");
ownName = pps.getProperty("node-name");
participantsCluster = pps.getProperty("other-participants");
sWaitConfirmation = pps.getProperty("wait-confirmation");
// initialize repositories
ValuesParam vp = initParams.getValuesParam("repositories");
repoNamesList = vp.getValues();
if (vp == null || vp.getValues().size() == 0)
throw new RuntimeException("repositories not specified");
// initialize snapshot params;
PropertiesParam backuParams = initParams.getPropertiesParam("replication-snapshot-properties");
if (backuParams != null)
{
sBackupEnabled = backuParams.getProperty("snapshot-enabled");
sBackupDir = backuParams.getProperty("snapshot-dir");
sDelayTime = backuParams.getProperty("delay-time");
}
else
{
backupEnabled = false;
}
// initialize priority params;
PropertiesParam priorityParams = initParams.getPropertiesParam("replication-priority-properties");
if (priorityParams != null)
{
priprityType = priorityParams.getProperty("priority-type");
ownValue = priorityParams.getProperty("node-priority");
}
log.info("Params is read from configuration file");
checkParams();