00001 #include "otsdaq-core/ConfigurationInterface/ConfigurationManagerRW.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include<dirent.h>
00026
00027 using namespace ots;
00028
00029
00030 #undef __MF_SUBJECT__
00031 #define __MF_SUBJECT__ "ConfigurationManagerRW"
00032
00033 #define CONFIGURATION_INFO_PATH std::string(getenv("CONFIGURATION_INFO_PATH")) + "/"
00034 #define CONFIGURATION_INFO_EXT "Info.xml"
00035
00036
00037
00038 ConfigurationManagerRW::ConfigurationManagerRW(std::string username)
00039 : ConfigurationManager(username)
00040 {
00041 __MOUT__ << "Using Config Mgr with Write Access! (for " << username << ")" << std::endl;
00042
00043
00044
00045 theInterface_ = ConfigurationInterface::getInstance(false);
00046
00047 }
00048
00049
00050
00051
00052
00053
00054
00055 const std::map<std::string, ConfigurationInfo>& ConfigurationManagerRW::getAllConfigurationInfo(
00056 bool refresh, std::string *accumulatedErrors, const std::string &errorFilterName)
00057 {
00058
00059
00060 if(accumulatedErrors) *accumulatedErrors = "";
00061
00062 if(!refresh) return allConfigurationInfo_;
00063
00064
00065 allConfigurationInfo_.clear();
00066
00067 ConfigurationBase* configuration;
00068
00069
00070
00071
00072 __MOUT__ << "Extracting list of Configuration tables" << std::endl;
00073 DIR *pDIR;
00074 struct dirent *entry;
00075 std::string path = CONFIGURATION_INFO_PATH;
00076 char fileExt[] = CONFIGURATION_INFO_EXT;
00077 const unsigned char MIN_CONFIG_NAME_SZ = 3;
00078 if( (pDIR=opendir( path.c_str() )) != 0 )
00079 {
00080 while((entry = readdir(pDIR)) != 0)
00081 {
00082
00083 if(strlen(entry->d_name) < strlen(fileExt)+MIN_CONFIG_NAME_SZ)
00084 continue;
00085
00086
00087 if( strcmp(
00088 &(entry->d_name[strlen(entry->d_name) - strlen(fileExt)]),
00089 fileExt) != 0)
00090 continue;
00091
00092
00093 entry->d_name[strlen(entry->d_name) - strlen(fileExt)] = '\0';
00094
00095
00096
00097
00098 configuration = 0;
00099
00100 try
00101 {
00102 theInterface_->get(configuration,
00103 entry->d_name,
00104 0, 0,
00105 true);
00106 }
00107 catch(cet::exception)
00108 {
00109 if(configuration) delete configuration;
00110 configuration = 0;
00111
00112 __MOUT__ << "Skipping! No valid class found for... " << entry->d_name << "\n";
00113 continue;
00114 }
00115 catch(std::runtime_error &e)
00116 {
00117 if(configuration) delete configuration;
00118 configuration = 0;
00119
00120 __MOUT__ << "Skipping! No valid class found for... " << entry->d_name << "\n";
00121 __MOUT__ << "Error: " << e.what() << std::endl;
00122
00123
00124
00125
00126
00127 if(accumulatedErrors)
00128 {
00129
00130 if(errorFilterName == "" ||
00131 errorFilterName == entry->d_name)
00132 {
00133 *accumulatedErrors += std::string("\nIn table '") + entry->d_name +
00134 "'..." + e.what();
00135
00136 __SS__ << "Attempting to allow illegal columns!" << std::endl;
00137 *accumulatedErrors += ss.str();
00138 }
00139
00140
00141 __MOUT__ << "Attempting to allow illegal columns!" << std::endl;
00142
00143
00144 std::string returnedAccumulatedErrors;
00145 try
00146 {
00147
00148 configuration = new ConfigurationBase(entry->d_name, &returnedAccumulatedErrors);
00149 }
00150 catch(...)
00151 {
00152 __MOUT__ << "Skipping! Allowing illegal columns didn't work either... " <<
00153 entry->d_name << "\n";
00154 continue;
00155 }
00156 __MOUT__ << "Error (but allowed): " << returnedAccumulatedErrors << std::endl;
00157
00158 if(errorFilterName == "" ||
00159 errorFilterName == entry->d_name)
00160 *accumulatedErrors += std::string("\nIn table '") + entry->d_name +
00161 "'..." + returnedAccumulatedErrors;
00162 }
00163 else
00164 continue;
00165 }
00166
00167
00168
00169 if(nameToConfigurationMap_[entry->d_name])
00170 {
00171
00172 std::set<ConfigurationVersion> versions =
00173 nameToConfigurationMap_[entry->d_name]->getStoredVersions();
00174 for(auto &version:versions)
00175 if(version.isTemporaryVersion())
00176 {
00177 __MOUT__ << "copying tmp = " << version << std::endl;
00178
00179 try
00180 {
00181 nameToConfigurationMap_[entry->d_name]->setActiveView(version);
00182 configuration->copyView(
00183 nameToConfigurationMap_[entry->d_name]->getView(),
00184 version,
00185 username_);
00186 }
00187 catch(...)
00188 {}
00189 }
00190
00191 delete nameToConfigurationMap_[entry->d_name];
00192 nameToConfigurationMap_[entry->d_name] = 0;
00193 }
00194
00195 nameToConfigurationMap_[entry->d_name] = configuration;
00196
00197 allConfigurationInfo_[entry->d_name].configurationPtr_ = configuration;
00198 allConfigurationInfo_[entry->d_name].versions_ = theInterface_->getVersions(configuration);
00199
00200
00201
00202 std::set<ConfigurationVersion> versions =
00203 nameToConfigurationMap_[entry->d_name]->getStoredVersions();
00204 for(auto &version:versions)
00205 if(version.isTemporaryVersion())
00206 {
00207 __MOUT__ << "surviving tmp = " << version << std::endl;
00208 allConfigurationInfo_[entry->d_name].versions_.emplace(version);
00209 }
00210 }
00211 closedir(pDIR);
00212 }
00213 __MOUT__ << "Extracting list of Configuration tables complete" << std::endl;
00214
00215
00216 init(accumulatedErrors);
00217
00218 return allConfigurationInfo_;
00219 }
00220
00221
00222
00223
00224 std::map<std::string,std::map<std::string,ConfigurationVersion> >
00225 ConfigurationManagerRW::getActiveVersionAliases(void) const
00226 {
00227 __MOUT__ << "getActiveVersionAliases()" << std::endl;
00228 std::map<std::string,std::map<std::string,ConfigurationVersion> > retMap;
00229
00230 std::map<std::string, ConfigurationVersion> activeVersions = getActiveVersions();
00231 std::string versionAliasesTableName = "VersionAliasesConfiguration";
00232 if(activeVersions.find(versionAliasesTableName) == activeVersions.end())
00233 {
00234 __SS__ << "Active version of VersionAliases missing!" <<
00235 "Make sure you have a valid active Backbone Group." << std::endl;
00236 __MOUT_WARN__ << "\n" << ss.str();
00237 return retMap;
00238 }
00239
00240 __MOUT__ << "activeVersions[\"VersionAliasesConfiguration\"]=" <<
00241 activeVersions[versionAliasesTableName] << std::endl;
00242
00243
00244 if(!ConfigurationInterface::isVersionTrackingEnabled())
00245 for(const auto &tableInfo:allConfigurationInfo_)
00246 for(const auto &version:tableInfo.second.versions_)
00247 if(version.isScratchVersion())
00248 retMap[tableInfo.first][ConfigurationManager::SCRATCH_VERSION_ALIAS] =
00249 ConfigurationVersion(ConfigurationVersion::SCRATCH);
00250
00251 std::vector<std::pair<std::string,ConfigurationTree> > aliasNodePairs =
00252 getNode(versionAliasesTableName).getChildren();
00253
00254
00255
00256
00257 std::string configName, versionAlias;
00258 for(auto& aliasNodePair:aliasNodePairs)
00259 {
00260 configName = aliasNodePair.second.getNode(
00261 "ConfigurationName").getValueAsString();
00262 versionAlias = aliasNodePair.second.getNode(
00263 "VersionAlias").getValueAsString();
00264
00265 if(retMap.find(configName) != retMap.end() &&
00266 retMap[configName].find(versionAlias) != retMap[configName].end())
00267 continue;
00268
00269
00270 retMap[configName][versionAlias] = ConfigurationVersion(
00271 aliasNodePair.second.getNode("Version").getValueAsString());
00272 }
00273
00274 return retMap;
00275 }
00276
00277
00278
00279
00280
00281 void ConfigurationManagerRW::activateConfigurationGroup(const std::string &configGroupName,
00282 ConfigurationGroupKey configGroupKey, std::string *accumulatedTreeErrors)
00283 {
00284 loadConfigurationGroup(configGroupName,configGroupKey,
00285 true,
00286 0,
00287 accumulatedTreeErrors);
00288
00289 if(accumulatedTreeErrors &&
00290 *accumulatedTreeErrors != "")
00291 {
00292 __MOUT_ERR__ << "Errors were accumulated so de-activating group: " <<
00293 configGroupName << " (" << configGroupKey << ")" << std::endl;
00294 try
00295 { destroyConfigurationGroup(configGroupName,true); }
00296 catch(...){}
00297 }
00298
00299 __MOUT_INFO__ << "Updating persistent active groups to " <<
00300 ConfigurationManager::ACTIVE_GROUP_FILENAME << " ..." << std::endl;
00301
00302 std::string fn = ConfigurationManager::ACTIVE_GROUP_FILENAME;
00303 FILE *fp = fopen(fn.c_str(),"w");
00304 if(!fp) return;
00305
00306 fprintf(fp,"%s\n",theContextGroup_.c_str());
00307 fprintf(fp,"%s\n",theContextGroupKey_?theContextGroupKey_->toString().c_str():"-1");
00308 fprintf(fp,"%s\n",theBackboneGroup_.c_str());
00309 fprintf(fp,"%s\n",theBackboneGroupKey_?theBackboneGroupKey_->toString().c_str():"-1");
00310 fprintf(fp,"%s\n",theConfigurationGroup_.c_str());
00311 fprintf(fp,"%s\n",theConfigurationGroupKey_?theConfigurationGroupKey_->toString().c_str():"-1");
00312 fclose(fp);
00313 }
00314
00315
00316
00317
00318
00319 ConfigurationVersion ConfigurationManagerRW::createTemporaryBackboneView(ConfigurationVersion sourceViewVersion)
00320 {
00321 __MOUT_INFO__ << "Creating temporary backbone view from version " <<
00322 sourceViewVersion << std::endl;
00323
00324
00325 ConfigurationVersion tmpVersion = ConfigurationVersion::getNextTemporaryVersion();
00326 ConfigurationVersion retTmpVersion;
00327 auto backboneMemberNames = ConfigurationManager::getBackboneMemberNames();
00328 for (auto& name : backboneMemberNames)
00329 {
00330 retTmpVersion = ConfigurationManager::getConfigurationByName(name)->getNextTemporaryVersion();
00331 if(retTmpVersion < tmpVersion)
00332 tmpVersion = retTmpVersion;
00333 }
00334
00335 __MOUT__ << "Common temporary backbone version found as " <<
00336 tmpVersion << std::endl;
00337
00338
00339 for (auto& name : backboneMemberNames)
00340 {
00341 retTmpVersion = getConfigurationByName(name)->createTemporaryView(sourceViewVersion, tmpVersion);
00342 if(retTmpVersion != tmpVersion)
00343 {
00344 __MOUT_ERR__ << "Failure! Temporary view requested was " <<
00345 tmpVersion << ". Mismatched temporary view created: " << retTmpVersion << std::endl;
00346 throw std::runtime_error("Mismatched temporary view created!");
00347 }
00348 }
00349
00350 return tmpVersion;
00351 }
00352
00353
00354
00355
00356 ConfigurationBase* ConfigurationManagerRW::getConfigurationByName(const std::string &configurationName)
00357 {
00358 if(nameToConfigurationMap_.find(configurationName) == nameToConfigurationMap_.end())
00359 {
00360 __MOUT_ERR__ << "\nConfiguration not found with name: " << configurationName << std::endl;
00361 throw std::runtime_error("Configuration not found with name '" + configurationName + ".'");
00362 }
00363 return nameToConfigurationMap_[configurationName];
00364 }
00365
00366
00367
00368
00369
00370
00371 ConfigurationBase* ConfigurationManagerRW::getVersionedConfigurationByName(const std::string &configurationName,
00372 ConfigurationVersion version, bool looseColumnMatching)
00373 {
00374 auto it = nameToConfigurationMap_.find(configurationName);
00375 if(it == nameToConfigurationMap_.end())
00376 {
00377 __SS__ << "\nCan not find configuration named '" <<
00378 configurationName <<
00379 "'\n\n\n\nYou need to load the configuration before it can be used." <<
00380 "It probably is missing from the member list of the Configuration Group that was loaded?\n\n\n\n\n"
00381 << std::endl;
00382 throw std::runtime_error(ss.str());
00383 }
00384 ConfigurationBase* configuration = it->second;
00385 theInterface_->get(configuration, configurationName, 0 , 0,
00386 false,
00387 version,
00388 false,
00389 looseColumnMatching);
00390 return configuration;
00391 }
00392
00393
00394
00395
00396 ConfigurationVersion ConfigurationManagerRW::saveNewConfiguration(const std::string &configurationName,
00397 ConfigurationVersion temporaryVersion, bool makeTemporary)
00398 {
00399 ConfigurationVersion newVersion(temporaryVersion);
00400
00401
00402 ConfigurationBase *config = getConfigurationByName(configurationName);
00403 config->getTemporaryView(temporaryVersion)->setAuthor(username_);
00404
00405
00406 if(!makeTemporary)
00407 newVersion = theInterface_->saveNewVersion(config, temporaryVersion);
00408 else
00409 config->setActiveView(newVersion);
00410
00411
00412 while(!newVersion.isScratchVersion() && allConfigurationInfo_[configurationName].versions_.find(newVersion) !=
00413 allConfigurationInfo_[configurationName].versions_.end())
00414 {
00415 __MOUT_ERR__ << "What happenened!?? ERROR::: newVersion v" << newVersion <<
00416 " already exists!? How is it possible? Retrace your steps and tell an admin." << std::endl;
00417
00418
00419 temporaryVersion = config->createTemporaryView(newVersion);
00420
00421 if(newVersion.isTemporaryVersion())
00422 newVersion = temporaryVersion;
00423 else
00424 newVersion = ConfigurationVersion::getNextVersion(newVersion);
00425
00426 __MOUT_WARN__ << "Attempting to recover and use v" << newVersion << std::endl;
00427
00428
00429 if(!makeTemporary)
00430 newVersion = theInterface_->saveNewVersion(config, temporaryVersion, newVersion);
00431 else
00432 config->setActiveView(newVersion);
00433 }
00434
00435 if(newVersion.isInvalid())
00436 {
00437 __SS__ << "Something went wrong saving the new version v" << newVersion <<
00438 ". What happened?! (duplicates? database error?)" << std::endl;
00439 __MOUT_ERR__ << "\n" << ss.str();
00440 throw std::runtime_error(ss.str());
00441 }
00442
00443
00444 allConfigurationInfo_[configurationName].versions_.insert(newVersion);
00445
00446 __MOUT__ << "New version added to info " << newVersion << std::endl;
00447
00448 return newVersion;
00449 }
00450
00451
00452
00453
00454
00455
00456 void ConfigurationManagerRW::eraseTemporaryVersion(const std::string &configurationName,
00457 ConfigurationVersion targetVersion)
00458 {
00459 ConfigurationBase* config = getConfigurationByName(configurationName);
00460
00461 config->trimTemporary(targetVersion);
00462
00463
00464 if(allConfigurationInfo_.find(configurationName) ==
00465 allConfigurationInfo_.end()) return;
00466
00467
00468 if(targetVersion.isInvalid())
00469 {
00470
00471 for(auto it = allConfigurationInfo_[configurationName].versions_.begin();
00472 it != allConfigurationInfo_[configurationName].versions_.end(); )
00473 {
00474 if(it->isTemporaryVersion())
00475 {
00476 __MOUT__ << "Removing version info: " << *it << std::endl;
00477 allConfigurationInfo_[configurationName].versions_.erase(it++);
00478 }
00479 else
00480 ++it;
00481 }
00482 }
00483 else
00484 {
00485 __MOUT__ << "Removing version info: " << targetVersion << std::endl;
00486 auto it = allConfigurationInfo_[configurationName].versions_.find(targetVersion);
00487 if(it == allConfigurationInfo_[configurationName].versions_.end())
00488 {
00489 __MOUT__ << "Target version was not found in info versions..." << std::endl;
00490 return;
00491 }
00492 allConfigurationInfo_[configurationName].versions_.erase(
00493 allConfigurationInfo_[configurationName].versions_.find(targetVersion));
00494 __MOUT__ << "Target version was erased from info." << std::endl;
00495 }
00496 }
00497
00498
00499
00500
00501
00502
00503 void ConfigurationManagerRW::clearCachedVersions(const std::string &configurationName)
00504 {
00505 ConfigurationBase* config = getConfigurationByName(configurationName);
00506
00507 config->trimCache(0);
00508 }
00509
00510
00511
00512
00513
00514
00515 void ConfigurationManagerRW::clearAllCachedVersions()
00516 {
00517 for(auto configInfo: allConfigurationInfo_)
00518 configInfo.second.configurationPtr_->trimCache(0);
00519 }
00520
00521
00522
00523 ConfigurationVersion ConfigurationManagerRW::copyViewToCurrentColumns(const std::string &configurationName,
00524 ConfigurationVersion sourceVersion)
00525 {
00526 getConfigurationByName(configurationName)->reset();
00527
00528
00529
00530 ConfigurationBase *config = getVersionedConfigurationByName(configurationName,
00531 ConfigurationVersion(sourceVersion), true);
00532
00533
00534 ConfigurationVersion newTemporaryVersion = config->copyView(config->getView(),
00535 ConfigurationVersion(),username_);
00536
00537
00538 allConfigurationInfo_[configurationName].versions_.insert(newTemporaryVersion);
00539
00540 return newTemporaryVersion;
00541 }
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554 ConfigurationGroupKey ConfigurationManagerRW::findConfigurationGroup(const std::string &groupName,
00555 const std::map<std::string, ConfigurationVersion> &groupMemberMap)
00556 {
00557 std::set<std::string > groupNames =
00558 theInterface_->getAllConfigurationGroupNames(groupName);
00559 std::string name;
00560 ConfigurationGroupKey key;
00561 std::map<std::string , ConfigurationVersion > compareToMemberMap;
00562 bool isDifferent;
00563 for(auto &fullName: groupNames)
00564 {
00565 ConfigurationGroupKey::getGroupNameAndKey(fullName,name,key);
00566
00567 __MOUT__ << fullName << " has name " << name << " ==? " << groupName << std::endl;
00568 if( name != groupName) continue;
00569
00570 __MOUT__ << name << " == " << groupName << std::endl;
00571 compareToMemberMap = theInterface_->getConfigurationGroupMembers(fullName);
00572
00573 isDifferent = false;
00574 for(auto &memberPair: groupMemberMap)
00575 {
00576 __MOUT__ << memberPair.first << " - " << memberPair.second << std::endl;
00577 if(compareToMemberMap.find(memberPair.first) == compareToMemberMap.end() ||
00578 memberPair.second != compareToMemberMap[memberPair.first])
00579 {
00580 __MOUT__ << "mismatch found!" << std::endl;
00581 isDifferent = true;
00582 break;
00583 }
00584 }
00585 if(isDifferent) continue;
00586
00587
00588 if(groupMemberMap.size() != compareToMemberMap.size()) continue;
00589
00590 __MOUT__ << "Found exact match with key: " << key << std::endl;
00591
00592 return key;
00593 }
00594 __MOUT__ << "no match found!" << std::endl;
00595
00596 return ConfigurationGroupKey();
00597 }
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607 ConfigurationGroupKey ConfigurationManagerRW::saveNewConfigurationGroup(const std::string &groupName,
00608 std::map<std::string, ConfigurationVersion> &groupMembers,
00609 ConfigurationGroupKey previousVersion, const std::string &groupComment)
00610 {
00611
00612
00613
00614
00615
00616
00617 __MOUT__ << std::endl;
00618
00619 ConfigurationGroupKey newKey;
00620 if(!previousVersion.isInvalid())
00621 newKey = ConfigurationGroupKey::getNextKey(previousVersion);
00622 else
00623 {
00624 std::set<ConfigurationGroupKey> keys = theInterface_->getKeys(groupName);
00625 if(keys.size())
00626 newKey = ConfigurationGroupKey::getNextKey(*(keys.crbegin()));
00627 else
00628 newKey = ConfigurationGroupKey::getDefaultKey();
00629 }
00630
00631 __MOUT__ << "New Key for group: " << groupName << " found as " << newKey << std::endl;
00632
00633
00634
00635 std::map<std::string, ConfigurationInfo> allCfgInfo = getAllConfigurationInfo();
00636 for(auto &memberPair : groupMembers )
00637 {
00638
00639 if(allCfgInfo.find(memberPair.first) == allCfgInfo.end())
00640 {
00641 __MOUT_ERR__ << "Group member \"" << memberPair.first << "\" not found in configuration!";
00642
00643 if(groupMetadataTable_.getConfigurationName() ==
00644 memberPair.first)
00645 {
00646 __MOUT_WARN__ << "Looks like this is the groupMetadataTable_. " <<
00647 "Note that this table is added to the member map when groups are saved." <<
00648 "It should not be part of member map when calling this function." << std::endl;
00649 __MOUT__ << "Attempting to recover." << std::endl;
00650 groupMembers.erase(groupMembers.find(memberPair.first));
00651 }
00652 else
00653 throw std::runtime_error("Group member not found!");
00654 }
00655
00656 if(allCfgInfo[memberPair.first].versions_.find(memberPair.second) ==
00657 allCfgInfo[memberPair.first].versions_.end())
00658 {
00659 __MOUT_ERR__ << "Group member \"" << memberPair.first << "\" version \"" <<
00660 memberPair.second << "\" not found in configuration!";
00661 throw std::runtime_error("Group member version not found!");
00662 }
00663 }
00664
00665
00666 try
00667 {
00668
00669
00670
00671
00672 groupMetadataTable_.getViewP()->setValue(groupComment,0,1);
00673 groupMetadataTable_.getViewP()->setValue(username_,0,2);
00674 groupMetadataTable_.getViewP()->setValue(time(0),0,3);
00675
00676
00677 groupMetadataTable_.getViewP()->setVersion(
00678 ConfigurationVersion::getNextVersion(theInterface_->findLatestVersion(&groupMetadataTable_))
00679 );
00680
00681
00682
00683 theInterface_->saveActiveVersion(&groupMetadataTable_);
00684
00685
00686 groupMembers[groupMetadataTable_.getConfigurationName()] =
00687 groupMetadataTable_.getViewVersion();
00688
00689 theInterface_->saveConfigurationGroup(groupMembers,
00690 ConfigurationGroupKey::getFullGroupString(groupName,newKey));
00691 __MOUT__ << "Created config group: " << groupName << ":" << newKey << std::endl;
00692 }
00693 catch(std::runtime_error &e)
00694 {
00695 __MOUT_ERR__ << "Failed to create config group: " << groupName << ":" << newKey << std::endl;
00696 __MOUT_ERR__ << "\n\n" << e.what() << std::endl;
00697 throw;
00698 }
00699 catch(...)
00700 {
00701 __MOUT_ERR__ << "Failed to create config group: " << groupName << ":" << newKey << std::endl;
00702 throw;
00703 }
00704
00705
00706 return newKey;
00707 }
00708
00709
00710
00711
00712
00713 ConfigurationVersion ConfigurationManagerRW::saveNewBackbone(ConfigurationVersion temporaryVersion)
00714 {
00715 __MOUT_INFO__ << "Creating new backbone from temporary version " <<
00716 temporaryVersion << std::endl;
00717
00718
00719 ConfigurationVersion newVersion(ConfigurationVersion::DEFAULT);
00720 ConfigurationVersion retNewVersion;
00721 auto backboneMemberNames = ConfigurationManager::getBackboneMemberNames();
00722 for (auto& name : backboneMemberNames)
00723 {
00724 retNewVersion = ConfigurationManager::getConfigurationByName(name)->getNextVersion();
00725 __MOUT__ << "New version for backbone member (" << name << "): " <<
00726 retNewVersion << std::endl;
00727 if(retNewVersion > newVersion)
00728 newVersion = retNewVersion;
00729 }
00730
00731 __MOUT__ << "Common new backbone version found as " <<
00732 newVersion << std::endl;
00733
00734
00735 for (auto& name : backboneMemberNames)
00736 {
00737
00738 retNewVersion = getConfigurationInterface()->saveNewVersion(
00739 getConfigurationByName(name), temporaryVersion, newVersion);
00740 if(retNewVersion != newVersion)
00741 {
00742 __MOUT_ERR__ << "Failure! New view requested was " <<
00743 newVersion << ". Mismatched new view created: " << retNewVersion << std::endl;
00744 throw std::runtime_error("Mismatched temporary view created!");
00745 }
00746 }
00747
00748 return newVersion;
00749 }
00750
00751
00752 void ConfigurationManagerRW::testXDAQContext()
00753 {
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906 try
00907 {
00908 __MOUT__ << "Loading config..." << std::endl;
00909 loadConfigurationGroup("FETest",ConfigurationGroupKey(2));
00910 ConfigurationTree t = getNode("/FEConfiguration/DEFAULT/FrontEndType");
00911
00912 std::string v;
00913
00914 __MOUT__ << std::endl;
00915 t.getValue(v);
00916 __MOUT__ << "Value: " << v << std::endl;
00917 __MOUT__ << "Value index: " << t.getValue<int>() << std::endl;
00918
00919 return;
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956 }
00957 catch(...)
00958 {
00959 __MOUT__ << "Failed to load config..." << std::endl;
00960 }
00961
00962
00963 }
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976