1 package de.dlr.bt.stc.bridge; 2 3 import org.apache.commons.configuration2.HierarchicalConfiguration; 4 5 import de.dlr.bt.stc.config.ACfg; 6 import de.dlr.bt.stc.config.CfgFactory; 7 import de.dlr.bt.stc.init.Register; 8 9 public class BridgeCfg extends ACfg { 10 11 protected BridgeCfg(HierarchicalConfiguration<?> config) { 12 super(config); 13 } 14 15 @Register 16 public static void register() { 17 CfgFactory.getInstance().registerCreator("stcBridge", BridgeCfg::new); 18 } 19 20 public String getSourceId() { 21 return config.getString("source_id"); 22 } 23 24 public String getSinkId() { 25 return config.getString("sink_id"); 26 } 27 28 public Integer getQueueSize() { 29 return config.getInt("queue_size", -1); 30 } 31 32 public Integer getQueueDuration() { 33 return config.getInt("queue_duration", -1); 34 } 35 36 public MappingCfg getMapping() { 37 return new MappingCfg(config.configurationAt("mapping")); 38 } 39 40 public String getValueTemplate() { 41 return config.getString("value_template", "value"); 42 } 43 44 }