The common lib provides base functionality for:
The configuration part is widely used over all our bundles, e.g. data-provider, devicemanager or mountpoint-registrar.
example config file:
[es] #hosturl esHosts=${SDNRDBURL} #time limit to keep increasing data in database [in seconds] #60*60*24*30 (30days) esArchiveLifetimeSeconds=2592000 esCluster= esArchiveCheckIntervalSeconds=0 esNode=elasticsearchnode esAuthUsername=${SDNRDBUSERNAME} esAuthPassword=${SDNRDBPASSWORD} esTrustAllCerts=${SDNRDBTRUSTALLCERTS} |
A config file is separated into Sections.
Code example for a specific config implementation:
usage:
final ConfigurationFileRepresentation configuration = new ConfigurationFileRepresentation("etc/dataprovider.properties"); final EsConfig esConfig = new EsConfig(configuration); ElasticSearchDataProvider dataProvider = new ElasticSearchDataProvider(esConfig.getHosts(),esConfig.getBasicAuthUsername(),esConfig.getBasicAuthPassword()); |