Skip to content
Snippets Groups Projects
Commit 2422b929 authored by gakin's avatar gakin
Browse files

SSDMSSDM-5023: Add dry run flag to configuration file

SVN: 38078
parent dcd80346
No related branches found
No related tags found
No related merge requests found
......@@ -56,24 +56,6 @@ public class ConfigReader
loadFile(file);
}
public static void main(String[] args)
{
ConfigReader reader;
try
{
reader = new ConfigReader("/Users/gakin/Documents/workspace_openbis_trunk/datastore_server/harvester.ini");
for (int i = 0; i < reader.getSectionCount(); i++)
{
System.out.println(reader.getSection(i));
}
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public int getSectionCount()
{
return entries.keySet().size();
......
......@@ -205,6 +205,8 @@ public class SyncConfig
private Integer fullSyncInterval;
private Boolean dryRun = false;
private List<String> dataSourceSpaces = new ArrayList<>();
private List<String> harvesterSpaces = new ArrayList<>();
......@@ -297,4 +299,13 @@ public class SyncConfig
this.fullSyncInterval = fullSyncInterval;
}
public Boolean isDryRun()
{
return dryRun;
}
public void setDryRun(Boolean dryRun)
{
this.dryRun = dryRun;
}
}
......@@ -78,6 +78,8 @@ public class SynchronizationConfigReader
private static final String FULL_SYNC_INTERVAL_PROPERTY_NAME = "full-sync-interval";
private static final String DRY_RUN_PROPERTY_NAME = "dry-run";
private Integer defaultFullSyncIntervalInDays = 14;
private String defaultLastSyncTimestampFileName = "last-sync-timestamp-file_{alias}.txt";
......@@ -133,6 +135,7 @@ public class SynchronizationConfigReader
config.setHarvesterTempDir(reader.getString(section, HARVESTER_TEMP_DIR_PROPERTY_NAME, DEFAULT_HARVESTER_TEMP_DIR, false));
config.setTranslateUsingDataSourceAlias(reader.getBoolean(section, TRANSLATE_USING_DATA_SOURCE_ALIAS_PROPERTY_NAME, false));
// read full-sync configuration
boolean fullSync = reader.getBoolean(section, FULL_SYNC_PROPERTY_NAME, false);
config.setFullSyncEnabled(fullSync);
if (fullSync)
......@@ -148,6 +151,8 @@ public class SynchronizationConfigReader
config.setNotSyncedDataSetsFileName(
reader.getString(section, HARVESTER_NOT_SYNCED_ENTITIES_FILE_NAME, defaultNotSyncedEntitiesFileName, false));
configs.add(config);
config.setDryRun(reader.getBoolean(section, DRY_RUN_PROPERTY_NAME, false));
}
return configs;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment