This repository was archived by the owner on Oct 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
configuration lib
Marten Rebane edited this page Jan 21, 2020
·
1 revision
Central configuration for RIA DigiDoc
To fetch and package default configuration, run command:
gradle clean fetchAndPackageDefaultConfiguration app:assembleThe default configuration setup is:
Configuration downloaded from: https://id.eesti.ee/
Configuration update interval: 7 (days)
The central configuration options can be overridden with command (replace --args with custom values):
gradle clean fetchAndPackageDefaultConfiguration --args='https://example.com 5' app:assembleThe first argument (URL) is where the configuration is downloaded from. The second argument is interval, where every given number of days, the configuration is updated.
- The URL argument must contain only the base URL. For example if the specified URL is
https://id.eesti.ee/, then the configuration will be downloaded fromhttps://id.eesti.ee/config.json(public key from/config.puband signature from/config.rsa)
The build will be stopped if configuration validation fails.
CachedConfigurationHandler cachedConfHandler = new CachedConfigurationHandler(getCacheDir());
ConfigurationProperties confProperties = new ConfigurationProperties(getAssets());
ConfigurationManager confManager = new ConfigurationManager(this, confProperties, cachedConfHandler, UserAgentUtil.getUserAgent(getApplicationContext()));
confManager.getConfiguration();CachedConfigurationHandler cachedConfHandler = new CachedConfigurationHandler(getCacheDir());
ConfigurationProperties confProperties = new ConfigurationProperties(getAssets());
ConfigurationManager confManager = new ConfigurationManager(this, confProperties, cachedConfHandler, UserAgentUtil.getUserAgent(getApplicationContext()));
confManager.forceLoadDefaultConfiguration();CachedConfigurationHandler cachedConfHandler = new CachedConfigurationHandler(getCacheDir());
ConfigurationProperties confProperties = new ConfigurationProperties(getAssets());
ConfigurationManager confManager = new ConfigurationManager(this, confProperties, cachedConfHandler, UserAgentUtil.getUserAgent(getApplicationContext()));
confManager.forceLoadDefaultConfiguration();File: configuration.properties
ConfigurationProperties confProperties = new ConfigurationProperties(getAssets());
confProperties.getConfigurationVersionSerial();Used to cache and get configuration data
CachedConfigurationHandler cachedConfigurationHandler = new CachedConfigurationHandler(getCacheDir());
cachedConfHandler.doesCachedConfigurationExist(); // true or falseCachedConfigurationHandler cachedConfigurationHandler = new CachedConfigurationHandler(getCacheDir());
cachedConfHandler.getConfigurationVersionSerial();CachedConfigurationHandler cachedConfigurationHandler = new CachedConfigurationHandler(getCacheDir());
cachedConfHandler.getConfLastUpdateCheckDate();CachedConfigurationHandler cachedConfigurationHandler = new CachedConfigurationHandler(getCacheDir());
cachedConfHandler.getConfUpdateDate();