if (ds.getDataSourceID().isEmpty()) {
ds.setDataSourceID(addDataSource(ds.getDataConfig()));
storeConfig(ps);
} else { // Check if the presented data source is valid
try {
DataSourceInfo dsInfo = inqWS.getDataSourceInfo(ds.getDataSourceID());
if (dsInfo == null) {
log.warn("Invalid DataSourceID:" + ds.getDataSourceID() + " in the configuration file. Re-registering dataSource");
ds.setDataSourceID(addDataSource(ds.getDataConfig()));
storeConfig(ps);
}