text
stringlengths
0
2.2M
cprops.poolWriteSize = psize;
}
else if(confs.at(cns).getTagName()=="name")
{
cprops.name = confs.at(cns).getText();
}
else if(confs.at(cns).getTagName()=="type")
{
cprops.type = confs.at(cns).getText();
}
else
{
cprops.addProperty(confs.at(cns).getTagName(), confs.at(cns).getText());
}
}
if(cprops.getName()!="")
{
ConfigurationData::getInstance()->cacheConnProperties[name][cprops.getName()] = cprops;
}
}
}
}
logger << "done reading cache config file " + configFile << std::endl;
}
void ConfigurationHandler::destroyCaches()
{
CacheManager::destroy();
}
void ConfigurationHandler::handleMarkerConfigurations(std::map<std::string, std::map<std::string, ClassStructure, std::less<> >, std::less<> >& clsstrucMaps, std::vector<WsDetails>& wsdvec, std::vector<bool>& stat, strVec& vecvp, strVec& pathvec, std::map<std::string, std::string, std::less<> >& ajintpthMap, std::map<std::string, std::string, std::less<> >& tpes, const std::string& serverRootDirectory, strVec& afcd, std::string& ajrt, Reflection& ref)
{
Logger logger = LoggerFactory::getLogger("ConfigurationHandler");
std::map<std::string, std::map<std::string, ClassStructure, std::less<> >, std::less<> >::iterator it;
for (it=clsstrucMaps.begin();it!=clsstrucMaps.end();++it) {
bool isJsObjects = false;
std::string appName = it->first;
std::string defpath = serverRootDirectory + "/web/" + appName;
std::map<std::string, ClassStructure, std::less<> >::iterator itt;
for (itt=it->second.begin();itt!=it->second.end();++itt) {
ClassStructure cs = itt->second;
if(cs.markers.find("@SecurityProvider")!=cs.markers.end())
{
Marker secProv = cs.markers["@SecurityProvider"].at(cs.markers["@SecurityProvider"].size()-1);
if(cs.markers["@SecurityProvider"].size()>1)
{
logger << ("Found more than one @SecurityProvider marker, only the last defined marker will be considered, ignoring others..") << std::endl;
}
std::string clas = cs.getFullyQualifiedClassName();
std::string provider = clas;
std::string url = secProv.getAttributeValue("url");
std::string provName = secProv.getAttributeValue("providerName");
std::string sessionTimeoutV = secProv.getAttributeValue("sessionTimeout");
std::string scope = secProv.getAttributeValue("scope");
std::string welcomefile = secProv.getAttributeValue("welcomefile");
std::string userfld = secProv.getAttributeValue("usernamefld");
std::string userfrom = secProv.getAttributeValue("usernamefrom");
std::string passfld = secProv.getAttributeValue("passwordfld");
std::string passfrom = secProv.getAttributeValue("passwordfrom");
if(provName=="")
{
logger << ("Provider name cannot be blank, skipping...") << std::endl;
continue;
}
if(url=="")
{
logger << ("Login Path cannot be blank, skipping...") << std::endl;
continue;
}
if((userfld!="" && passfld=="") || (userfld=="" && passfld!=""))
{
logger << ("Both usernamefld/passwordfld need to be provided together, skipping...") << std::endl;
continue;
}
if((userfld!="" && userfrom!="" && passfrom=="") || (passfld!="" && userfrom=="" && passfrom!=""))
{
logger << ("Both usernamefrom/passwordfrom need to be provided together, skipping...") << std::endl;
continue;
}
if(ConfigurationData::getInstance()->securityObjectMap[appName].find(provName)
!=ConfigurationData::getInstance()->securityObjectMap[appName].end())
{
logger << ("Provider with name " + provName + " already exists, skipping duplicate...") << std::endl;
continue;
}
Security securityObject = ConfigurationData::getInstance()->securityObjectMap[appName][provName];
securityObject.loginProvider = "class:" + provider;
normalizeUrl(appName, url);
securityObject.loginUrl = url;
try {