text
stringlengths 0
2.2M
|
---|
}
|
}
|
}
|
handleDataSourceEntities(name, allMapps, allclsmap);
|
ConfigurationData::getInstance()->sdormConnProperties[name] = allProps;
|
ConfigurationData::getInstance()->sdormEntityMappings[name] = allMapps;
|
logger << "done reading sdorm config file " + configFile << std::endl;
|
}
|
void ConfigurationHandler::destroyDataSources()
|
{
|
DataSourceManager::destroy();
|
}
|
void ConfigurationHandler::configureCaches(const std::string& name, const std::string& configFile)
|
{
|
Logger logger = LoggerFactory::getLogger("ConfigurationHandler");
|
SimpleXmlParser parser("Parser");
|
logger << ("started reading cache config file " + configFile) << std::endl;
|
Document doc;
|
parser.readDocument(configFile, doc);
|
const Element& dbroot = doc.getRootElement();
|
if(dbroot.getTagName()=="caches")
|
{
|
ElementList datasrcs = dbroot.getChildElements();
|
bool found_default = false;
|
for (unsigned int dsnu = 0; dsnu < datasrcs.size(); dsnu++)
|
{
|
if(datasrcs.at(dsnu).getTagName()=="cache")
|
{
|
ConnectionProperties cprops;
|
if(!found_default && (datasrcs.at(dsnu).getAttribute("default")=="true" || datasrcs.size()==1)) {
|
cprops.addProperty("_isdefault_", "true");
|
found_default = true;
|
}
|
int psize = 1;
|
ElementList confs = datasrcs.at(dsnu).getChildElements();
|
for (unsigned int cns = 0; cns < confs.size(); cns++)
|
{
|
if(confs.at(cns).getTagName()=="nodes")
|
{
|
ElementList nodec = confs.at(cns).getChildElements();
|
for (unsigned int nn = 0; nn < nodec.size(); nn++)
|
{
|
if(nodec.at(nn).getTagName()!="node")continue;
|
ConnectionNode cnode;
|
ElementList nodes = nodec.at(nn).getChildElements();
|
for (unsigned int ncc = 0; ncc < nodes.size(); ncc++)
|
{
|
if(nodes.at(ncc).getTagName()=="username")
|
{
|
cnode.username = nodes.at(ncc).getText();
|
}
|
else if(nodes.at(ncc).getTagName()=="password")
|
{
|
cnode.password = nodes.at(ncc).getText();
|
}
|
else if(nodes.at(ncc).getTagName()=="host")
|
{
|
cnode.host = nodes.at(ncc).getText();
|
}
|
else if(nodes.at(ncc).getTagName()=="port")
|
{
|
try {
|
cnode.port = CastUtil::toInt(nodes.at(ncc).getText());
|
} catch(const std::exception& e) {
|
}
|
}
|
else if(nodes.at(ncc).getTagName()=="readTimeout")
|
{
|
try {
|
cnode.readTimeout = CastUtil::toFloat(nodes.at(ncc).getText());
|
} catch(const std::exception& e) {
|
}
|
}
|
else if(nodes.at(ncc).getTagName()=="connectionTimeout")
|
{
|
try {
|
cnode.connectionTimeout = CastUtil::toFloat(nodes.at(ncc).getText());
|
} catch(const std::exception& e) {
|
}
|
}
|
}
|
cprops.addNode(cnode);
|
}
|
}
|
else if(confs.at(cns).getTagName()=="pool-size")
|
{
|
if(confs.at(cns).getText()!="")
|
{
|
try {
|
psize = CastUtil::toInt(confs.at(cns).getText());
|
} catch(const std::exception& e) {
|
}
|
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.