Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:00:53

0001 #include "RecoLuminosity/LumiProducer/interface/DBConfig.h"
0002 #include "RelationalAccess/ConnectionService.h"
0003 #include "RelationalAccess/IConnectionServiceConfiguration.h"
0004 #include "CoralKernel/Context.h"
0005 #include "CoralKernel/IProperty.h"
0006 #include "CoralKernel/IPropertyManager.h"
0007 
0008 #include <filesystem>
0009 
0010 namespace lumi {
0011   const std::string defaultAuthFileName = "authentication.xml";
0012 }
0013 lumi::DBConfig::DBConfig(coral::ConnectionService& svc) : m_svc(&svc) {}
0014 lumi::DBConfig::~DBConfig() {}
0015 void lumi::DBConfig::setAuthentication(const std::string& authPath) {
0016   std::filesystem::path filesystemAuthPath(authPath);
0017   if (std::filesystem::is_directory(filesystemAuthPath)) {
0018     filesystemAuthPath /= std::filesystem::path(lumi::defaultAuthFileName);
0019   }
0020   std::string authFileName = filesystemAuthPath.string();
0021   coral::Context::instance().PropertyManager().property("AuthenticationFile")->set(authFileName);
0022   coral::Context::instance().loadComponent("CORAL/Services/XMLAuthenticationService");
0023 }
0024 std::string lumi::DBConfig::trueConnectStr(const std::string& usercon) {
0025   //empty for now
0026   return usercon;
0027 }