*
* @throws ConfigurationException When an error occurs.
*/
protected DataStoreInfoDTO loadDataStore(Element dsElem)
throws ConfigurationException {
DataStoreInfoDTO ds = new DataStoreInfoDTO();
LOGGER.finer("creating a new DataStoreDTO configuration");
ds.setId(ReaderUtils.getAttribute(dsElem, "id", true));
String namespacePrefix = ReaderUtils.getAttribute(dsElem, "namespace",
true);
if (data.getNameSpaces().containsKey(namespacePrefix)) {
ds.setNameSpaceId(namespacePrefix);
} else {
String msg = "there is no namespace defined for datatasore '"
+ namespacePrefix + "'";
throw new ConfigurationException(msg);
}
ds.setEnabled(ReaderUtils.getBooleanAttribute(dsElem, "enabled", false,
true));
ds.setTitle(ReaderUtils.getChildText(dsElem, "title", false));
ds.setAbstract(ReaderUtils.getChildText(dsElem, "description", false));
LOGGER.finer("loading connection parameters for DataStoreDTO "
+ ds.getNameSpaceId());
ds.setConnectionParams(loadConnectionParams(ReaderUtils.getChildElement(
dsElem, "connectionParams", true)));
LOGGER.config("Loaded datastore " + ds.getId());
return ds;
}