Skip to content
Snippets Groups Projects
Commit 0324bf87 authored by gakin's avatar gakin
Browse files

SSDM-4761 OpenbisSync full-sync, add configuration parameters to harvester-config.txt

SVN: 38066
parent c0936234
No related branches found
No related tags found
No related merge requests found
......@@ -201,6 +201,10 @@ public class SyncConfig
private Boolean translateUsingDataSourceAlias = false;
private Boolean fullSync = false;
private Integer fullSyncInterval;
private List<String> dataSourceSpaces = new ArrayList<>();
private List<String> harvesterSpaces = new ArrayList<>();
......@@ -273,4 +277,24 @@ public class SyncConfig
this.translateUsingDataSourceAlias = translateUsingDataSourceAlias;
}
public Boolean getFullSync()
{
return fullSync;
}
public void setFullSync(Boolean fullSync)
{
this.fullSync = fullSync;
}
public Integer getFullSyncInterval()
{
return fullSyncInterval;
}
public void setFullSyncInterval(Integer fullSyncInterval)
{
this.fullSyncInterval = fullSyncInterval;
}
}
......@@ -72,7 +72,13 @@ public class SynchronizationConfigReader
private static final String EMAIL_ADDRESSES_PROPERTY_NAME = "email-addresses";
private static final String TRANSLATE_USING_DATA_SOURCE_ALIAS = "translate-using-data-source-alias";
private static final String TRANSLATE_USING_DATA_SOURCE_ALIAS_PROPERTY_NAME = "translate-using-data-source-alias";
private static final String FULL_SYNC_PROPERTY_NAME = "full-sync";
private static final String FULL_SYNC_INTERVAL_PROPERTY_NAME = "full-sync-interval";
private Integer defaultFullSyncIntervalInDays = 14;
private String defaultLastSyncTimestampFileName = "last-sync-timestamp-file_{alias}.txt";
......@@ -125,7 +131,14 @@ 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, false));
config.setTranslateUsingDataSourceAlias(reader.getBoolean(section, TRANSLATE_USING_DATA_SOURCE_ALIAS_PROPERTY_NAME, false));
boolean fullSync = reader.getBoolean(section, FULL_SYNC_PROPERTY_NAME, false);
config.setFullSync(fullSync);
if (fullSync)
{
config.setFullSyncInterval(reader.getInt(section, FULL_SYNC_INTERVAL_PROPERTY_NAME, defaultFullSyncIntervalInDays, false));
}
defaultLastSyncTimestampFileName = defaultLastSyncTimestampFileName.replaceFirst(Pattern.quote("{alias}"), config.getDataSourceAlias());
config.setLastSyncTimestampFileName(
......
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