CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/RecoLuminosity/LumiProducer/src/DBConfig.cc

Go to the documentation of this file.
00001 #include "RecoLuminosity/LumiProducer/interface/DBConfig.h"
00002 #include "RelationalAccess/ConnectionService.h"
00003 #include "RelationalAccess/IConnectionServiceConfiguration.h"
00004 #include "CoralKernel/Context.h"
00005 #include "CoralKernel/IProperty.h"
00006 #include "CoralKernel/IPropertyManager.h"
00007 #include <boost/filesystem/operations.hpp>
00008 namespace lumi{
00009   const std::string defaultAuthFileName="authentication.xml";
00010 }
00011 lumi::DBConfig::DBConfig(coral::ConnectionService& svc): m_svc(&svc){
00012 }
00013 lumi::DBConfig::~DBConfig(){
00014 }
00015 void lumi::DBConfig::setAuthentication( const std::string& authPath ){
00016   boost::filesystem::path boostAuthPath(authPath);
00017   if(boost::filesystem::is_directory(boostAuthPath)){
00018     boostAuthPath /= boost::filesystem::path(lumi::defaultAuthFileName);
00019   }
00020   std::string authFileName=boostAuthPath.string();
00021   coral::Context::instance().PropertyManager().property("AuthenticationFile")->set(authFileName);
00022   coral::Context::instance().loadComponent("CORAL/Services/XMLAuthenticationService");
00023 }
00024 std::string lumi::DBConfig::trueConnectStr( const std::string& usercon ){
00025   //empty for now
00026   return usercon;
00027 }
00028