diff --git a/Alignment/CocoaApplication/BuildFile.xml b/Alignment/CocoaApplication/BuildFile.xml
index c28e43946b02a..2a5b475a99bea 100644
--- a/Alignment/CocoaApplication/BuildFile.xml
+++ b/Alignment/CocoaApplication/BuildFile.xml
@@ -1,8 +1,6 @@
-
-
@@ -14,6 +12,5 @@
-
diff --git a/Alignment/CocoaApplication/src/CocoaAnalyzer.cc b/Alignment/CocoaApplication/src/CocoaAnalyzer.cc
index b1d3cb2bf1aec..a0c6c062658cc 100644
--- a/Alignment/CocoaApplication/src/CocoaAnalyzer.cc
+++ b/Alignment/CocoaApplication/src/CocoaAnalyzer.cc
@@ -1,5 +1,4 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CondCore/DBCommon/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
diff --git a/Alignment/CocoaFit/BuildFile.xml b/Alignment/CocoaFit/BuildFile.xml
index 3475a3141e75c..619b6a96fff5c 100644
--- a/Alignment/CocoaFit/BuildFile.xml
+++ b/Alignment/CocoaFit/BuildFile.xml
@@ -10,7 +10,6 @@
-
diff --git a/Alignment/CocoaFit/src/CocoaDBMgr.cc b/Alignment/CocoaFit/src/CocoaDBMgr.cc
index 0d919e6d52a6b..29421a0f8fc62 100644
--- a/Alignment/CocoaFit/src/CocoaDBMgr.cc
+++ b/Alignment/CocoaFit/src/CocoaDBMgr.cc
@@ -4,7 +4,6 @@
#include "CondFormats/Alignment/interface/AlignTransformErrorExtended.h"
#include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CondCore/DBCommon/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
diff --git a/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h b/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h
index 32e8e9ee458f6..40c1f9af874f6 100644
--- a/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h
+++ b/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h
@@ -33,7 +33,7 @@ class Trajectory;
// class TsosVectorCollection;
// class TkFittedLasBeamCollection;
// class AliClusterValueMap;
-#include "CondCore/DBCommon/interface/Time.h"
+#include "CondCore/CondDB/interface/Time.h"
#include "Alignment/LaserAlignment/interface/TsosVectorCollection.h"
#include "DataFormats/Alignment/interface/TkFittedLasBeamCollectionFwd.h"
#include "DataFormats/Alignment/interface/AliClusterValueMapFwd.h"
diff --git a/Alignment/MuonAlignment/BuildFile.xml b/Alignment/MuonAlignment/BuildFile.xml
index 5959cd414f7ee..840fca465bbd2 100644
--- a/Alignment/MuonAlignment/BuildFile.xml
+++ b/Alignment/MuonAlignment/BuildFile.xml
@@ -12,7 +12,6 @@
-
diff --git a/CalibCalorimetry/CaloMiscalibTools/BuildFile.xml b/CalibCalorimetry/CaloMiscalibTools/BuildFile.xml
index 5c48b50a62013..b09d508d75a83 100644
--- a/CalibCalorimetry/CaloMiscalibTools/BuildFile.xml
+++ b/CalibCalorimetry/CaloMiscalibTools/BuildFile.xml
@@ -11,7 +11,6 @@
-
diff --git a/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/interface/EcnaAnalyzer.h b/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/interface/EcnaAnalyzer.h
index dd76e37985941..807d6aa3bc201 100644
--- a/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/interface/EcnaAnalyzer.h
+++ b/CalibCalorimetry/EcalCorrelatedNoiseAnalysisModules/interface/EcnaAnalyzer.h
@@ -48,7 +48,7 @@
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "CondCore/DBCommon/interface/Time.h"
+#include "CondCore/CondDB/interface/Time.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
diff --git a/CalibCalorimetry/EcalTPGTools/BuildFile.xml b/CalibCalorimetry/EcalTPGTools/BuildFile.xml
index f68f1fa80a47e..3653c6a1d060d 100644
--- a/CalibCalorimetry/EcalTPGTools/BuildFile.xml
+++ b/CalibCalorimetry/EcalTPGTools/BuildFile.xml
@@ -5,7 +5,6 @@
-
diff --git a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h
index 935be6434019f..390c4f4196103 100644
--- a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h
+++ b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h
@@ -2,7 +2,7 @@
#define ECALTPGDBCOPY_H
#include "FWCore/Framework/interface/EDAnalyzer.h"
-#include "CondCore/DBCommon/interface/Exception.h"
+#include "CondCore/CondDB/interface/Exception.h"
#include "FWCore/Framework/interface/IOVSyncValue.h"
diff --git a/CalibMuon/CSCCalibration/test/BuildFile.xml b/CalibMuon/CSCCalibration/test/BuildFile.xml
index 6150d34cf54a3..ba81e9855e3b1 100644
--- a/CalibMuon/CSCCalibration/test/BuildFile.xml
+++ b/CalibMuon/CSCCalibration/test/BuildFile.xml
@@ -2,7 +2,6 @@
-
diff --git a/CalibTracker/SiPixelConnectivity/BuildFile.xml b/CalibTracker/SiPixelConnectivity/BuildFile.xml
index 8e015256c9455..80c6763008ffe 100644
--- a/CalibTracker/SiPixelConnectivity/BuildFile.xml
+++ b/CalibTracker/SiPixelConnectivity/BuildFile.xml
@@ -7,9 +7,6 @@
-
-
-
diff --git a/CalibTracker/SiStripDCS/BuildFile.xml b/CalibTracker/SiStripDCS/BuildFile.xml
index fe19a07f40f95..4d6605505bbf7 100644
--- a/CalibTracker/SiStripDCS/BuildFile.xml
+++ b/CalibTracker/SiStripDCS/BuildFile.xml
@@ -13,7 +13,6 @@
-
diff --git a/CalibTracker/SiStripDCS/interface/SiStripCoralIface.h b/CalibTracker/SiStripDCS/interface/SiStripCoralIface.h
index 65d1060ae3c84..93a44c78a5be2 100644
--- a/CalibTracker/SiStripDCS/interface/SiStripCoralIface.h
+++ b/CalibTracker/SiStripDCS/interface/SiStripCoralIface.h
@@ -1,9 +1,7 @@
#ifndef SISTRIPCORALIFACE_H
#define SISTRIPCORALIFACE_H
-#include "CondCore/DBCommon/interface/DbSession.h"
-#include "CondCore/DBCommon/interface/DbConnection.h"
-#include "CondCore/DBCommon/interface/DbScopedTransaction.h"
-#include "CondCore/DBCommon/interface/Exception.h"
+#include "CondCore/CondDB/interface/Session.h"
+#include "CondCore/CondDB/interface/Exception.h"
#include "CoralBase/TimeStamp.h"
#include
@@ -36,13 +34,12 @@ class SiStripCoralIface
/* member variables*/
std::string m_connectionString;
+ std::string m_authPath;
std::map m_id_map;
- // cond::DBSession* session;
- cond::DbConnection m_connection;
- cond::DbSession m_session;
+ cond::persistency::Session m_session;
+ std::auto_ptr m_transaction;
// cond::CoralTransaction* m_coraldb;
// cond::Connection* con;
- std::auto_ptr m_transaction;
bool debug_;
};
diff --git a/CalibTracker/SiStripDCS/interface/SiStripDetVOffHandler.h b/CalibTracker/SiStripDCS/interface/SiStripDetVOffHandler.h
index 62b28999a7106..4ebec53326287 100644
--- a/CalibTracker/SiStripDCS/interface/SiStripDetVOffHandler.h
+++ b/CalibTracker/SiStripDCS/interface/SiStripDetVOffHandler.h
@@ -6,8 +6,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CondCore/DBCommon/interface/TagInfo.h"
-
#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h"
#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h"
diff --git a/CalibTracker/SiStripDCS/plugins/BuildFile.xml b/CalibTracker/SiStripDCS/plugins/BuildFile.xml
index 5542f34cb1d41..a4cda2f4b603b 100644
--- a/CalibTracker/SiStripDCS/plugins/BuildFile.xml
+++ b/CalibTracker/SiStripDCS/plugins/BuildFile.xml
@@ -4,7 +4,6 @@
-
diff --git a/CalibTracker/SiStripDCS/src/SiStripCoralIface.cc b/CalibTracker/SiStripDCS/src/SiStripCoralIface.cc
index caa365e31c5b8..a1f3c155e08d8 100644
--- a/CalibTracker/SiStripDCS/src/SiStripCoralIface.cc
+++ b/CalibTracker/SiStripDCS/src/SiStripCoralIface.cc
@@ -1,5 +1,5 @@
#include "CalibTracker/SiStripDCS/interface/SiStripCoralIface.h"
-
+#include "CondCore/CondDB/interface/ConnectionPool.h"
#include "RelationalAccess/ISessionProxy.h"
#include "RelationalAccess/ISchema.h"
#include "RelationalAccess/ITable.h"
@@ -18,11 +18,9 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
// constructor
-SiStripCoralIface::SiStripCoralIface( std::string connectionString , std::string authenticationPath, const bool debug) : m_connectionString(connectionString), m_session(), debug_(debug)
+SiStripCoralIface::SiStripCoralIface( std::string connectionString , std::string authenticationPath, const bool debug) : m_connectionString(connectionString), m_authPath( authenticationPath ), m_session(), debug_(debug)
{
std::cout << "Building coral interface" << std::endl;
- m_connection.configuration().setAuthenticationPath(authenticationPath);
- m_connection.configure();
initialize();
}
@@ -34,10 +32,12 @@ SiStripCoralIface::~SiStripCoralIface() {
// open DB connection
void SiStripCoralIface::initialize() {
- m_session = m_connection.createSession();
- m_session.open(m_connectionString);
+ cond::persistency::ConnectionPool connection;
+ connection.setAuthenticationPath(m_authPath);
+ connection.configure();
+ m_session = connection.createSession(m_connectionString);
try {
- m_transaction.reset( new cond::DbScopedTransaction(m_session) );
+ m_transaction.reset( new cond::persistency::TransactionScope(m_session.transaction()) );
m_transaction->start(true);
LogTrace("SiStripCoralIface") << "[SiStripCoralIface::" << __func__ << "] Database connection opened";
}
@@ -51,7 +51,7 @@ void SiStripCoralIface::initialize() {
void SiStripCoralIface::doQuery(std::string queryType, const coral::TimeStamp& startTime, const coral::TimeStamp& endTime, std::vector &vec_changedate,
std::vector &vec_actualValue, std::vector &vec_dpname)
{
- std::auto_ptr query( m_session.schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
+ std::auto_ptr query( m_session.coralSession().schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
std::string condition;
LogTrace("SiStripCoralIface") << "[SiStripCoralIface::" << __func__ << "] table to be accessed: " << queryType;
@@ -118,7 +118,7 @@ void SiStripCoralIface::doQuery(std::string queryType, const coral::TimeStamp& s
void SiStripCoralIface::doSettingsQuery(const coral::TimeStamp& startTime, const coral::TimeStamp& endTime, std::vector &vec_changedate,
std::vector &vec_settings, std::vector &vec_dpname, std::vector &vec_dpid)
{
- std::auto_ptr query( m_session.schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
+ std::auto_ptr query( m_session.coralSession().schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
query->addToOutputList("FWCAENCHANNEL.CHANGE_DATE","CHANGE_DATE");
query->addToOutputList("FWCAENCHANNEL.SETTINGS_V0","VSET");
query->addToOutputList("FWCAENCHANNEL.DPID","DPID");
@@ -157,7 +157,7 @@ void SiStripCoralIface::doSettingsQuery(const coral::TimeStamp& startTime, const
void SiStripCoralIface::doNameQuery(std::vector &vec_dpname, std::vector &vec_dpid)
{
- std::auto_ptr query( m_session.schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
+ std::auto_ptr query( m_session.coralSession().schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
query->addToOutputList("DP_NAME2ID.DPNAME","DPNAME");
query->addToOutputList("DP_NAME2ID.ID","DPID");
query->addToTableList("DP_NAME2ID");
diff --git a/CalibTracker/SiStripESProducers/plugins/BuildFile.xml b/CalibTracker/SiStripESProducers/plugins/BuildFile.xml
index 495560c6965a0..83e06dabe600b 100644
--- a/CalibTracker/SiStripESProducers/plugins/BuildFile.xml
+++ b/CalibTracker/SiStripESProducers/plugins/BuildFile.xml
@@ -1,7 +1,6 @@
-
diff --git a/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h b/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h
index bba5ee337b009..9b6495219392b 100644
--- a/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h
+++ b/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondDBWriter.h
@@ -9,7 +9,6 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
-#include "CondCore/DBCommon/interface/Time.h"
#include "FWCore/Utilities/interface/Exception.h"
diff --git a/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondObjPrinter.h b/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondObjPrinter.h
index cbb266a9c6b09..e6f5153201ab7 100644
--- a/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondObjPrinter.h
+++ b/CalibTracker/SiStripESProducers/plugins/DBWriter/DummyCondObjPrinter.h
@@ -7,7 +7,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CondCore/DBCommon/interface/Time.h"
#include "FWCore/Utilities/interface/Exception.h"
#include
diff --git a/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.h b/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.h
index 23e97a8eb3323..dfb171b7409a3 100644
--- a/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.h
+++ b/CalibTracker/SiStripESProducers/plugins/DBWriter/SiStripFedCablingManipulator.h
@@ -8,7 +8,6 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
-#include "CondCore/DBCommon/interface/Time.h"
#include "FWCore/Utilities/interface/Exception.h"
diff --git a/CalibTracker/SiStripESProducers/plugins/fake/SiStripApvGainBuilderFromTag.h b/CalibTracker/SiStripESProducers/plugins/fake/SiStripApvGainBuilderFromTag.h
index 1ac1ee0aaa1b7..5d074c07d87e4 100644
--- a/CalibTracker/SiStripESProducers/plugins/fake/SiStripApvGainBuilderFromTag.h
+++ b/CalibTracker/SiStripESProducers/plugins/fake/SiStripApvGainBuilderFromTag.h
@@ -2,7 +2,6 @@
#define SiStripApvGainBuilderFromTag_H
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CondCore/DBCommon/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
diff --git a/CalibTracker/SiStripESProducers/plugins/fake/SiStripNoiseNormalizedWithApvGainBuilder.h b/CalibTracker/SiStripESProducers/plugins/fake/SiStripNoiseNormalizedWithApvGainBuilder.h
index 5dc63df8f6700..b71ee7269ec2b 100644
--- a/CalibTracker/SiStripESProducers/plugins/fake/SiStripNoiseNormalizedWithApvGainBuilder.h
+++ b/CalibTracker/SiStripESProducers/plugins/fake/SiStripNoiseNormalizedWithApvGainBuilder.h
@@ -2,7 +2,6 @@
#define SiStripNoiseNormalizedWithApvGainBuilder_H
#include "FWCore/ServiceRegistry/interface/Service.h"
-#include "CondCore/DBCommon/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
diff --git a/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h b/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h
index 6d5c4cdf7ca26..3408ad7a0f008 100644
--- a/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h
+++ b/CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h
@@ -139,7 +139,6 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Run.h"
-#include "CondCore/DBCommon/interface/Time.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
diff --git a/CondCore/BeamSpotPlugins/BuildFile.xml b/CondCore/BeamSpotPlugins/BuildFile.xml
index fbcd744dbd689..ebff3f7d1f4a4 100644
--- a/CondCore/BeamSpotPlugins/BuildFile.xml
+++ b/CondCore/BeamSpotPlugins/BuildFile.xml
@@ -1,6 +1,5 @@
-
diff --git a/CondCore/CondDB/BuildFile.xml b/CondCore/CondDB/BuildFile.xml
index d5cab07b1744b..7a0509ea30b3f 100644
--- a/CondCore/CondDB/BuildFile.xml
+++ b/CondCore/CondDB/BuildFile.xml
@@ -1,4 +1,3 @@
-
diff --git a/CondCore/CondDB/interface/Auth.h b/CondCore/CondDB/interface/Auth.h
new file mode 100644
index 0000000000000..df9ab144f769d
--- /dev/null
+++ b/CondCore/CondDB/interface/Auth.h
@@ -0,0 +1,32 @@
+#ifndef CondCore_CondDB_Auth_h
+#define CondCore_CondDB_Auth_h
+
+#include
+
+namespace cond{
+
+ namespace auth {
+
+ static constexpr const char* const COND_AUTH_PATH = "COND_AUTH_PATH";
+ static constexpr const char* const COND_AUTH_SYS = "COND_AUTH_SYS";
+
+ static constexpr const char* const COND_ADMIN_GROUP = "COND_ADMIN_GROUP";
+
+ static constexpr const char* const COND_DEFAULT_ROLE = "COND_DEFAULT_ROLE";
+ static constexpr const char* const COND_WRITER_ROLE = "COND_WRITER_ROLE";
+ static constexpr const char* const COND_READER_ROLE = "COND_READER_ROLE";
+ static constexpr const char* const COND_ADMIN_ROLE = "COND_ADMIN_ROLE";
+
+ static constexpr const char* const COND_DEFAULT_PRINCIPAL = "COND_DEFAULT_PRINCIPAL";
+
+ static constexpr const char* const COND_KEY = "Memento";
+
+ static constexpr unsigned int COND_AUTHENTICATION_KEY_SIZE = 30;
+ static constexpr unsigned int COND_DB_KEY_SIZE = 30;
+
+ static constexpr const char* const COND_AUTH_PATH_PROPERTY = "AuthenticationFile";
+ }
+
+}
+#endif
+
diff --git a/CondCore/CondDB/interface/Cipher.h b/CondCore/CondDB/interface/Cipher.h
new file mode 100644
index 0000000000000..5cdc07c776dd7
--- /dev/null
+++ b/CondCore/CondDB/interface/Cipher.h
@@ -0,0 +1,41 @@
+#ifndef CondCore_CondDB_Cipher_h
+#define CondCore_CondDB_Cipher_h
+
+#include
+#include
+
+struct BLOWFISH_CTX;
+
+namespace cond {
+
+ namespace auth {
+
+ class Cipher {
+ public:
+
+ explicit Cipher( const std::string& key );
+
+ ~Cipher();
+
+ size_t encrypt( const std::string& input, unsigned char*& output );
+
+ std::string decrypt( const unsigned char* input, size_t inputSize );
+
+ std::string b64encrypt( const std::string& input );
+
+ std::string b64decrypt( const std::string& input );
+
+ private:
+
+ size_t bf_process_alloc( const unsigned char* input, size_t input_size, unsigned char*& output, bool decrypt=false );
+
+ private:
+
+ BLOWFISH_CTX* m_ctx;
+ };
+ }
+
+}
+
+#endif // CondCore_CondDB_Cipher_h
+
diff --git a/CondCore/CondDB/interface/ConnectionPool.h b/CondCore/CondDB/interface/ConnectionPool.h
index ceafb54a4cd08..93f91134045f7 100644
--- a/CondCore/CondDB/interface/ConnectionPool.h
+++ b/CondCore/CondDB/interface/ConnectionPool.h
@@ -36,29 +36,33 @@ namespace cond {
void setMessageVerbosity( coral::MsgLevel level );
void setAuthenticationPath( const std::string& p );
void setAuthenticationSystem( int authSysCode );
+ void setFrontierSecurity( const std::string& signature );
void setLogging( bool flag );
bool isLoggingEnabled() const;
void setParameters( const edm::ParameterSet& connectionPset );
void configure();
- Session createSession( const std::string& connectionString, bool writeCapable=false );
+ Session createSession( const std::string& connectionString, bool writeCapable = false );
Session createReadOnlySession( const std::string& connectionString, const std::string& transactionId );
- boost::shared_ptr createCoralSession( const std::string& connectionString, bool writeCapable=false );
+ boost::shared_ptr createCoralSession( const std::string& connectionString, bool writeCapable = false );
private:
boost::shared_ptr createCoralSession( const std::string& connectionString,
- const std::string& transactionId,
- bool writeCapable=false );
+ const std::string& transactionId,
+ bool writeCapable = false );
Session createSession( const std::string& connectionString,
- const std::string& transactionId,
- bool writeCapable=false );
- void configure( coral::IConnectionServiceConfiguration& coralConfig);
+ const std::string& transactionId,
+ bool writeCapable = false );
+ void configure( coral::IConnectionServiceConfiguration& coralConfig );
private:
- std::string m_authPath;
+ std::string m_authPath = std::string( "" );
int m_authSys = 0;
coral::MsgLevel m_messageLevel = coral::Error;
bool m_loggingEnabled = false;
+ //The frontier security option is turned on for all sessions
+ //usig this wrapper of the CORAL connection setup for configuring the server access
+ std::string m_frontierSecurity = std::string( "" );
// this one has to be moved!
- cond::CoralServiceManager* m_pluginManager = 0;
+ cond::CoralServiceManager* m_pluginManager = nullptr;
std::map m_dbTypes;
};
}
diff --git a/CondCore/DBCommon/interface/CoralServiceFactory.h b/CondCore/CondDB/interface/CoralServiceFactory.h
similarity index 76%
rename from CondCore/DBCommon/interface/CoralServiceFactory.h
rename to CondCore/CondDB/interface/CoralServiceFactory.h
index 7b1671f327830..b3690518e2c46 100644
--- a/CondCore/DBCommon/interface/CoralServiceFactory.h
+++ b/CondCore/CondDB/interface/CoralServiceFactory.h
@@ -1,12 +1,12 @@
-#ifndef CondCore_DBCommon_CoralServiceFactory_h
-#define CondCore_DBCommon_CoralServiceFactory_h
+#ifndef CondCore_CondDB_CoralServiceFactory_h
+#define CondCore_CondDB_CoralServiceFactory_h
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include
//
-// Package: CondCore/DBCommon
+// Package: CondCore/CondDB
// Class : CoralServiceFactory
//
-/**\class CoralServiceFactory CoralServiceFactory.h CondCore/DBCommon/interface/CoralServiceFactory.h
+/**\class CoralServiceFactory CoralServiceFactory.h CondCore/CondDB/interface/CoralServiceFactory.h
Description: A special edm plugin factory that creates coral::Service
diff --git a/CondCore/DBCommon/interface/CoralServiceMacros.h b/CondCore/CondDB/interface/CoralServiceMacros.h
similarity index 62%
rename from CondCore/DBCommon/interface/CoralServiceMacros.h
rename to CondCore/CondDB/interface/CoralServiceMacros.h
index 1546337b92a19..c025663990624 100644
--- a/CondCore/DBCommon/interface/CoralServiceMacros.h
+++ b/CondCore/CondDB/interface/CoralServiceMacros.h
@@ -1,7 +1,7 @@
-#ifndef CondCore_DBCommon_CoralServiceMacros_h
-#define CondCore_DBCommon_CoralServiceMacros_h
+#ifndef CondCore_CondDB_CoralServiceMacros_h
+#define CondCore_CondDB_CoralServiceMacros_h
-#include "CondCore/DBCommon/interface/CoralServiceFactory.h"
+#include "CondCore/CondDB/interface/CoralServiceFactory.h"
#include "CoralKernel/Service.h"
#define DEFINE_CORALSERVICE(type,name) \
diff --git a/CondCore/DBCommon/interface/CoralServiceManager.h b/CondCore/CondDB/interface/CoralServiceManager.h
similarity index 79%
rename from CondCore/DBCommon/interface/CoralServiceManager.h
rename to CondCore/CondDB/interface/CoralServiceManager.h
index 270a9545af9e8..862dc74edfdf9 100644
--- a/CondCore/DBCommon/interface/CoralServiceManager.h
+++ b/CondCore/CondDB/interface/CoralServiceManager.h
@@ -1,13 +1,13 @@
-#ifndef CondCore_DBCommon_CoralServiceManager_h
-#define CondCore_DBCommon_CoralServiceManager_h
+#ifndef CondCore_CondDB_CoralServiceManager_h
+#define CondCore_CondDB_CoralServiceManager_h
#include "CoralKernel/IPluginManager.h"
#include
#include
//
-// Package: CondCore/DBCommon
+// Package: CondCore/CondDB
// Class : CoralServiceManager
//
-/**\class CoralServiceManager CoralServiceManager.h CondCore/DBCommon/interface/CoralServiceManager.h
+/**\class CoralServiceManager CoralServiceManager.h CondCore/CondDB/interface/CoralServiceManager.h
Description: This is a bridge that implement coral::IPluginManager interface and internally uses edm plugin factory to create plugins of type coral::Service.
diff --git a/CondCore/DBCommon/interface/CredentialStore.h b/CondCore/CondDB/interface/CredentialStore.h
similarity index 95%
rename from CondCore/DBCommon/interface/CredentialStore.h
rename to CondCore/CondDB/interface/CredentialStore.h
index b8022d6fdbbac..fb825cf691283 100644
--- a/CondCore/DBCommon/interface/CredentialStore.h
+++ b/CondCore/CondDB/interface/CredentialStore.h
@@ -1,13 +1,13 @@
-#ifndef INCLUDE_COND_CREDENTIALSTORE_H
-#define INCLUDE_COND_CREDENTAILSTORE_H
+#ifndef CondCore_CondDB_CredentialStore_h
+#define CondCore_CondDB_CredentialStore_h
-#include "CondCore/DBCommon/interface/DecodingKey.h"
+#include "CondCore/CondDB/interface/DecodingKey.h"
//
#include
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CondCore/DBCommon/plugins/RelationalAuthenticationService.cc b/CondCore/CondDB/plugins/RelationalAuthenticationService.cc
similarity index 94%
rename from CondCore/DBCommon/plugins/RelationalAuthenticationService.cc
rename to CondCore/CondDB/plugins/RelationalAuthenticationService.cc
index 81bdaff3bad92..d737b00bf87ef 100644
--- a/CondCore/DBCommon/plugins/RelationalAuthenticationService.cc
+++ b/CondCore/CondDB/plugins/RelationalAuthenticationService.cc
@@ -1,8 +1,8 @@
-#include "CondCore/DBCommon/interface/Auth.h"
-#include "CondCore/DBCommon/interface/Exception.h"
+#include "CondCore/CondDB/interface/Auth.h"
+#include "CondCore/CondDB/interface/Exception.h"
#include "RelationalAccess/AuthenticationCredentials.h"
#include "RelationalAccess/AuthenticationServiceException.h"
-#include "CondCore/DBCommon/interface/CoralServiceMacros.h"
+#include "CondCore/CondDB/interface/CoralServiceMacros.h"
#include "RelationalAuthenticationService.h"
//
#include "RelationalAccess/AuthenticationServiceException.h"
@@ -30,7 +30,7 @@ cond::RelationalAuthenticationService::RelationalAuthenticationService::Relation
{
boost::function1 cb(boost::bind(&cond::RelationalAuthenticationService::RelationalAuthenticationService::setAuthenticationPath, this, _1));
- coral::Property* pm = dynamic_cast(coral::Context::instance().PropertyManager().property(Auth::COND_AUTH_PATH_PROPERTY));
+ coral::Property* pm = dynamic_cast(coral::Context::instance().PropertyManager().property(auth::COND_AUTH_PATH_PROPERTY));
if(pm){
setAuthenticationPath( pm->get() );
m_callbackID = pm->registerCallback(cb);
diff --git a/CondCore/DBCommon/plugins/RelationalAuthenticationService.h b/CondCore/CondDB/plugins/RelationalAuthenticationService.h
similarity index 97%
rename from CondCore/DBCommon/plugins/RelationalAuthenticationService.h
rename to CondCore/CondDB/plugins/RelationalAuthenticationService.h
index 7afbce0c484b5..4b5124e84f1d1 100644
--- a/CondCore/DBCommon/plugins/RelationalAuthenticationService.h
+++ b/CondCore/CondDB/plugins/RelationalAuthenticationService.h
@@ -1,7 +1,7 @@
#ifndef COND_XMLAUTHENTITACTIONSERVICE_H
#define COND_XMLAUTHENTITACTIONSERVICE_H
-#include "CondCore/DBCommon/interface/CredentialStore.h"
+#include "CondCore/CondDB/interface/CredentialStore.h"
//
#include "RelationalAccess/IAuthenticationService.h"
#include "CoralKernel/Service.h"
diff --git a/CondCore/DBCommon/plugins/XMLAuthenticationService.cc b/CondCore/CondDB/plugins/XMLAuthenticationService.cc
similarity index 98%
rename from CondCore/DBCommon/plugins/XMLAuthenticationService.cc
rename to CondCore/CondDB/plugins/XMLAuthenticationService.cc
index 5e0984d999dca..f9dd34fb4dfe5 100644
--- a/CondCore/DBCommon/plugins/XMLAuthenticationService.cc
+++ b/CondCore/CondDB/plugins/XMLAuthenticationService.cc
@@ -1,14 +1,13 @@
-//#include "CondCore/DBCommon/interface/DecodingKey.h"
-#include "CondCore/DBCommon/interface/FileUtils.h"
-#include "CondCore/DBCommon/interface/Exception.h"
-#include "CondCore/DBCommon/interface/Auth.h"
+#include "CondCore/CondDB/interface/FileUtils.h"
+#include "CondCore/CondDB/interface/Exception.h"
+#include "CondCore/CondDB/interface/Auth.h"
#include "RelationalAccess/AuthenticationCredentials.h"
#include "CoralCommon/Cipher.h"
#include "RelationalAccess/AuthenticationServiceException.h"
#include "CoralKernel/IPropertyManager.h"
#include "CoralKernel/Property.h"
#include "CoralKernel/Context.h"
-#include "CondCore/DBCommon/interface/CoralServiceMacros.h"
+#include "CondCore/CondDB/interface/CoralServiceMacros.h"
#include "FWCore/Concurrency/interface/Xerces.h"
#include "xercesc/parsers/XercesDOMParser.hpp"
#include "xercesc/framework/MemBufInputSource.hpp"
@@ -96,7 +95,7 @@ cond::XMLAuthenticationService::XMLAuthenticationService::XMLAuthenticationServi
{
boost::function1 cb(boost::bind(&cond::XMLAuthenticationService::XMLAuthenticationService::setAuthenticationPath, this, _1));
- coral::Property* pm = dynamic_cast(coral::Context::instance().PropertyManager().property(Auth::COND_AUTH_PATH_PROPERTY));
+ coral::Property* pm = dynamic_cast(coral::Context::instance().PropertyManager().property(auth::COND_AUTH_PATH_PROPERTY));
if(pm){
setAuthenticationPath( pm->get() );
m_callbackID = pm->registerCallback(cb);
diff --git a/CondCore/DBCommon/plugins/XMLAuthenticationService.h b/CondCore/CondDB/plugins/XMLAuthenticationService.h
similarity index 100%
rename from CondCore/DBCommon/plugins/XMLAuthenticationService.h
rename to CondCore/CondDB/plugins/XMLAuthenticationService.h
diff --git a/CondCore/CondDB/python/CondDB_cfi.py b/CondCore/CondDB/python/CondDB_cfi.py
index 5a3927e1b91f2..3c4969ba1988a 100644
--- a/CondCore/CondDB/python/CondDB_cfi.py
+++ b/CondCore/CondDB/python/CondDB_cfi.py
@@ -4,9 +4,9 @@
DBParameters = cms.PSet(
authenticationPath = cms.untracked.string(''),
authenticationSystem = cms.untracked.int32(0),
+ security = cms.untracked.string(''),
messageLevel = cms.untracked.int32(0),
),
connect = cms.string(''),
- dbFormat = cms.untracked.int32(0)
)
diff --git a/CondCore/CondDB/python/CondDBboost_cfi.py b/CondCore/CondDB/python/CondDBboost_cfi.py
deleted file mode 100644
index 4bdd412977015..0000000000000
--- a/CondCore/CondDB/python/CondDBboost_cfi.py
+++ /dev/null
@@ -1,12 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-CondDBboost = cms.PSet(
- DBParameters = cms.PSet(
- authenticationPath = cms.untracked.string(''),
- authenticationSystem = cms.untracked.int32(0),
- messageLevel = cms.untracked.int32(0),
- ),
- connect = cms.string('protocol://db/schema'), ##db/schema"
- dbFormat = cms.untracked.int32(1)
-)
-
diff --git a/CondCore/DBCommon/src/Cipher.cc b/CondCore/CondDB/src/Cipher.cc
similarity index 83%
rename from CondCore/DBCommon/src/Cipher.cc
rename to CondCore/CondDB/src/Cipher.cc
index 7687973129dcb..b0ec8d301de36 100644
--- a/CondCore/DBCommon/src/Cipher.cc
+++ b/CondCore/CondDB/src/Cipher.cc
@@ -1,5 +1,5 @@
-#include "CondCore/DBCommon/interface/Cipher.h"
-#include "CondCore/DBCommon/interface/Exception.h"
+#include "CondCore/CondDB/interface/Cipher.h"
+#include "CondCore/CondDB/interface/Exception.h"
#include
// blowfish encryption
#include "blowfish.h"
@@ -7,17 +7,17 @@
#include "base64.h"
#include
-cond::Cipher::Cipher( const std::string& key ):
+cond::auth::Cipher::Cipher( const std::string& key ):
m_ctx(new BLOWFISH_CTX){
char* k = const_cast(key.c_str());
Blowfish_Init( m_ctx, reinterpret_cast(k), key.size());
}
-cond::Cipher::~Cipher(){
+cond::auth::Cipher::~Cipher(){
delete m_ctx;
}
-size_t cond::Cipher::bf_process_alloc( const unsigned char* input,
+size_t cond::auth::Cipher::bf_process_alloc( const unsigned char* input,
size_t input_size,
unsigned char*& output,
bool decrypt ){
@@ -68,7 +68,7 @@ size_t cond::Cipher::bf_process_alloc( const unsigned char* input,
return output_size;
}
-size_t cond::Cipher::encrypt( const std::string& input, unsigned char*& output ){
+size_t cond::auth::Cipher::encrypt( const std::string& input, unsigned char*& output ){
if( input.empty() ) {
output = 0;
return 0;
@@ -76,7 +76,7 @@ size_t cond::Cipher::encrypt( const std::string& input, unsigned char*& output )
return bf_process_alloc( reinterpret_cast(input.c_str()), input.size(), output, false );;
}
-std::string cond::Cipher::decrypt( const unsigned char* input, size_t inputSize ){
+std::string cond::auth::Cipher::decrypt( const unsigned char* input, size_t inputSize ){
if( !inputSize ) return "";
unsigned char* out = 0;
size_t outSize = bf_process_alloc( input, inputSize, out, true );
@@ -102,7 +102,7 @@ std::string cond::Cipher::decrypt( const unsigned char* input, size_t inputSize
return ret;
}
-std::string cond::Cipher::b64encrypt( const std::string& input ){
+std::string cond::auth::Cipher::b64encrypt( const std::string& input ){
if( input.empty() ) return "";
unsigned char* out = 0;
size_t outSize = bf_process_alloc( reinterpret_cast(input.c_str()), input.size(), out, false );
@@ -114,7 +114,7 @@ std::string cond::Cipher::b64encrypt( const std::string& input ){
return ret;
}
-std::string cond::Cipher::b64decrypt( const std::string& b64in ){
+std::string cond::auth::Cipher::b64decrypt( const std::string& b64in ){
if( b64in.empty() ) return "";
char* input = 0;
size_t inputSize = 0;
diff --git a/CondCore/CondDB/src/ConnectionPool.cc b/CondCore/CondDB/src/ConnectionPool.cc
index 02400141b9e33..cc97b9a28164c 100644
--- a/CondCore/CondDB/src/ConnectionPool.cc
+++ b/CondCore/CondDB/src/ConnectionPool.cc
@@ -3,8 +3,8 @@
#include "SessionImpl.h"
#include "IOVSchema.h"
//
-#include "CondCore/DBCommon/interface/CoralServiceManager.h"
-#include "CondCore/DBCommon/interface/Auth.h"
+#include "CondCore/CondDB/interface/CoralServiceManager.h"
+#include "CondCore/CondDB/interface/Auth.h"
// CMSSW includes
#include "FWCore/ParameterSet/interface/ParameterSet.h"
// coral includes
@@ -39,83 +39,90 @@ namespace cond {
m_authSys = authSysCode;
}
+ void ConnectionPool::setFrontierSecurity( const std::string& signature ){
+ m_frontierSecurity = signature;
+ }
+
void ConnectionPool::setLogging( bool flag ){
m_loggingEnabled = flag;
}
void ConnectionPool::setParameters( const edm::ParameterSet& connectionPset ){
- setAuthenticationPath( connectionPset.getUntrackedParameter("authenticationPath","") );
- setAuthenticationSystem( connectionPset.getUntrackedParameter("authenticationSystem",0) );
- int messageLevel = connectionPset.getUntrackedParameter("messageLevel",0);
- coral::MsgLevel level = coral::Error;
+ //set the connection parameters from a ParameterSet
+ //if a parameter is not defined, keep the values already set in the data members
+ //(i.e. default if no other setters called, or the ones currently available)
+ setAuthenticationPath( connectionPset.getUntrackedParameter( "authenticationPath", m_authPath ) );
+ setAuthenticationSystem( connectionPset.getUntrackedParameter( "authenticationSystem", m_authSys ) );
+ setFrontierSecurity( connectionPset.getUntrackedParameter( "security", m_frontierSecurity ) );
+ int messageLevel = connectionPset.getUntrackedParameter( "messageLevel", 0 ); //0 corresponds to Error level, current default
+ coral::MsgLevel level = m_messageLevel;
switch (messageLevel) {
- case 0 :
- level = coral::Error;
- break;
+ case 0:
+ level = coral::Error;
+ break;
case 1:
- level = coral::Warning;
- break;
+ level = coral::Warning;
+ break;
case 2:
- level = coral::Info;
- break;
+ level = coral::Info;
+ break;
case 3:
- level = coral::Debug;
- break;
+ level = coral::Debug;
+ break;
default:
- level = coral::Error;
+ level = coral::Error;
}
- setMessageVerbosity(level);
- setLogging( connectionPset.getUntrackedParameter("logging",false) );
+ setMessageVerbosity( level );
+ setLogging( connectionPset.getUntrackedParameter( "logging", m_loggingEnabled ) );
}
bool ConnectionPool::isLoggingEnabled() const {
return m_loggingEnabled;
}
- void ConnectionPool::configure( coral::IConnectionServiceConfiguration& coralConfig){
-
+ void ConnectionPool::configure( coral::IConnectionServiceConfiguration& coralConfig ){
coralConfig.disablePoolAutomaticCleanUp();
coralConfig.disableConnectionSharing();
// message streaming
coral::MessageStream::setMsgVerbosity( m_messageLevel );
- std::string authServiceName("CORAL/Services/EnvironmentAuthenticationService");
+ std::string authServiceName( "CORAL/Services/EnvironmentAuthenticationService" );
std::string authPath = m_authPath;
// authentication
if( authPath.empty() ){
// first try to check the env...
- const char* authEnv = ::getenv( cond::Auth::COND_AUTH_PATH );
+ const char* authEnv = ::getenv( cond::auth::COND_AUTH_PATH );
if(authEnv){
authPath += authEnv;
}
}
int authSys = m_authSys;
// first attempt, look at the env...
- const char* authSysEnv = ::getenv( cond::Auth::COND_AUTH_SYS );
+ const char* authSysEnv = ::getenv( cond::auth::COND_AUTH_SYS );
if( authSysEnv ){
- authSys = ::atoi( authSysEnv );
+ authSys = ::atoi( authSysEnv );
}
if( authSys !=CondDbKey && authSys != CoralXMLFile ){
- // take the default
- authSys = CondDbKey;
+ // take the default
+ authSys = CondDbKey;
}
- std::string servName("");
+ std::string servName( "" );
if( authSys == CondDbKey ){
- if( authPath.empty() ){
- const char* authEnv = ::getenv("HOME");
- if(authEnv){
- authPath += authEnv;
- }
- }
- servName = "COND/Services/RelationalAuthenticationService";
+ if( authPath.empty() ){
+ const char* authEnv = ::getenv( "HOME" );
+ if(authEnv) {
+ authPath += authEnv;
+ }
+ }
+ servName = "COND/Services/RelationalAuthenticationService";
} else if( authSys == CoralXMLFile ){
- if( authPath.empty() ){
- authPath = ".";
- }
- servName = "COND/Services/XMLAuthenticationService";
+ if( authPath.empty() ){
+ authPath = ".";
+ }
+ servName = "COND/Services/XMLAuthenticationService";
}
if( !authPath.empty() ){
authServiceName = servName;
- coral::Context::instance().PropertyManager().property(cond::Auth::COND_AUTH_PATH_PROPERTY)->set(authPath);
+ coral::Context::instance().PropertyManager().property(cond::auth::COND_AUTH_PATH_PROPERTY)->set(authPath);
coral::Context::instance().loadComponent( authServiceName, m_pluginManager );
}
@@ -128,36 +135,27 @@ namespace cond {
}
boost::shared_ptr ConnectionPool::createCoralSession( const std::string& connectionString,
- const std::string& transactionId,
- bool writeCapable ){
+ const std::string& transactionId,
+ bool writeCapable ){
coral::ConnectionService connServ;
- std::pair fullConnectionPars = getConnectionParams( connectionString, transactionId );
+ //all sessions opened with this connection service will share the same frontier security option.
+ std::pair fullConnectionPars = getConnectionParams( connectionString, transactionId, m_frontierSecurity );
if( !fullConnectionPars.second.empty() ) {
- // the new schema...
- connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, TAG::tname, 1 );
- connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, IOV::tname, 1 );
- connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, PAYLOAD::tname, 3 );
+ //all sessions opened with this connection service will share the same TTL settings for TAG, IOV, and PAYLOAD tables.
+ connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, TAG::tname, 1 );
+ connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, IOV::tname, 1 );
+ connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, PAYLOAD::tname, 3 );
}
return boost::shared_ptr( connServ.connect( fullConnectionPars.first,
- writeCapable?Auth::COND_WRITER_ROLE:Auth::COND_READER_ROLE,
- writeCapable?coral::Update:coral::ReadOnly ) );
+ writeCapable ? auth::COND_WRITER_ROLE : auth::COND_READER_ROLE,
+ writeCapable ? coral::Update : coral::ReadOnly ) );
}
Session ConnectionPool::createSession( const std::string& connectionString,
- const std::string& transactionId,
- bool writeCapable ){
- coral::ConnectionService connServ;
- std::pair fullConnectionPars = getConnectionParams( connectionString, transactionId );
- if( !fullConnectionPars.second.empty() ) {
- // the new schema...
- connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, TAG::tname, 1 );
- connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, IOV::tname, 1 );
- connServ.webCacheControl().setTableTimeToLive( fullConnectionPars.second, PAYLOAD::tname, 3 );
- }
-
+ const std::string& transactionId,
+ bool writeCapable ){
boost::shared_ptr coralSession = createCoralSession( connectionString, transactionId, writeCapable );
-
std::shared_ptr impl( new SessionImpl( coralSession, connectionString ) );
return Session( impl );
}
@@ -171,7 +169,7 @@ namespace cond {
}
boost::shared_ptr ConnectionPool::createCoralSession( const std::string& connectionString,
- bool writeCapable ){
+ bool writeCapable ){
return createCoralSession( connectionString, "", writeCapable );
}
diff --git a/CondCore/DBCommon/src/CoralServiceFactory.cc b/CondCore/CondDB/src/CoralServiceFactory.cc
similarity index 88%
rename from CondCore/DBCommon/src/CoralServiceFactory.cc
rename to CondCore/CondDB/src/CoralServiceFactory.cc
index dc094bd08b2c6..804fc79e5bcc5 100644
--- a/CondCore/DBCommon/src/CoralServiceFactory.cc
+++ b/CondCore/CondDB/src/CoralServiceFactory.cc
@@ -1,5 +1,5 @@
-#include "CondCore/DBCommon/interface/CoralServiceFactory.h"
-#include "CondCore/DBCommon/interface/Exception.h"
+#include "CondCore/CondDB/interface/CoralServiceFactory.h"
+#include "CondCore/CondDB/interface/Exception.h"
#include "CoralKernel/Service.h"
EDM_REGISTER_PLUGINFACTORY(cond::CoralServicePluginFactory,"CoralService");
diff --git a/CondCore/DBCommon/src/CoralServiceManager.cc b/CondCore/CondDB/src/CoralServiceManager.cc
similarity index 86%
rename from CondCore/DBCommon/src/CoralServiceManager.cc
rename to CondCore/CondDB/src/CoralServiceManager.cc
index 42260c855503a..c096a47c83fad 100644
--- a/CondCore/DBCommon/src/CoralServiceManager.cc
+++ b/CondCore/CondDB/src/CoralServiceManager.cc
@@ -2,8 +2,8 @@
#include "CoralKernel/ILoadableComponent.h"
#include "FWCore/PluginManager/interface/PluginFactory.h"
#include "FWCore/PluginManager/interface/PluginInfo.h"
-#include "CondCore/DBCommon/interface/CoralServiceManager.h"
-#include "CondCore/DBCommon/interface/CoralServiceFactory.h"
+#include "CondCore/CondDB/interface/CoralServiceManager.h"
+#include "CondCore/CondDB/interface/CoralServiceFactory.h"
coral::ILoadableComponent*
cond::CoralServiceManager::newComponent( const std::string& componentname ){
return cond::CoralServiceFactory::get()->create(componentname);
diff --git a/CondCore/DBCommon/src/CredentialStore.cc b/CondCore/CondDB/src/CredentialStore.cc
similarity index 90%
rename from CondCore/DBCommon/src/CredentialStore.cc
rename to CondCore/CondDB/src/CredentialStore.cc
index dda57e7b932d7..cbc6c27e3b573 100644
--- a/CondCore/DBCommon/src/CredentialStore.cc
+++ b/CondCore/CondDB/src/CredentialStore.cc
@@ -1,12 +1,10 @@
-#include "CondCore/DBCommon/interface/CredentialStore.h"
-#include "CondCore/DBCommon/interface/Cipher.h"
-#include "CondCore/DBCommon/interface/Exception.h"
-#include "CondCore/DBCommon/interface/Auth.h"
-#include "CondCore/ORA/interface/SequenceManager.h"
+#include "CondCore/CondDB/interface/CredentialStore.h"
+#include "CondCore/CondDB/interface/Cipher.h"
+#include "CondCore/CondDB/interface/Exception.h"
+#include "CondCore/CondDB/interface/Auth.h"
//
#include "CoralBase/AttributeList.h"
#include "CoralBase/Attribute.h"
-#include "CoralBase/MessageStream.h"
#include "CoralKernel/Context.h"
#include "CoralCommon/URIParser.h"
#include "RelationalAccess/AuthenticationCredentials.h"
@@ -49,7 +47,7 @@ void coral_bridge::AuthenticationCredentialSet::reset(){
void coral_bridge::AuthenticationCredentialSet::registerItem( const std::string& connectionString,
const std::string& itemName,
const std::string& itemValue ){
- registerItem( connectionString, cond::Auth::COND_DEFAULT_ROLE, itemName, itemValue );
+ registerItem( connectionString, cond::auth::COND_DEFAULT_ROLE, itemName, itemValue );
}
@@ -70,7 +68,7 @@ void
coral_bridge::AuthenticationCredentialSet::registerCredentials( const std::string& connectionString,
const std::string& userName,
const std::string& password ){
- registerCredentials( connectionString, cond::Auth::COND_DEFAULT_ROLE, userName, password );
+ registerCredentials( connectionString, cond::auth::COND_DEFAULT_ROLE, userName, password );
}
void
@@ -100,7 +98,7 @@ void coral_bridge::AuthenticationCredentialSet::import( const AuthenticationCred
const coral::IAuthenticationCredentials*
coral_bridge::AuthenticationCredentialSet::get( const std::string& connectionString ) const
{
- return get( connectionString, cond::Auth::COND_DEFAULT_ROLE );
+ return get( connectionString, cond::auth::COND_DEFAULT_ROLE );
}
const coral::IAuthenticationCredentials*
@@ -120,6 +118,8 @@ const std::map< std::pair, coral::AuthenticationCredent
}
static const std::string SEQUENCE_TABLE_NAME("COND_CREDENTIAL_SEQUENCE");
+static const std::string SEQUENCE_NAME_COL("NAME");
+static const std::string SEQUENCE_VALUE_COL("VALUE");
static const std::string COND_AUTHENTICATION_TABLE("COND_AUTHENTICATION");
static const std::string PRINCIPAL_ID_COL("P_ID");
@@ -353,16 +353,49 @@ void cond::CredentialStore::closeSession( bool commit ){
m_connection.reset();
}
+bool getNextSequenceValue( coral::ISchema& schema, const std::string& sequenceName, int& value ){
+ bool ret = false;
+ std::auto_ptr< coral::IQuery > query( schema.tableHandle( SEQUENCE_TABLE_NAME ).newQuery() );
+ query->limitReturnedRows( 1, 0 );
+ query->addToOutputList( SEQUENCE_VALUE_COL );
+ query->defineOutputType( SEQUENCE_VALUE_COL, coral::AttributeSpecification::typeNameForType() );
+ query->setForUpdate();
+ std::string whereClause( SEQUENCE_NAME_COL + " = :" + SEQUENCE_NAME_COL );
+ coral::AttributeList rowData;
+ rowData.extend( SEQUENCE_NAME_COL );
+ rowData.begin()->data< std::string >() = sequenceName;
+ query->setCondition( whereClause, rowData );
+ coral::ICursor& cursor = query->execute();
+ if ( cursor.next() ) {
+ value = cursor.currentRow().begin()->data()+1;
+ ret = true;
+ } else {
+ return false;
+ }
+ // update...
+ coral::AttributeList updateData;
+ updateData.extend( SEQUENCE_NAME_COL );
+ updateData.extend( SEQUENCE_VALUE_COL );
+ std::string setClause( SEQUENCE_VALUE_COL + " = :" + SEQUENCE_VALUE_COL );
+ std::string whClause( SEQUENCE_NAME_COL + " = :" + SEQUENCE_NAME_COL );
+ coral::AttributeList::iterator iAttribute = updateData.begin();
+ iAttribute->data< std::string >() = sequenceName;
+ ++iAttribute;
+ iAttribute->data< int >() = value;
+ schema.tableHandle( SEQUENCE_TABLE_NAME ).dataEditor().updateRows( setClause,whClause,updateData );
+ return ret;
+}
+
int cond::CredentialStore::addUser( const std::string& principalName, const std::string& authenticationKey, const std::string& principalKey, const std::string& adminKey ){
coral::ISchema& schema = m_session->nominalSchema();
coral::ITableDataEditor& editor0 = schema.tableHandle(COND_AUTHENTICATION_TABLE).dataEditor();
- ora::SequenceManager sequenceMgr( SEQUENCE_TABLE_NAME,schema );
- int principalId = sequenceMgr.getNextId( COND_AUTHENTICATION_TABLE, true );
+ int principalId = -1;
+ if( !getNextSequenceValue( schema, COND_AUTHENTICATION_TABLE, principalId ) ) throwException( "Can't find "+COND_AUTHENTICATION_TABLE+" sequence.","CredentialStore::addUser" );
- Cipher cipher0( authenticationKey );
- Cipher cipher1( adminKey );
+ auth::Cipher cipher0( authenticationKey );
+ auth::Cipher cipher1( adminKey );
coral::AttributeList authData;
editor0.rowBuffer(authData);
@@ -430,7 +463,7 @@ void cond::CredentialStore::startSession( bool readMode ){
throwException( "Invalid credentials provided.(0)",
"CredentialStore::openSession");
}
- Cipher cipher0( m_key.principalKey() );
+ auth::Cipher cipher0( m_key.principalKey() );
std::string verifStr = cipher0.b64decrypt( princData.verifKey );
if( verifStr != principalName ){
throwException( "Invalid credentials provided (1)",
@@ -442,7 +475,7 @@ void cond::CredentialStore::startSession( bool readMode ){
if(!readMode ) {
- Cipher cipher0( m_principalKey );
+ auth::Cipher cipher0( m_principalKey );
std::string adminKey = cipher0.b64decrypt( princData.adminKey );
if( adminKey != m_principalKey ){
// not admin user!
@@ -465,7 +498,7 @@ void cond::CredentialStore::startSession( bool readMode ){
whereData.extend(ROLE_COL);
whereData.extend(SCHEMA_COL);
whereData[ P_ID_COL ].data() = m_principalId;
- whereData[ ROLE_COL ].data() = Auth::COND_ADMIN_ROLE;
+ whereData[ ROLE_COL ].data() = auth::COND_ADMIN_ROLE;
whereData[ SCHEMA_COL ].data() = storeConnectionString;
std::stringstream whereClause;
whereClause << "AUTHO."<< C_ID_COL << " = CREDS."<();
const std::string& encryptedConnectionKey = row[ "CREDS."+CONNECTION_KEY_COL ].data();
std::string connectionKey = cipher0.b64decrypt( encryptedConnectionKey );
- Cipher cipher1( connectionKey );
+ auth::Cipher cipher1( connectionKey );
const std::string& encryptedUserName = row[ "CREDS."+USERNAME_COL ].data();
const std::string& encryptedPassword = row[ "CREDS."+PASSWORD_COL ].data();
const std::string& verificationKey = row[ "CREDS."+VERIFICATION_KEY_COL ].data();
@@ -513,7 +546,7 @@ void cond::CredentialStore::startSession( bool readMode ){
bool cond::CredentialStore::setPermission( int principalId, const std::string& principalKey, const std::string& role, const std::string& connectionString, int connectionId, const std::string& connectionKey ){
coral::ISchema& schema = m_session->nominalSchema();
- Cipher cipher( principalKey );
+ auth::Cipher cipher( principalKey );
std::string encryptedConnectionKey = cipher.b64encrypt( connectionKey );
AuthorizationData authData;
@@ -533,8 +566,8 @@ bool cond::CredentialStore::setPermission( int principalId, const std::string& p
editor.updateRows( setCl,whereCl, updateData );
} else {
- ora::SequenceManager sequenceMgr( SEQUENCE_TABLE_NAME,schema );
- int next = sequenceMgr.getNextId( COND_AUTHORIZATION_TABLE, true );
+ int next = -1;
+ if( !getNextSequenceValue( schema, COND_AUTHORIZATION_TABLE, next ) ) throwException( "Can't find "+COND_AUTHORIZATION_TABLE+" sequence.","CredentialStore::setPermission" );
coral::AttributeList insertData;
insertData.extend( AUTH_ID_COL );
@@ -563,13 +596,13 @@ std::pair cond::CredentialStore::updateConnection( const std::s
bool found = selectConnection( schema, connectionLabel, credsData );
int connId = credsData.id;
- Cipher adminCipher( m_principalKey );
+ auth::Cipher adminCipher( m_principalKey );
std::string connectionKey("");
coral::ITableDataEditor& editor = schema.tableHandle(COND_CREDENTIAL_TABLE).dataEditor();
if( found ){
connectionKey = adminCipher.b64decrypt( credsData.connectionKey );
- Cipher cipher( connectionKey );
+ auth::Cipher cipher( connectionKey );
std::string verificationKey = cipher.b64decrypt( credsData.verificationKey );
if( verificationKey != connectionLabel ){
throwException("Decoding of connection key failed.","CredentialStore::updateConnection");
@@ -595,15 +628,14 @@ std::pair cond::CredentialStore::updateConnection( const std::s
if(!found){
- KeyGenerator gen;
- connectionKey = gen.make( Auth::COND_DB_KEY_SIZE );
- Cipher cipher( connectionKey );
+ auth::KeyGenerator gen;
+ connectionKey = gen.make( auth::COND_DB_KEY_SIZE );
+ auth::Cipher cipher( connectionKey );
std::string encryptedUserName = cipher.b64encrypt( userName );
std::string encryptedPassword = cipher.b64encrypt( password );
std::string encryptedLabel = cipher.b64encrypt( connectionLabel );
- ora::SequenceManager sequenceMgr( SEQUENCE_TABLE_NAME,schema );
- connId = sequenceMgr.getNextId( COND_CREDENTIAL_TABLE, true );
+ if( !getNextSequenceValue( schema, COND_CREDENTIAL_TABLE, connId ) ) throwException( "Can't find "+COND_CREDENTIAL_TABLE+" sequence.","CredentialStore::updateConnection" );
coral::AttributeList insertData;
insertData.extend( CONNECTION_ID_COL );
@@ -635,7 +667,7 @@ std::pair cond::CredentialStore::updateConnection( const std::s
authData.extend( C_ID_COL );
authData[ AUTH_ID_COL ].data() = authId;
authData[ P_ID_COL ].data() = m_principalId;
- authData[ ROLE_COL ].data() = Auth::COND_ADMIN_ROLE;
+ authData[ ROLE_COL ].data() = auth::COND_ADMIN_ROLE;
authData[ SCHEMA_COL ].data() = defaultConnectionString( m_serviceData->connectionString, m_serviceName, userName );
authData[ AUTH_KEY_COL ].data() = adminCipher.b64encrypt( connectionKey ) ;
authData[ C_ID_COL ].data() = connId;
@@ -674,12 +706,12 @@ cond::CredentialStore::setUpForService( const std::string& serviceName,
if(!boost::filesystem::exists(authPath) || !boost::filesystem::is_directory( authPath )){
throwException( "Authentication Path is invalid.","cond::CredentialStore::setUpForService" );
}
- boost::filesystem::path file( DecodingKey::FILE_PATH );
+ boost::filesystem::path file( auth::DecodingKey::FILE_PATH );
fullPath /= file;
- m_key.init( fullPath.string(), Auth::COND_KEY );
+ m_key.init( fullPath.string(), auth::COND_KEY );
- std::map< std::string, ServiceCredentials >::const_iterator iK = m_key.services().find( serviceName );
+ std::map< std::string, auth::ServiceCredentials >::const_iterator iK = m_key.services().find( serviceName );
if( iK == m_key.services().end() ){
std::string msg("");
msg += "Service \""+serviceName+"\" can't be open with the current key.";
@@ -704,6 +736,17 @@ cond::CredentialStore::setUpForConnectionString( const std::string& connectionSt
return setUpForService( serviceName, authPath );
}
+void addSequence( coral::ISchema& schema, const std::string& name ){
+ // Create the entry in the table
+ coral::AttributeList insertData;
+ insertData.extend( SEQUENCE_NAME_COL );
+ insertData.extend(SEQUENCE_VALUE_COL);
+ coral::AttributeList::iterator iAttribute = insertData.begin();
+ iAttribute->data< std::string >() = name;
+ ++iAttribute;
+ iAttribute->data< int >() = -1;
+ schema.tableHandle( SEQUENCE_TABLE_NAME ).dataEditor().insertRow( insertData );
+}
bool
cond::CredentialStore::createSchema( const std::string& connectionString, const std::string& userName, const std::string& password ) {
@@ -714,11 +757,22 @@ cond::CredentialStore::createSchema( const std::string& connectionString, const
if(schema.existsTable(COND_AUTHENTICATION_TABLE)) {
throwException("Credential database, already exists.","CredentialStore::create");
}
- ora::SequenceManager sequenceMgr( SEQUENCE_TABLE_NAME, schema );
+
+ coral::TableDescription dseq;
+ dseq.setName( SEQUENCE_TABLE_NAME );
+
+ dseq.insertColumn( SEQUENCE_NAME_COL, coral::AttributeSpecification::typeNameForType() );
+ dseq.setNotNullConstraint( SEQUENCE_NAME_COL );
+ dseq.insertColumn( SEQUENCE_VALUE_COL,coral::AttributeSpecification::typeNameForType() );
+ dseq.setNotNullConstraint( SEQUENCE_VALUE_COL );
+ dseq.setPrimaryKey( std::vector< std::string >( 1, SEQUENCE_NAME_COL ) );
+ schema.createTable( dseq );
+
int columnSize = 2000;
// authentication table
- sequenceMgr.create( COND_AUTHENTICATION_TABLE );
+
+ addSequence( schema, COND_AUTHENTICATION_TABLE );
coral::TableDescription descr0;
descr0.setName( COND_AUTHENTICATION_TABLE );
descr0.insertColumn( PRINCIPAL_ID_COL, coral::AttributeSpecification::typeNameForType());
@@ -740,7 +794,7 @@ cond::CredentialStore::createSchema( const std::string& connectionString, const
schema.createTable( descr0 );
// authorization table
- sequenceMgr.create( COND_AUTHORIZATION_TABLE );
+ addSequence( schema, COND_AUTHORIZATION_TABLE );
coral::TableDescription descr1;
descr1.setName( COND_AUTHORIZATION_TABLE );
descr1.insertColumn( AUTH_ID_COL, coral::AttributeSpecification::typeNameForType());
@@ -766,7 +820,7 @@ cond::CredentialStore::createSchema( const std::string& connectionString, const
schema.createTable( descr1 );
// credential table
- sequenceMgr.create( COND_CREDENTIAL_TABLE );
+ addSequence( schema, COND_CREDENTIAL_TABLE );
coral::TableDescription descr2;
descr2.setName( COND_CREDENTIAL_TABLE );
descr2.insertColumn( CONNECTION_ID_COL, coral::AttributeSpecification::typeNameForType());
@@ -828,16 +882,16 @@ bool cond::CredentialStore::installAdmin( const std::string& userName, const std
throwException(msg,"CredentialStore::installAdmin");
}
- KeyGenerator gen;
- m_principalKey = gen.make( Auth::COND_DB_KEY_SIZE );
+ auth::KeyGenerator gen;
+ m_principalKey = gen.make( auth::COND_DB_KEY_SIZE );
coral::ITableDataEditor& editor0 = schema.tableHandle(COND_AUTHENTICATION_TABLE).dataEditor();
- ora::SequenceManager sequenceMgr( SEQUENCE_TABLE_NAME,schema );
- int principalId = sequenceMgr.getNextId( COND_AUTHENTICATION_TABLE, true );
+ int principalId = -1;
+ if( !getNextSequenceValue( schema, COND_AUTHENTICATION_TABLE, principalId ) ) throwException( "Can't find "+COND_AUTHENTICATION_TABLE+" sequence.","CredentialStore::installAdmin" );
- Cipher cipher0( m_key.principalKey() );
- Cipher cipher1( m_principalKey );
+ auth::Cipher cipher0( m_key.principalKey() );
+ auth::Cipher cipher1( m_principalKey );
coral::AttributeList authData;
editor0.rowBuffer(authData);
@@ -849,16 +903,17 @@ bool cond::CredentialStore::installAdmin( const std::string& userName, const std
editor0.insertRow( authData );
std::string connLabel = schemaLabelForCredentialStore( connectionString );
- DecodingKey tmpKey;
- std::string connectionKey = gen.make( Auth::COND_DB_KEY_SIZE );
+ auth::DecodingKey tmpKey;
+ std::string connectionKey = gen.make( auth::COND_DB_KEY_SIZE );
std::string encryptedConnectionKey = cipher1.b64encrypt( connectionKey );
- Cipher cipher2( connectionKey );
+ auth::Cipher cipher2( connectionKey );
std::string encryptedUserName = cipher2.b64encrypt( userName );
std::string encryptedPassword = cipher2.b64encrypt( password );
std::string encryptedLabel = cipher2.b64encrypt( connLabel );
- int connId = sequenceMgr.getNextId( COND_CREDENTIAL_TABLE, true );
+ int connId = -1;
+ if( !getNextSequenceValue( schema, COND_CREDENTIAL_TABLE, connId ) ) throwException( "Can't find "+COND_CREDENTIAL_TABLE+" sequence.","CredentialStore::installAdmin" );
coral::ITableDataEditor& editor1 = schema.tableHandle(COND_CREDENTIAL_TABLE).dataEditor();
coral::AttributeList connectionData;
@@ -871,14 +926,15 @@ bool cond::CredentialStore::installAdmin( const std::string& userName, const std
connectionData[ CONNECTION_KEY_COL ].data() = encryptedConnectionKey;
editor1.insertRow( connectionData );
- int authId = sequenceMgr.getNextId( COND_AUTHORIZATION_TABLE, true );
+ int authId = -1;
+ if( !getNextSequenceValue( schema, COND_AUTHORIZATION_TABLE, authId ) ) throwException( "Can't find "+COND_AUTHORIZATION_TABLE+" sequence.","CredentialStore::installAdmin" );
coral::ITableDataEditor& editor2 = schema.tableHandle(COND_AUTHORIZATION_TABLE).dataEditor();
coral::AttributeList permissionData;
editor2.rowBuffer(permissionData);
permissionData[ AUTH_ID_COL ].data() = authId;
permissionData[ P_ID_COL ].data() = principalId;
- permissionData[ ROLE_COL ].data() = Auth::COND_ADMIN_ROLE;
+ permissionData[ ROLE_COL ].data() = auth::COND_ADMIN_ROLE;
permissionData[ SCHEMA_COL ].data() = connectionString;
permissionData[ AUTH_KEY_COL ].data() = encryptedConnectionKey;
permissionData[ C_ID_COL ].data() = connId;
@@ -899,8 +955,8 @@ bool cond::CredentialStore::updatePrincipal( const std::string& principalName,
PrincipalData princData;
bool found = selectPrincipal( schema, principalName, princData );
- Cipher adminCipher( m_principalKey );
- Cipher cipher( authenticationKey );
+ auth::Cipher adminCipher( m_principalKey );
+ auth::Cipher cipher( authenticationKey );
std::string verifStr = cipher.b64encrypt( principalName );
std::string principalKey("");
if( setAdmin ) principalKey = m_principalKey;
@@ -926,14 +982,13 @@ bool cond::CredentialStore::updatePrincipal( const std::string& principalName,
editor.updateRows( setClause.str(),whereClause, updateData );
} else {
if( principalKey.empty() ) {
- KeyGenerator gen;
- principalKey = gen.make( Auth::COND_DB_KEY_SIZE );
+ auth::KeyGenerator gen;
+ principalKey = gen.make( auth::COND_DB_KEY_SIZE );
}
coral::ITableDataEditor& editor0 = schema.tableHandle(COND_AUTHENTICATION_TABLE).dataEditor();
- ora::SequenceManager sequenceMgr( SEQUENCE_TABLE_NAME,schema );
- principalId = sequenceMgr.getNextId( COND_AUTHENTICATION_TABLE, true );
+ if( !getNextSequenceValue( schema, COND_AUTHENTICATION_TABLE, principalId ) ) throwException( "Can't find "+COND_AUTHENTICATION_TABLE+" sequence.","CredentialStore::updatePrincipal" );
coral::AttributeList authData;
editor0.rowBuffer(authData);
@@ -953,7 +1008,7 @@ bool cond::CredentialStore::updatePrincipal( const std::string& principalName,
if(!found){
throwException("Credential Store connection has not been defined.","CredentialStore::updatePrincipal");
}
- setPermission( principalId, principalKey, Auth::COND_ADMIN_ROLE, connString, credsData.id, adminCipher.b64decrypt( credsData.connectionKey ) );
+ setPermission( principalId, principalKey, auth::COND_ADMIN_ROLE, connString, credsData.id, adminCipher.b64decrypt( credsData.connectionKey ) );
}
session.close();
@@ -986,7 +1041,7 @@ bool cond::CredentialStore::setPermission( const std::string& principal,
throwException( msg, "CredentialStore::setPermission");
}
- Cipher cipher( m_principalKey );
+ auth::Cipher cipher( m_principalKey );
bool ret = setPermission( princData.id, cipher.b64decrypt( princData.adminKey), role, connectionString, credsData.id, cipher.b64decrypt( credsData.connectionKey ) );
session.close();
return ret;
@@ -1111,7 +1166,7 @@ bool cond::CredentialStore::selectForUser( coral_bridge::AuthenticationCredentia
session.start( true );
coral::ISchema& schema = m_session->nominalSchema();
- Cipher cipher( m_principalKey );
+ auth::Cipher cipher( m_principalKey );
std::auto_ptr query(schema.newQuery());
query->addToTableList(COND_AUTHORIZATION_TABLE, "AUTHO");
@@ -1150,7 +1205,7 @@ bool cond::CredentialStore::selectForUser( coral_bridge::AuthenticationCredentia
const std::string& encryptedPassword = row[ "CREDS."+PASSWORD_COL ].data();
const std::string& encryptedLabel = row[ "CREDS."+VERIFICATION_KEY_COL ].data();
std::string authKey = cipher.b64decrypt( encryptedAuthKey );
- Cipher connCipher( authKey );
+ auth::Cipher connCipher( authKey );
if( connCipher.b64decrypt( encryptedLabel ) == connectionLabel ){
destinationData.registerCredentials( connectionString, role, connCipher.b64decrypt( encryptedUserName ), connCipher.b64decrypt( encryptedPassword ) );
}
@@ -1175,7 +1230,7 @@ bool cond::CredentialStore::importForPrincipal( const std::string& principal,
}
bool imported = false;
- Cipher cipher( m_principalKey );
+ auth::Cipher cipher( m_principalKey );
std::string princKey = cipher.b64decrypt( princData.adminKey);
const std::map< std::pair, coral::AuthenticationCredentials* >& creds = dataSource.data();
@@ -1189,7 +1244,7 @@ bool cond::CredentialStore::importForPrincipal( const std::string& principal,
std::string password = iConn->second->valueForItem( coral::IAuthenticationCredentials::passwordItem());
// first import the connections
std::pair conn = updateConnection( schemaLabel( serviceName, userName ), userName, password, forceUpdateConnection );
- Cipher cipher( m_principalKey );
+ auth::Cipher cipher( m_principalKey );
// than set the permission for the specific role
setPermission( princData.id, princKey, role, connectionString, conn.first, conn.second );
imported = true;
@@ -1241,7 +1296,7 @@ bool cond::CredentialStore::listConnections( std::mapaddToOutputList( CONNECTION_KEY_COL );
coral::ICursor& cursor = query->execute();
bool found = false;
- Cipher cipher0(m_principalKey );
+ auth::Cipher cipher0(m_principalKey );
while ( cursor.next() ) {
std::string userName("");
std::string password("");
@@ -1250,7 +1305,7 @@ bool cond::CredentialStore::listConnections( std::map();
const std::string& encryptedVerif = row[ VERIFICATION_KEY_COL].data();
std::string connKey = cipher0.b64decrypt( encryptedKey );
- Cipher cipher1( connKey );
+ auth::Cipher cipher1( connKey );
std::string verif = cipher1.b64decrypt( encryptedVerif );
if( verif == connLabel ){
const std::string& encryptedUserName = row[ USERNAME_COL].data();
@@ -1356,7 +1411,7 @@ bool cond::CredentialStore::exportAll( coral_bridge::AuthenticationCredentialSet
query->setCondition( whereClause.str(), whereData );
coral::ICursor& cursor = query->execute();
bool found = false;
- Cipher cipher0( m_principalKey );
+ auth::Cipher cipher0( m_principalKey );
while ( cursor.next() ) {
const coral::AttributeList& row = cursor.currentRow();
const std::string& role = row[ "AUTHO."+ROLE_COL ].data();
@@ -1367,7 +1422,7 @@ bool cond::CredentialStore::exportAll( coral_bridge::AuthenticationCredentialSet
std::string userName("");
std::string password("");
std::string connectionKey = cipher0.b64decrypt( encryptedConnection );
- Cipher cipher1( connectionKey );
+ auth::Cipher cipher1( connectionKey );
std::string verifKey = cipher1.b64decrypt( encryptedVerifKey );
if( verifKey == connectionLabel ){
const std::string& encryptedUserName = row[ "CREDS."+USERNAME_COL].data();
diff --git a/CondCore/CondDB/src/DbConnectionString.cc b/CondCore/CondDB/src/DbConnectionString.cc
index b99c8608b2a2a..14ac4f4751e00 100644
--- a/CondCore/CondDB/src/DbConnectionString.cc
+++ b/CondCore/CondDB/src/DbConnectionString.cc
@@ -2,7 +2,7 @@
#include "CondCore/CondDB/interface/Utils.h"
#include "DbConnectionString.h"
//
-#include "CondCore/DBCommon/interface/FipProtocolParser.h"
+#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Catalog/interface/SiteLocalConfig.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
@@ -10,62 +10,84 @@ namespace cond {
namespace persistency {
-
- unsigned int
- countslash(const std::string& input) {
- unsigned int count=0;
+ unsigned int countslash( const std::string& input ) {
+ unsigned int count = 0;
std::string::size_type slashpos( 0 );
- while( slashpos!=std::string::npos){
- slashpos = input.find('/', slashpos );
- if ( slashpos != std::string::npos ){
- ++count;
- // start next search after this word
- slashpos += 1;
- }
+ while( slashpos != std::string::npos ) {
+ slashpos = input.find('/', slashpos );
+ if( slashpos != std::string::npos ) {
+ ++count;
+ // start next search after this word
+ slashpos += 1;
+ }
}
return count;
}
+ std::string parseFipConnectionString( const std::string& fipConnect ){
+ std::string connect( "sqlite_file:" );
+ std::string::size_type pos = fipConnect.find( ':' );
+ std::string fipLocation = fipConnect.substr( pos+1 );
+ edm::FileInPath fip( fipLocation );
+ connect.append( fip.fullPath() );
+ return connect;
+ }
+
+ //FIXME: sdg this function does not support frontier connections strings like
+ //frontier://cmsfrontier.cern.ch:8000/FrontierPrep/CMS_CONDITIONS
+ //as http://cmsfrontier.cern.ch:8000/FrontierPrep(freshkey=foo) is an invalid URI.
std::pair getConnectionParams( const std::string& connectionString,
- const std::string& transactionId ){
- if( connectionString.empty() ) throwException( "The connection string is empty.","getConnectionParams");
+ const std::string& transactionId,
+ const std::string& signature ) {
+ if( connectionString.empty() ) cond::throwException( "The connection string is empty.", "getConnectionParams" );
std::string protocol = getConnectionProtocol( connectionString );
std::string finalConn = connectionString;
- std::string refreshConn("");
- if( protocol == "frontier" ){
- std::string protocol("frontier://");
- std::string::size_type fpos=connectionString.find(protocol);
- unsigned int nslash=countslash(connectionString.substr(protocol.size(),connectionString.size()-fpos));
- if(nslash==1){
- edm::Service localconfservice;
- if( !localconfservice.isAvailable() ){
- throwException("edm::SiteLocalConfigService is not available","getConnectionParams");
- }
- finalConn=localconfservice->lookupCalibConnect(connectionString);
- }
- if (!transactionId.empty()) {
- size_t l = finalConn.rfind('/');
- finalConn.insert(l,"(freshkey="+transactionId+')');
- }
+ std::string refreshConn( "" );
+ if( protocol == "frontier" ) {
+ std::string protocol( "frontier://" );
+ std::string::size_type fpos = connectionString.find( protocol );
+ unsigned int nslash = countslash( connectionString.substr( protocol.size(), connectionString.size() - fpos ) );
+ if( nslash==1 ) {
+ edm::Service localconfservice;
+ if( !localconfservice.isAvailable() ) {
+ cond::throwException( "edm::SiteLocalConfigService is not available", "getConnectionParams" );
+ }
+ finalConn = localconfservice->lookupCalibConnect( connectionString );
+ }
+ if( !transactionId.empty() ) {
+ size_t l = finalConn.rfind('/');
+ finalConn.insert( l, "(freshkey="+transactionId+')' );
+ }
+
+ //When the signature parameter is set to sig, FroNTier requests that the server sends digital signatures on every response.
+ //We test here that the signature string, if defined, is actually set to sig, otherwise we throw an exception
+ std::string signatureParameter( "sig" );
+ if( !signature.empty() ) {
+ if( signature.compare( signatureParameter ) == 0 ) {
+ std::string::size_type s = finalConn.rfind('/');
+ finalConn.insert( s, "(security="+signature+')' );
+ } else {
+ cond::throwException( "The FroNTier security option is invalid.", "getConnectionParams" );
+ }
+ }
- std::string::size_type startRefresh = finalConn.find("://");
- if (startRefresh != std::string::npos){
- startRefresh += 3;
- }
- std::string::size_type endRefresh=finalConn.rfind("/", std::string::npos);
- if (endRefresh == std::string::npos){
- refreshConn = finalConn;
- } else{
- refreshConn = finalConn.substr(startRefresh, endRefresh-startRefresh);
- if(refreshConn.substr(0,1) != "("){
- //if the connect string is not a complicated parenthesized string,
- // an http:// needs to be at the beginning of it
- refreshConn.insert(0, "http://");
- }
- }
- } else if ( protocol == "sqlite_fip" ){
- cond::FipProtocolParser parser;
- finalConn = parser.getRealConnect( connectionString );
+ std::string::size_type startRefresh = finalConn.find( "://" );
+ if( startRefresh != std::string::npos ) {
+ startRefresh += 3;
+ }
+ std::string::size_type endRefresh=finalConn.rfind( "/", std::string::npos );
+ if( endRefresh == std::string::npos ) {
+ refreshConn = finalConn;
+ } else {
+ refreshConn = finalConn.substr( startRefresh, endRefresh - startRefresh );
+ if( refreshConn.substr( 0, 1 ) != "(" ) {
+ //if the connect string is not a complicated parenthesized string,
+ // an http:// needs to be at the beginning of it
+ refreshConn.insert( 0, "http://" );
+ }
+ }
+ } else if( protocol == "sqlite_fip" ) {
+ finalConn = parseFipConnectionString( connectionString );
}
return std::make_pair( finalConn, refreshConn );
}
diff --git a/CondCore/CondDB/src/DbConnectionString.h b/CondCore/CondDB/src/DbConnectionString.h
index 6c28219286c75..cbdbbb0a4b474 100644
--- a/CondCore/CondDB/src/DbConnectionString.h
+++ b/CondCore/CondDB/src/DbConnectionString.h
@@ -9,7 +9,7 @@ namespace cond {
namespace persistency {
- std::pair getConnectionParams( const std::string& initialConnection, const std::string& transId );
+ std::pair getConnectionParams( const std::string& initialConnection, const std::string& transId, const std::string& signature );
}
diff --git a/CondCore/CondDB/src/DbCore.h b/CondCore/CondDB/src/DbCore.h
index 74a74d0414200..994e4dd206a9c 100644
--- a/CondCore/CondDB/src/DbCore.h
+++ b/CondCore/CondDB/src/DbCore.h
@@ -46,7 +46,7 @@
// macros for the schema definition
// table definition
-#define table( NAME ) namespace NAME {\
+#define conddb_table( NAME ) namespace NAME {\
static constexpr char const* tname = #NAME ;\
}\
namespace NAME
@@ -71,7 +71,7 @@
#define SELECT_COLUMN_MACRO(...) GET_4TH_ARG(__VA_ARGS__, FIXSIZE_COLUMN, VARSIZE_COLUMN, WRONG_PAR_NUMBER_ERROR )
// the final column definition macro
-#define column( ... ) SELECT_COLUMN_MACRO(__VA_ARGS__)(__VA_ARGS__)
+#define conddb_column( ... ) SELECT_COLUMN_MACRO(__VA_ARGS__)(__VA_ARGS__)
namespace cond {
diff --git a/CondCore/DBCommon/src/DecodingKey.cc b/CondCore/CondDB/src/DecodingKey.cc
similarity index 90%
rename from CondCore/DBCommon/src/DecodingKey.cc
rename to CondCore/CondDB/src/DecodingKey.cc
index e5a0079f0c628..b72c829a19546 100644
--- a/CondCore/DBCommon/src/DecodingKey.cc
+++ b/CondCore/CondDB/src/DecodingKey.cc
@@ -1,7 +1,7 @@
-#include "CondCore/DBCommon/interface/DecodingKey.h"
-#include "CondCore/DBCommon/interface/FileUtils.h"
-#include "CondCore/DBCommon/interface/Exception.h"
-#include "CondCore/DBCommon/interface/Cipher.h"
+#include "CondCore/CondDB/interface/DecodingKey.h"
+#include "CondCore/CondDB/interface/FileUtils.h"
+#include "CondCore/CondDB/interface/Exception.h"
+#include "CondCore/CondDB/interface/Cipher.h"
//
#include
#include
@@ -71,7 +71,7 @@ namespace cond {
}
-std::string cond::KeyGenerator::make( size_t keySize ){
+std::string cond::auth::KeyGenerator::make( size_t keySize ){
::srand( m_iteration+2 );
int rseed = ::rand();
int seed = ::time( NULL)%10 + rseed;
@@ -84,7 +84,7 @@ std::string cond::KeyGenerator::make( size_t keySize ){
return ret;
}
-std::string cond::KeyGenerator::makeWithRandomSize( size_t maxSize ){
+std::string cond::auth::KeyGenerator::makeWithRandomSize( size_t maxSize ){
::srand( m_iteration+2 );
int rseed = ::rand();
int seed = ::time( NULL)%10 + rseed;
@@ -93,10 +93,7 @@ std::string cond::KeyGenerator::makeWithRandomSize( size_t maxSize ){
return make( sz );
}
-const std::string cond::DecodingKey::FILE_NAME("db.key");
-const std::string cond::DecodingKey::FILE_PATH(".cms_cond/"+FILE_NAME);
-
-std::string cond::DecodingKey::templateFile(){
+std::string cond::auth::DecodingKey::templateFile(){
std::stringstream s;
s<"<"<
+#include
+
+bool cond::FileReader::read(const std::string& fileName){
+ std::ifstream inputFile;
+ inputFile.open (fileName.c_str());
+ if(!inputFile.good()){
+ std::stringstream msg;
+ msg << "File \"" << fileName << "\" cannot be open.";
+ inputFile.close();
+ throw cond::Exception(msg.str());
+ }
+ // get pointer to associated buffer object
+ std::filebuf* pbuf=inputFile.rdbuf();
+ // get file size using buffer's members
+ long size=pbuf->pubseekoff (0,std::ios::end,std::ios::in);
+ pbuf->pubseekpos (0,std::ios::in);
+ // allocate memory to contain file data
+ char* buffer=new char[size+1];
+ // get file data
+ pbuf->sgetn (buffer,size);
+ inputFile.close();
+ buffer[size]=0;
+ m_content += buffer;
+ delete [] buffer;
+ return true;
+}
diff --git a/CondCore/CondDB/src/GTSchema.h b/CondCore/CondDB/src/GTSchema.h
index 72056883192f6..56be5b5ec6038 100644
--- a/CondCore/CondDB/src/GTSchema.h
+++ b/CondCore/CondDB/src/GTSchema.h
@@ -10,14 +10,14 @@ namespace cond {
namespace persistency {
- table( GLOBAL_TAG ) {
+ conddb_table( GLOBAL_TAG ) {
- column( NAME, std::string );
- column( VALIDITY, cond::Time_t );
- column( DESCRIPTION, std::string );
- column( RELEASE, std::string );
- column( SNAPSHOT_TIME, boost::posix_time::ptime );
- column( INSERTION_TIME, boost::posix_time::ptime );
+ conddb_column( NAME, std::string );
+ conddb_column( VALIDITY, cond::Time_t );
+ conddb_column( DESCRIPTION, std::string );
+ conddb_column( RELEASE, std::string );
+ conddb_column( SNAPSHOT_TIME, boost::posix_time::ptime );
+ conddb_column( INSERTION_TIME, boost::posix_time::ptime );
class Table : public IGTTable {
public:
@@ -38,16 +38,16 @@ namespace cond {
};
}
- table ( GLOBAL_TAG_MAP ) {
+ conddb_table ( GLOBAL_TAG_MAP ) {
static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
- column( GLOBAL_TAG_NAME, std::string );
+ conddb_column( GLOBAL_TAG_NAME, std::string );
// to be changed to RECORD_NAME!
- column( RECORD, std::string );
+ conddb_column( RECORD, std::string );
// to be changed to RECORD_LABEL!
- column( LABEL, std::string );
- column( TAG_NAME, std::string );
+ conddb_column( LABEL, std::string );
+ conddb_column( TAG_NAME, std::string );
class Table : public IGTMapTable {
public:
diff --git a/CondCore/CondDB/src/IDbSchema.h b/CondCore/CondDB/src/IDbSchema.h
index 92f64379bb445..500d5c9020f7c 100644
--- a/CondCore/CondDB/src/IDbSchema.h
+++ b/CondCore/CondDB/src/IDbSchema.h
@@ -90,6 +90,15 @@ namespace cond {
const boost::posix_time::ptime& insertionTime ) = 0;
};
+ class ITagLogTable {
+ public:
+ virtual ~ITagLogTable(){}
+ virtual bool exists() = 0;
+ virtual void create() = 0;
+ virtual void insert( const std::string& tag, const boost::posix_time::ptime& eventTime, const std::string& userName, const std::string& hostName,
+ const std::string& command, const std::string& action, const std::string& userText ) = 0;
+ };
+
class IIOVSchema {
public:
virtual ~IIOVSchema(){}
@@ -98,9 +107,7 @@ namespace cond {
virtual ITagTable& tagTable() = 0;
virtual IIOVTable& iovTable() = 0;
virtual IPayloadTable& payloadTable() = 0;
- virtual ITagMigrationTable& tagMigrationTable() = 0;
- virtual IPayloadMigrationTable& payloadMigrationTable() = 0;
- virtual std::string parsePoolToken( const std::string& poolToken ) = 0;
+ virtual ITagLogTable& tagLogTable() = 0;
};
class IGTTable {
diff --git a/CondCore/CondDB/src/IOVEditor.cc b/CondCore/CondDB/src/IOVEditor.cc
index 8ffcca7274dc1..61f8247e8ea82 100644
--- a/CondCore/CondDB/src/IOVEditor.cc
+++ b/CondCore/CondDB/src/IOVEditor.cc
@@ -1,4 +1,5 @@
#include "CondCore/CondDB/interface/IOVEditor.h"
+#include "CondCore/CondDB/interface/Utils.h"
#include "SessionImpl.h"
//
@@ -150,56 +151,80 @@ namespace cond {
bool iovSorter( const std::tuple& f, const std::tuple& s ){
return std::get<0>(f) < std::get<0>(s);
}
-
- bool IOVEditor::flush( const boost::posix_time::ptime& operationTime ){
+
+ bool IOVEditor::flush( const std::string& logText, const boost::posix_time::ptime& operationTime ){
bool ret = false;
checkTransaction( "IOVEditor::flush" );
if( m_data->change ){
if( m_data->description.empty() ) throwException( "A non-empty description string is mandatory.","IOVEditor::flush" );
if( m_data->validationMode ) m_session->iovSchema().tagTable().setValidationMode();
if( !m_data->exists ){
+ // set the creation time ( only available in the migration from v1...)
+ if( m_data->creationTime.is_not_a_date_time() ) m_data->creationTime = operationTime;
m_session->iovSchema().tagTable().insert( m_data->tag, m_data->timeType, m_data->payloadType,
m_data->synchronizationType, m_data->endOfValidity,
m_data->description, m_data->lastValidatedTime, m_data->creationTime );
+ if( m_session->iovSchema().tagLogTable().exists() )
+ m_session->iovSchema().tagLogTable().insert( m_data->tag, m_data->creationTime, cond::getUserName(),cond::getHostName(), cond::getCommand(),
+ std::string("New tag created."),std::string("-") );
m_data->exists = true;
ret = true;
} else {
m_session->iovSchema().tagTable().update( m_data->tag, m_data->endOfValidity, m_data->description,
m_data->lastValidatedTime, operationTime );
+ if( m_session->iovSchema().tagLogTable().exists() )
+ m_session->iovSchema().tagLogTable().insert( m_data->tag, operationTime, cond::getUserName(),cond::getHostName(), cond::getCommand(),
+ std::string("Tag header updated."),std::string("-") );
ret = true;
}
m_data->change = false;
}
if( m_data->iovBuffer.size() ) {
-
std::sort(m_data->iovBuffer.begin(),m_data->iovBuffer.end(),iovSorter);
- cond::Time_t l = std::get<0>(m_data->iovBuffer.front());
- if( m_data->synchronizationType != cond::SYNCH_ANY && m_data->synchronizationType != cond::SYNCH_VALIDATION ){
- // retrieve the last since
- cond::Time_t last = 0;
- cond::Hash h;
- m_session->iovSchema().iovTable().getLastIov( m_data->tag, last, h );
- // check if the min iov is greater then the last since
- if( l <= last ){
- std::stringstream msg;
- msg << "Can't insert iov since "<tag<<": last since is "<synchronizationType )<<"\"";
- throwException( msg.str(),"IOVEditor::flush");
- }
- }
-
+ cond::Time_t l = std::get<0>(m_data->iovBuffer.front());
+ if( m_data->synchronizationType != cond::SYNCH_ANY && m_data->synchronizationType != cond::SYNCH_VALIDATION ){
+ // retrieve the last since
+ cond::Time_t last = 0;
+ cond::Hash h;
+ m_session->iovSchema().iovTable().getLastIov( m_data->tag, last, h );
+ // check if the min iov is greater then the last since
+ if( l <= last ){
+ std::stringstream msg;
+ msg << "Can't insert iov since "<tag<<": last since is "<synchronizationType )<<"\"";
+ throwException( msg.str(),"IOVEditor::flush");
+ }
+ }
+ // set the insertion time ( only for the migration from v1 will be available... )
+ for( auto& iov : m_data->iovBuffer ){
+ boost::posix_time::ptime& insertionTime = std::get<2>(iov);
+ if( insertionTime.is_not_a_date_time() ) insertionTime = operationTime;
+ }
// insert the new iovs
m_session->iovSchema().iovTable().insertMany( m_data->tag, m_data->iovBuffer );
+ std::stringstream msg;
+ msg << m_data->iovBuffer.size() << " iov(s) inserted.";
+ if( m_session->iovSchema().tagLogTable().exists() )
+ m_session->iovSchema().tagLogTable().insert( m_data->tag, operationTime, cond::getUserName(), cond::getHostName(), cond::getCommand(),
+ msg.str(),logText );
m_data->iovBuffer.clear();
ret = true;
}
return ret;
}
+ bool IOVEditor::flush( const std::string& logText ){
+ return flush( logText, boost::posix_time::microsec_clock::universal_time() );
+ }
+
+ bool IOVEditor::flush( const boost::posix_time::ptime& operationTime ){
+ return flush( std::string("-"), operationTime );
+ }
+
bool IOVEditor::flush(){
- return flush( boost::posix_time::microsec_clock::universal_time() );
+ return flush( std::string("-"), boost::posix_time::microsec_clock::universal_time() );
}
-
+
void IOVEditor::checkTransaction( const std::string& ctx ){
if( !m_session.get() ) throwException("The session is not active.",ctx );
if( !m_session->isTransactionActive( false ) ) throwException("The transaction is not active.",ctx );
diff --git a/CondCore/CondDB/src/IOVSchema.cc b/CondCore/CondDB/src/IOVSchema.cc
index 427679ada9efa..1688ff4a3efe3 100644
--- a/CondCore/CondDB/src/IOVSchema.cc
+++ b/CondCore/CondDB/src/IOVSchema.cc
@@ -297,6 +297,37 @@ namespace cond {
deleteFromTable( m_schema, tname, buffer );
}
+ TAG_LOG::Table::Table( coral::ISchema& schema ):
+ m_schema( schema ){
+ }
+
+ bool TAG_LOG::Table::exists(){
+ return existsTable( m_schema, tname );
+ }
+
+ void TAG_LOG::Table::create(){
+ if( exists() ){
+ throwException( "TAG_LOG table already exists in this schema.",
+ "TAG_LOG::create");
+ }
+ TableDescription< TAG_NAME, EVENT_TIME, USER_NAME, HOST_NAME, COMMAND, ACTION, USER_TEXT > descr( tname );
+ descr.setPrimaryKey();
+ descr.setForeignKey< TAG_NAME, TAG::NAME >( "TAG_NAME_FK" );
+ createTable( m_schema, descr.get() );
+ }
+
+ void TAG_LOG::Table::insert( const std::string& tag,
+ const boost::posix_time::ptime& eventTime,
+ const std::string& userName,
+ const std::string& hostName,
+ const std::string& command,
+ const std::string& action,
+ const std::string& userText){
+ RowBuffer< TAG_NAME, EVENT_TIME, USER_NAME, HOST_NAME, COMMAND, ACTION, USER_TEXT >
+ dataToInsert( std::tie( tag, eventTime, userName, hostName, command, action, userText ) );
+ insertInTable( m_schema, tname, dataToInsert.get() );
+ }
+
PAYLOAD::Table::Table( coral::ISchema& schema ):
m_schema( schema ){
}
@@ -371,104 +402,11 @@ namespace cond {
return payloadHash;
}
- TAG_MIGRATION::Table::Table( coral::ISchema& schema ):
- m_schema( schema ){
- }
-
- bool TAG_MIGRATION::Table::exists(){
- return existsTable( m_schema, tname );
- }
-
- void TAG_MIGRATION::Table::create(){
- if( exists() ){
- throwException( "TAG_MIGRATION table already exists in this schema.",
- "TAG_MIGRATION::create");
- }
- TableDescription< SOURCE_ACCOUNT, SOURCE_TAG, TAG_NAME, STATUS_CODE, INSERTION_TIME > descr( tname );
- descr.setPrimaryKey();
- descr.setForeignKey< TAG_NAME, TAG::NAME >( "TAG_NAME_FK" );
- createTable( m_schema, descr.get() );
- }
-
- bool TAG_MIGRATION::Table::select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName, int& statusCode ){
- Query< TAG_NAME, STATUS_CODE > q( m_schema );
- q.addCondition( sourceAccount );
- q.addCondition( sourceTag );
- for ( auto row : q ) {
- std::tie( tagName, statusCode ) = row;
- }
-
- return q.retrievedRows();
-
- }
-
- void TAG_MIGRATION::Table::insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
- int statusCode, const boost::posix_time::ptime& insertionTime ){
- RowBuffer< SOURCE_ACCOUNT, SOURCE_TAG, TAG_NAME, STATUS_CODE, INSERTION_TIME >
- dataToInsert( std::tie( sourceAccount, sourceTag, tagName, statusCode, insertionTime ) );
- insertInTable( m_schema, tname, dataToInsert.get() );
- }
-
- void TAG_MIGRATION::Table::updateValidationCode( const std::string& sourceAccount, const std::string& sourceTag, int statusCode ){
- UpdateBuffer buffer;
- buffer.setColumnData< STATUS_CODE >( std::tie( statusCode ) );
- buffer.addWhereCondition( sourceAccount );
- buffer.addWhereCondition( sourceTag );
- updateTable( m_schema, tname, buffer );
- }
-
- PAYLOAD_MIGRATION::Table::Table( coral::ISchema& schema ):
- m_schema( schema ){
- }
-
- bool PAYLOAD_MIGRATION::Table::exists(){
- return existsTable( m_schema, tname );
- }
-
- void PAYLOAD_MIGRATION::Table::create(){
- if( exists() ){
- throwException( "PAYLOAD_MIGRATION table already exists in this schema.",
- "PAYLOAD_MIGRATION::create");
- }
- TableDescription< SOURCE_ACCOUNT, SOURCE_TOKEN, PAYLOAD_HASH, INSERTION_TIME > descr( tname );
- descr.setPrimaryKey();
- descr.setForeignKey< PAYLOAD_HASH, PAYLOAD::HASH >( "PAYLOAD_HASH_FK" );
- createTable( m_schema, descr.get() );
- }
-
- bool PAYLOAD_MIGRATION::Table::select( const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId ){
- Query< PAYLOAD_HASH > q( m_schema );
- q.addCondition( sourceAccount );
- q.addCondition( sourceToken );
- for ( auto row : q ) {
- std::tie( payloadId ) = row;
- }
-
- return q.retrievedRows();
- }
-
- void PAYLOAD_MIGRATION::Table::insert( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
- const boost::posix_time::ptime& insertionTime ){
- RowBuffer< SOURCE_ACCOUNT, SOURCE_TOKEN, PAYLOAD_HASH, INSERTION_TIME >
- dataToInsert( std::tie( sourceAccount, sourceToken, payloadId, insertionTime ) );
- insertInTable( m_schema, tname, dataToInsert.get() );
- }
-
- void PAYLOAD_MIGRATION::Table::update( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
- const boost::posix_time::ptime& insertionTime ){
- UpdateBuffer buffer;
- buffer.setColumnData< PAYLOAD_HASH, INSERTION_TIME >( std::tie( payloadId, insertionTime ) );
- buffer.addWhereCondition( sourceAccount );
- buffer.addWhereCondition( sourceToken );
- updateTable( m_schema, tname, buffer );
- }
-
IOVSchema::IOVSchema( coral::ISchema& schema ):
m_tagTable( schema ),
m_iovTable( schema ),
- m_payloadTable( schema ),
- m_tagMigrationTable( schema ),
- m_payloadMigrationTable( schema ){
+ m_tagLogTable( schema ),
+ m_payloadTable( schema ){
}
bool IOVSchema::exists(){
@@ -484,6 +422,7 @@ namespace cond {
m_tagTable.create();
m_payloadTable.create();
m_iovTable.create();
+ m_tagLogTable.create();
created = true;
}
return created;
@@ -497,21 +436,14 @@ namespace cond {
return m_iovTable;
}
+ ITagLogTable& IOVSchema::tagLogTable(){
+ return m_tagLogTable;
+ }
+
IPayloadTable& IOVSchema::payloadTable(){
return m_payloadTable;
}
- ITagMigrationTable& IOVSchema::tagMigrationTable(){
- return m_tagMigrationTable;
- }
-
- IPayloadMigrationTable& IOVSchema::payloadMigrationTable(){
- return m_payloadMigrationTable;
- }
-
- std::string IOVSchema::parsePoolToken( const std::string& ){
- throwException("CondDB V2 can't parse a pool token.","IOVSchema::parsePoolToken");
- }
}
}
diff --git a/CondCore/CondDB/src/IOVSchema.h b/CondCore/CondDB/src/IOVSchema.h
index 6a450e83e2f78..7bc435726a46d 100644
--- a/CondCore/CondDB/src/IOVSchema.h
+++ b/CondCore/CondDB/src/IOVSchema.h
@@ -10,17 +10,17 @@ namespace cond {
namespace persistency {
- table( TAG ) {
+ conddb_table( TAG ) {
- column( NAME, std::string );
- column( TIME_TYPE, cond::TimeType );
- column( OBJECT_TYPE, std::string );
- column( SYNCHRONIZATION, cond::SynchronizationType );
- column( END_OF_VALIDITY, cond::Time_t );
- column( DESCRIPTION, std::string );
- column( LAST_VALIDATED_TIME, cond::Time_t );
- column( INSERTION_TIME, boost::posix_time::ptime );
- column( MODIFICATION_TIME, boost::posix_time::ptime );
+ conddb_column( NAME, std::string );
+ conddb_column( TIME_TYPE, cond::TimeType );
+ conddb_column( OBJECT_TYPE, std::string );
+ conddb_column( SYNCHRONIZATION, cond::SynchronizationType );
+ conddb_column( END_OF_VALIDITY, cond::Time_t );
+ conddb_column( DESCRIPTION, std::string );
+ conddb_column( LAST_VALIDATED_TIME, cond::Time_t );
+ conddb_column( INSERTION_TIME, boost::posix_time::ptime );
+ conddb_column( MODIFICATION_TIME, boost::posix_time::ptime );
class Table : public ITagTable {
public:
@@ -45,16 +45,16 @@ namespace cond {
};
}
- table ( PAYLOAD ) {
+ conddb_table ( PAYLOAD ) {
static constexpr unsigned int PAYLOAD_HASH_SIZE = 40;
- column( HASH, std::string, PAYLOAD_HASH_SIZE );
- column( OBJECT_TYPE, std::string );
- column( DATA, cond::Binary );
- column( STREAMER_INFO, cond::Binary );
- column( VERSION, std::string );
- column( INSERTION_TIME, boost::posix_time::ptime );
+ conddb_column( HASH, std::string, PAYLOAD_HASH_SIZE );
+ conddb_column( OBJECT_TYPE, std::string );
+ conddb_column( DATA, cond::Binary );
+ conddb_column( STREAMER_INFO, cond::Binary );
+ conddb_column( VERSION, std::string );
+ conddb_column( INSERTION_TIME, boost::posix_time::ptime );
class Table : public IPayloadTable {
public:
@@ -76,12 +76,12 @@ namespace cond {
};
}
- table( IOV ) {
+ conddb_table( IOV ) {
- column( TAG_NAME, std::string );
- column( SINCE, cond::Time_t );
- column( PAYLOAD_HASH, std::string, PAYLOAD::PAYLOAD_HASH_SIZE );
- column( INSERTION_TIME, boost::posix_time::ptime );
+ conddb_column( TAG_NAME, std::string );
+ conddb_column( SINCE, cond::Time_t );
+ conddb_column( PAYLOAD_HASH, std::string, PAYLOAD::PAYLOAD_HASH_SIZE );
+ conddb_column( INSERTION_TIME, boost::posix_time::ptime );
struct SINCE_GROUP {
typedef cond::Time_t type;
@@ -135,53 +135,28 @@ namespace cond {
};
}
- // temporary... to be removed after the changeover.
- table( TAG_MIGRATION ) {
-
- column( SOURCE_ACCOUNT, std::string );
- column( SOURCE_TAG, std::string );
- column( TAG_NAME, std::string );
- column( STATUS_CODE, int );
- column( INSERTION_TIME, boost::posix_time::ptime );
-
- class Table : public ITagMigrationTable {
- public:
- explicit Table( coral::ISchema& schema );
- virtual ~Table(){}
- bool exists();
- void create();
- bool select( const std::string& sourceAccount, const std::string& sourceTag, std::string& tagName, int& statusCode);
- void insert( const std::string& sourceAccount, const std::string& sourceTag, const std::string& tagName,
- int statusCode, const boost::posix_time::ptime& insertionTime);
- void updateValidationCode( const std::string& sourceAccount, const std::string& sourceTag, int statusCode );
- private:
- coral::ISchema& m_schema;
- };
- }
+ conddb_table( TAG_LOG ) {
- // temporary... to be removed after the changeover.
- table( PAYLOAD_MIGRATION ) {
-
- column( SOURCE_ACCOUNT, std::string );
- column( SOURCE_TOKEN, std::string );
- column( PAYLOAD_HASH, std::string, PAYLOAD::PAYLOAD_HASH_SIZE );
- column( INSERTION_TIME, boost::posix_time::ptime );
-
- class Table : public IPayloadMigrationTable {
+ conddb_column( TAG_NAME, std::string );
+ conddb_column( EVENT_TIME, boost::posix_time::ptime );
+ conddb_column( USER_NAME, std::string );
+ conddb_column( HOST_NAME, std::string );
+ conddb_column( COMMAND, std::string );
+ conddb_column( ACTION, std::string );
+ conddb_column( USER_TEXT, std::string );
+
+ class Table : public ITagLogTable {
public:
explicit Table( coral::ISchema& schema );
virtual ~Table(){}
bool exists();
- void create();
- bool select( const std::string& sourceAccount, const std::string& sourceToken, std::string& payloadId );
- void insert( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
- const boost::posix_time::ptime& insertionTime);
- void update( const std::string& sourceAccount, const std::string& sourceToken, const std::string& payloadId,
- const boost::posix_time::ptime& insertionTime);
+ void create();
+ void insert( const std::string& tag, const boost::posix_time::ptime& eventTime, const std::string& userName, const std::string& hostName,
+ const std::string& command, const std::string& action, const std::string& userText );
private:
coral::ISchema& m_schema;
};
- }
+ }
class IOVSchema : public IIOVSchema {
public:
@@ -191,16 +166,13 @@ namespace cond {
bool create();
ITagTable& tagTable();
IIOVTable& iovTable();
+ ITagLogTable& tagLogTable();
IPayloadTable& payloadTable();
- ITagMigrationTable& tagMigrationTable();
- IPayloadMigrationTable& payloadMigrationTable();
- std::string parsePoolToken( const std::string& );
private:
TAG::Table m_tagTable;
IOV::Table m_iovTable;
+ TAG_LOG::Table m_tagLogTable;
PAYLOAD::Table m_payloadTable;
- TAG_MIGRATION::Table m_tagMigrationTable;
- PAYLOAD_MIGRATION::Table m_payloadMigrationTable;
};
}
}
diff --git a/CondCore/CondDB/src/SessionImpl.h b/CondCore/CondDB/src/SessionImpl.h
index bd267da50ec6a..dff8258fd1921 100644
--- a/CondCore/CondDB/src/SessionImpl.h
+++ b/CondCore/CondDB/src/SessionImpl.h
@@ -5,8 +5,6 @@
#include "IOVSchema.h"
#include "GTSchema.h"
//
-#include "CondCore/DBCommon/interface/DbSession.h"
-//
#include "RelationalAccess/ConnectionService.h"
#include "RelationalAccess/ISessionProxy.h"
//
diff --git a/CondCore/DBCommon/src/base64.cc b/CondCore/CondDB/src/base64.cc
similarity index 100%
rename from CondCore/DBCommon/src/base64.cc
rename to CondCore/CondDB/src/base64.cc
diff --git a/CondCore/DBCommon/src/base64.h b/CondCore/CondDB/src/base64.h
similarity index 100%
rename from CondCore/DBCommon/src/base64.h
rename to CondCore/CondDB/src/base64.h
diff --git a/CondCore/DBCommon/src/blowfish.cc b/CondCore/CondDB/src/blowfish.cc
similarity index 100%
rename from CondCore/DBCommon/src/blowfish.cc
rename to CondCore/CondDB/src/blowfish.cc
diff --git a/CondCore/DBCommon/src/blowfish.h b/CondCore/CondDB/src/blowfish.h
similarity index 100%
rename from CondCore/DBCommon/src/blowfish.h
rename to CondCore/CondDB/src/blowfish.h
diff --git a/CondCore/CondDB/test/BuildFile.xml b/CondCore/CondDB/test/BuildFile.xml
index c0feaaadcf3e3..1f3f65cd247cb 100644
--- a/CondCore/CondDB/test/BuildFile.xml
+++ b/CondCore/CondDB/test/BuildFile.xml
@@ -28,3 +28,7 @@
+
+
+
+
diff --git a/CondCore/CondDB/test/testConditionDatabase_0.cpp b/CondCore/CondDB/test/testConditionDatabase_0.cpp
index 788cf571ae0ef..a68536d7eeb84 100644
--- a/CondCore/CondDB/test/testConditionDatabase_0.cpp
+++ b/CondCore/CondDB/test/testConditionDatabase_0.cpp
@@ -6,9 +6,6 @@
//
#include "CondCore/CondDB/interface/ConnectionPool.h"
//
-#include "CondCore/DBCommon/interface/DbConnection.h"
-#include "CondCore/DBCommon/interface/DbTransaction.h"
-#include "CondCore/DBCommon/interface/DbSession.h"
#include "MyTestData.h"
//
#include
diff --git a/CondCore/CondDB/test/testConnectionPool.cpp b/CondCore/CondDB/test/testConnectionPool.cpp
new file mode 100644
index 0000000000000..8455d9382cd8a
--- /dev/null
+++ b/CondCore/CondDB/test/testConnectionPool.cpp
@@ -0,0 +1,158 @@
+//Framework includes
+#include "FWCore/PluginManager/interface/PluginManager.h"
+#include "FWCore/PluginManager/interface/standard.h"
+#include "FWCore/PluginManager/interface/SharedLibrary.h"
+#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
+//Module includes
+#include "CondCore/CondDB/interface/ConnectionPool.h"
+#include "CondCore/CondDB/interface/PayloadProxy.h"
+//Entity class
+#include "CondFormats/RunInfo/interface/RunInfo.h"
+//CORAL includes
+#include "RelationalAccess/ISessionProxy.h"
+#include "RelationalAccess/ISchema.h"
+#include "RelationalAccess/ITransaction.h"
+#include "RelationalAccess/ITable.h"
+#include "RelationalAccess/IColumn.h"
+#include "RelationalAccess/IQuery.h"
+#include "RelationalAccess/ICursor.h"
+#include "CoralBase/AttributeSpecification.h"
+#include "CoralBase/AttributeList.h"
+#include "CoralBase/Attribute.h"
+//BOOST includes
+#include
+//
+#include
+#include
+#include
+#include
+
+void testCreateCoralSession( cond::persistency::ConnectionPool & connPool, std::string const & connectionString, bool const writeCapable ) {
+ boost::shared_ptr session = connPool.createCoralSession( connectionString, writeCapable );
+ session->transaction().start( true );
+ coral::ISchema& schema = session->nominalSchema();
+ std::string tagTable( "TAG" );
+ std::string iovTable( "IOV" );
+ std::string payloadTable( "PAYLOAD" );
+ std::string tag( "RunInfo_v1_mc" );
+ std::string object( "RunInfo" );
+ std::string hash( "cfd8987f899e99de69626e8a91b5c6b1506b82de" );
+ std::unique_ptr query( schema.tableHandle( tagTable ).newQuery() );
+ query->addToOutputList( "OBJECT_TYPE" );
+ query->defineOutputType( "OBJECT_TYPE", "string" );
+ std::string tagWhereClause( "NAME=:tag" );
+ coral::AttributeList tagBindVariableList;
+ tagBindVariableList.extend( "tag", typeid(std::string) );
+ tagBindVariableList[ "tag" ].data() = tag;
+ query->setCondition( tagWhereClause, tagBindVariableList );
+ coral::ICursor& tagCursor = query->execute();
+ while( tagCursor.next() ) {
+ tagCursor.currentRow().toOutputStream( std::cout ) << std::endl;
+ }
+ query.reset( schema.tableHandle( iovTable ).newQuery() );
+ query->addToOutputList( "SINCE" );
+ query->defineOutputType( "SINCE", "unsigned long long" );
+ std::string iovWhereClause( "TAG_NAME=:tag" );
+ coral::AttributeList iovBindVariableList;
+ iovBindVariableList.extend( "tag", typeid(std::string) );
+ iovBindVariableList[ "tag" ].data() = tag;
+ query->setCondition( iovWhereClause, iovBindVariableList );
+ coral::ICursor& iovCursor = query->execute();
+ while( iovCursor.next() ) {
+ iovCursor.currentRow().toOutputStream( std::cout ) << std::endl;
+ }
+ query.reset( schema.tableHandle( payloadTable ).newQuery() );
+ query->addToOutputList( "OBJECT_TYPE" );
+ query->defineOutputType( "OBJECT_TYPE", "string" );
+ std::string payloadWhereClause( "HASH=:hash" );
+ coral::AttributeList payloadBindVariableList;
+ payloadBindVariableList.extend( "hash", typeid(std::string) );
+ payloadBindVariableList[ "hash" ].data() = hash;
+ query->setCondition( payloadWhereClause, payloadBindVariableList );
+ coral::ICursor& payloadCursor = query->execute();
+ while( payloadCursor.next() ) {
+ payloadCursor.currentRow().toOutputStream( std::cout ) << std::endl;
+ }
+ session->transaction().commit();
+}
+
+void testCreateSession( cond::persistency::ConnectionPool & connPool, std::string const & connectionString, bool const writeCapable ) {
+ cond::persistency::Session session = connPool.createSession( connectionString, writeCapable );
+ cond::persistency::PayloadProxy pp;
+ pp.setUp( session );
+ pp.loadTag( "RunInfo_v1_mc" );
+ pp.setIntervalFor( 1, true );
+ std::cout << "run number: " << pp().m_run << std::endl;
+}
+
+void testCreateReadOnlySession( cond::persistency::ConnectionPool & connPool, std::string const & connectionString, std::string const & transactionId ) {
+ cond::persistency::Session session = connPool.createReadOnlySession( connectionString, transactionId );
+ session.transaction().start();
+ cond::persistency::IOVProxy iov = session.readIov( "RunInfo_v1_mc", true );
+ std::cout << "Loaded size="<( currentIov.payloadId )->m_run << std::endl;
+ session.transaction().commit();
+}
+
+int main (int argc, char** argv) {
+ edmplugin::PluginManager::Config config;
+ edmplugin::PluginManager::configure( edmplugin::standard::config() );
+
+ std::vector psets;
+ edm::ParameterSet pSet;
+ pSet.addParameter( "@service_type", std::string( "SiteLocalConfigService" ) );
+ psets.push_back( pSet );
+ static const edm::ServiceToken services( edm::ServiceRegistry::createSet( psets ) );
+ static const edm::ServiceRegistry::Operate operate( services );
+
+ std::array connectionStrings{ { "frontier://FrontierPrep/CMS_CONDITIONS",
+ "frontier://(proxyconfigurl=http://cmst0frontier.cern.ch/t0.pac)(backupproxyurl=http://cmst0frontier.cern.ch:3128)(backupproxyurl=http://cmst0frontier1.cern.ch:3128)(backupproxyurl=http://cmst0frontier2.cern.ch:3128)(backupproxyurl=http://cmsbpfrontier.cern.ch:3128)(backupproxyurl=http://cmsbpfrontier1.cern.ch:3128)(backupproxyurl=http://cmsbpfrontier2.cern.ch:3128)(backupproxyurl=http://cmsbproxy.fnal.gov:3128)(serverurl=http://cmsfrontier.cern.ch:8000/FrontierPrep)(serverurl=http://cmsfrontier1.cern.ch:8000/FrontierPrep)(serverurl=http://cmsfrontier2.cern.ch:8000/FrontierPrep)(serverurl=http://cmsfrontier3.cern.ch:8000/FrontierPrep)(serverurl=http://cmsfrontier4.cern.ch:8000/FrontierPrep)/CMS_CONDITIONS"
+ }
+ };
+ try {
+ //*************
+ for( const auto& connectionString : connectionStrings ) {
+ std::cout << "# Connecting with db in '" << connectionString << "'" << std::endl;
+ cond::persistency::ConnectionPool connPool;
+ //connPool.setMessageVerbosity( coral::Debug );
+ //connPool.configure();
+ try {
+ connPool.createCoralSession( connectionString, true );
+ } catch( const std::exception& e ) {
+ std::cout << "EXPECTED EXCEPTION: " << e.what() << std::endl;
+ }
+ testCreateCoralSession( connPool, connectionString, false );
+ testCreateSession( connPool, connectionString, false );
+ testCreateReadOnlySession( connPool, connectionString, "" );
+ testCreateReadOnlySession( connPool, connectionString, "testConnectionPool" );
+ connPool.setFrontierSecurity( "foo" );
+ connPool.configure();
+ try {
+ connPool.createCoralSession( connectionString, false );
+ } catch( const cms::Exception& e ) {
+ std::cout << "EXPECTED EXCEPTION: " << e.what() << std::endl;
+ }
+ edm::ParameterSet dbParameters;
+ dbParameters.addUntrackedParameter( "authenticationPath", std::string( "" ) );
+ dbParameters.addUntrackedParameter( "authenticationSystem", 0 );
+ dbParameters.addUntrackedParameter( "messageLevel", 3 );
+ dbParameters.addUntrackedParameter( "security", std::string( "sig" ) );
+ dbParameters.addUntrackedParameter( "logging", false );
+ connPool.setParameters( dbParameters );
+ connPool.configure();
+ testCreateCoralSession( connPool, connectionString, false );
+ testCreateSession( connPool, connectionString, false );
+ testCreateReadOnlySession( connPool, connectionString, "" );
+ testCreateReadOnlySession( connPool, connectionString, "testConnectionPool" );
+ }
+ } catch (const std::exception& e){
+ std::cout << "ERROR: " << e.what() << std::endl;
+ return -1;
+ } catch (...){
+ std::cout << "UNEXPECTED FAILURE." << std::endl;
+ return -1;
+ }
+}
+
diff --git a/CondCore/CondDB/test/testReadWritePayloads.cpp b/CondCore/CondDB/test/testReadWritePayloads.cpp
index e701d5df5bf80..18958141c8f0b 100644
--- a/CondCore/CondDB/test/testReadWritePayloads.cpp
+++ b/CondCore/CondDB/test/testReadWritePayloads.cpp
@@ -7,9 +7,6 @@
//
#include "CondCore/CondDB/interface/ConnectionPool.h"
//
-#include "CondCore/DBCommon/interface/DbConnection.h"
-#include "CondCore/DBCommon/interface/DbTransaction.h"
-#include "CondCore/DBCommon/interface/DbSession.h"
#include "MyTestData.h"
// #include "ArrayPayload.h"
// #include "SimplePayload.h"
diff --git a/CondCore/CondDB/test/testTempWrapper_1.cpp b/CondCore/CondDB/test/testTempWrapper_1.cpp
deleted file mode 100644
index 1a12261d5e218..0000000000000
--- a/CondCore/CondDB/test/testTempWrapper_1.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-#include "FWCore/PluginManager/interface/PluginManager.h"
-#include "FWCore/PluginManager/interface/standard.h"
-#include "FWCore/PluginManager/interface/SharedLibrary.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
-//
-#include "CondCore/CondDB/interface/CondDB.h"
-#include "CondCore/MetaDataService/interface/MetaData.h"
-#include "CondCore/DBCommon/interface/DbTransaction.h"
-//
-#include
-#include
-#include
-#include
-
-using namespace cond::db;
-
-void dumpSince( cond::Time_t target, IOVProxy& data ){
- auto i = data.find( target );
- if( i == data.end() ) {
- std::cout <<"No valid IOV for time="<( tag1, cond::runnumber, cond::OFFLINE );
- std::cout <<"Now the database "<
-
-
-
-
-
-
-
-
-
diff --git a/CondCore/DBCommon/doc/DBCommon.doc b/CondCore/DBCommon/doc/DBCommon.doc
deleted file mode 100644
index dd9cf2872f933..0000000000000
--- a/CondCore/DBCommon/doc/DBCommon.doc
+++ /dev/null
@@ -1,60 +0,0 @@
-
-/*!
-
-\page CondCore_DBCommon Package CondCore/DBCommon
-
-
-
-
-
-Source code (CVS tag: @CVS_TAG@) -
-Administrative privileges
-
-
-
-\section desc Description
-
-
-Central base package encapsulates the interaction with databases.
-
-\subsection interface Public interface
-
-
-- AuthenticationMethod
-- ConfigSessionFromParameterSet
-- ConnectionConfiguration
-- ConnectMode
-- ContainerIterator
-- DBSession
-- Exception
-- MessageLevel
-- ObjectRelationalMappingUtility
-- PoolStorageManager
-- Ref
-- RelationalStorageManager
-- SessionConfiguration
-- Time
-- TokenBuilder
-
-\subsection modules Modules
-
-None
-
-\subsection tests Unit tests and examples
-
-testCondObjRef: unit test cond::Ref wrapper class
-testCondObjCopy: test container copy functionality
-testGenericCondObjCopy: test copy objects by token
-testTokenBuilder: test building pool token by external parameters
-testContainerIterator: test container iterator functionality
-testServiceLoader: test serviceloader
-
-\section status Status and planned development
-
-stable
-
-
-Last updated:
-@DATE@ Author: Z. Xie
-*/
-
diff --git a/CondCore/DBCommon/interface/Auth.h b/CondCore/DBCommon/interface/Auth.h
deleted file mode 100644
index 5b3a3d6ba3a7c..0000000000000
--- a/CondCore/DBCommon/interface/Auth.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef COND_DBCommon_Roles_h
-#define COND_DBCommon_Roles_h
-
-#include
-
-namespace cond{
-
- class Auth {
-
- public:
-
- static const char* COND_AUTH_PATH;
- static const char* COND_AUTH_SYS;
-
- static const std::string COND_ADMIN_GROUP;
-
- static const std::string COND_DEFAULT_ROLE;
- static const std::string COND_WRITER_ROLE;
- static const std::string COND_READER_ROLE;
- static const std::string COND_ADMIN_ROLE;
- static const std::string COND_DEFAULT_PRINCIPAL;
-
- static const std::string COND_KEY;
- static const unsigned int COND_AUTHENTICATION_KEY_SIZE = 30;
- static const unsigned int COND_DB_KEY_SIZE = 30;
-
- static const std::string COND_AUTH_PATH_PROPERTY;
-
- };
-}
-
-#endif
-// DBSESSION_H
diff --git a/CondCore/DBCommon/interface/BlobStreamerPluginFactory.h b/CondCore/DBCommon/interface/BlobStreamerPluginFactory.h
deleted file mode 100644
index 98184008a12e9..0000000000000
--- a/CondCore/DBCommon/interface/BlobStreamerPluginFactory.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef CondCore_DBCommon_BlobStreamerPluginFactory_h
-#define CondCore_DBCommon_BlobStreamerPluginFactory_h
-#include "FWCore/PluginManager/interface/PluginFactory.h"
-#include "CondCore/ORA/interface/IBlobStreamingService.h"
-#include
-
-namespace cond {
- typedef edmplugin::PluginFactory< ora::IBlobStreamingService*() > BlobStreamerPluginFactory;
-}
-
-#endif
diff --git a/CondCore/DBCommon/interface/Cipher.h b/CondCore/DBCommon/interface/Cipher.h
deleted file mode 100644
index 962dfdf0e7825..0000000000000
--- a/CondCore/DBCommon/interface/Cipher.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef INCLUDE_COND_CIPHER_H
-#define INCLUDE_COND_CIPHER_H
-
-#include
-#include
-
-struct BLOWFISH_CTX;
-
-namespace cond {
-
- class Cipher {
- public:
-
- explicit Cipher( const std::string& key );
-
- ~Cipher();
-
- size_t encrypt( const std::string& input, unsigned char*& output );
-
- std::string decrypt( const unsigned char* input, size_t inputSize );
-
- std::string b64encrypt( const std::string& input );
-
- std::string b64decrypt( const std::string& input );
-
- private:
-
- size_t bf_process_alloc( const unsigned char* input, size_t input_size, unsigned char*& output, bool decrypt=false );
-
- private:
-
- BLOWFISH_CTX* m_ctx;
- };
-
-}
-
-#endif
-
diff --git a/CondCore/DBCommon/interface/ClassID.h b/CondCore/DBCommon/interface/ClassID.h
deleted file mode 100644
index f132c68bbfbe5..0000000000000
--- a/CondCore/DBCommon/interface/ClassID.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef CondCoreDBCommon_ClassID_H
-#define CondCoreDBCommon_ClassID_H
-#include
-#include
-#include
-
-namespace cond {
-
- namespace idCategories {
- std::string const pythonIDCategory("CondPythonID");
- }
-
-
-
- char const * className(const std::type_info& t);
-
-
- class ClassInfo {
- public:
- virtual ~ClassInfo(){}
- inline ClassInfo(const std::type_info& t) : tinfo(t) {}
- //inline ClassInfo(const std::type_info& t, int);
- inline const std::type_info& type() const { return tinfo;}
- std::string pluginName(std::string const & prefix) const;
- virtual std::string resource() const=0;
- private:
- //ClassIDRegistry * registry;
- //const char * registerMe(const std::type_info& t);
- const std::type_info& tinfo;
- };
-
-
- /**class ClassIDRegistry {
- public:
- typedef ClassInfo Elem;
- std::vector sids;
- std::vector csids;
- ClassIDRegistry(std::string const & pfix);
-
- const char * registerMe(const std::type_info& t);
-
- private:
- std::string prefix;
-
- };
- **/
-
- template
- struct ClassID : public ClassInfo {
- ClassID() : ClassInfo(typeid(T)) {}
- ClassID(char const * res ) : ClassInfo(typeid(T)), m_res(res) {}
-// ClassID(int i) : ClassInfo(typeid(T),i) {}
- virtual std::string resource() const { return m_res;}
- private:
- std::string m_res;
- };
-
-
-}
-
-/**
-// magic: works only if a file local registry exists in the file
-#define ELEM_CONSTR(xx_) \
- cond::ClassInfo::ClassInfo(const std::type_info& t,int) : tinfo(t) {registry = &xx_;registerMe(t);}
-**/
-
-#include "FWCore/PluginManager/interface/PluginFactory.h"
-namespace cond{
- typedef edmplugin::PluginFactory ClassInfoFactory;
-}
-
-#define PYTHON_ID(type_, plugName_, uname_) \
- namespace pythonID { struct EDM_PLUGIN_SYM(plugName_, uname_) : public cond::ClassID { EDM_PLUGIN_SYM(plugName_ , uname_) () : cond::ClassID(::plugName_){}};} \
- DEFINE_EDM_PLUGIN(cond::ClassInfoFactory, EDM_PLUGIN_SYM(pythonID::plugName_, uname_) , EDM_PLUGIN_SYM(pythonID::plugName_, uname_)().pluginName(cond::idCategories::pythonIDCategory).c_str() )
-
-
-#endif // CondCoreDBCommon_ClassID_H
diff --git a/CondCore/DBCommon/interface/ConvertIOVSyncValue.h b/CondCore/DBCommon/interface/ConvertIOVSyncValue.h
deleted file mode 100644
index 09f15553ceebd..0000000000000
--- a/CondCore/DBCommon/interface/ConvertIOVSyncValue.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef COND_DBCommon_ConvertIOVSyncValue_H
-#define COND_DBCommon__ConvertIOVSyncValue_H
-
-#include "CondCore/DBCommon/interface/Time.h"
-#include "FWCore/Framework/interface/IOVSyncValue.h"
-
-namespace cond {
-
- edm::IOVSyncValue toIOVSyncValue(cond::Time_t time, cond::TimeType timetype, bool startOrStop);
-
- cond::Time_t fromIOVSyncValue(edm::IOVSyncValue const & time, cond::TimeType timetype);
-
- // min max sync value....
- edm::IOVSyncValue limitedIOVSyncValue(cond::Time_t time, cond::TimeType timetype);
-
- edm::IOVSyncValue limitedIOVSyncValue(edm::IOVSyncValue const & time, cond::TimeType timetype);
-
-
-}
-
-
-#endif
diff --git a/CondCore/DBCommon/interface/DbConnection.h b/CondCore/DBCommon/interface/DbConnection.h
deleted file mode 100644
index 51fe35a6c6868..0000000000000
--- a/CondCore/DBCommon/interface/DbConnection.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef COND_DBCommon_DbConnection_h
-#define COND_DBCommon_DbConnection_h
-
-#include
-#include
-#include "DbConnectionConfiguration.h"
-#include "DbSession.h"
-//
-// Package: CondCore/DBCommon
-// Class: DbConnection
-//
-/**\class DbConnection DbConnection.h CondCore/DBCommon/interface/DbConnection.h
- Description: Class to prepare database connection setup
-*/
-
-namespace coral {
- class ConnectionService;
- class ISessionProxy;
- class IMonitoringReporter;
- class IWebCacheControl;
-}
-
-namespace edm{
- class ParameterSet;
-}
-
-namespace ora {
- class ConnectionPool;
-}
-
-namespace cond{
-
- /*
- **/
- class DbConnection{
- public:
- DbConnection();
-
- DbConnection(const DbConnection& conn);
-
- virtual ~DbConnection();
-
- DbConnection& operator=(const DbConnection& conn);
-
- void configure();
-
- void configure( cond::DbConfigurationDefaults defaultItem );
-
- void configure( const edm::ParameterSet& connectionPset );
-
- void close();
-
- bool isOpen() const;
-
- DbSession createSession() const;
-
- DbConnectionConfiguration & configuration();
- DbConnectionConfiguration const & configuration() const;
-
- boost::shared_ptr connectionPool() const;
-
- coral::IConnectionService& connectionService() const;
-
- const coral::IMonitoringReporter& monitoringReporter() const;
-
- coral::IWebCacheControl& webCacheControl() const;
-
- private:
- class ConnectionImpl;
-
- private:
- boost::shared_ptr m_implementation;
-
- };
-}
-#endif
-// DBCONNECTION_H
diff --git a/CondCore/DBCommon/interface/DbConnectionConfiguration.h b/CondCore/DBCommon/interface/DbConnectionConfiguration.h
deleted file mode 100644
index 3285d6d37eef5..0000000000000
--- a/CondCore/DBCommon/interface/DbConnectionConfiguration.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef COND_DBCommon_DbConnectionConfiguration_h
-#define COND_DBCommon_DbConnectionConfiguration_h
-//
-// Package: CondCore/DBCommon
-// Class: DbConnectionConfiguration
-//
-/**\class ConnectionConfiguration ConnectionConfiguration.h CondCore/DBCommon/interface/ConnectionConfiguration.h
- Description: set cofiguration parameters of the session
-*/
-//
-//
-#include
-// coral includes
-#include "CoralBase/MessageStream.h"
-#include "RelationalAccess/IMonitoring.h"
-
-namespace coral {
- class IConnectionServiceConfiguration;
-}
-
-namespace edm{
- class ParameterSet;
-}
-
-namespace cond{
- class CoralServiceManager;
-
- enum DbConfigurationDefaults { CoralDefaults, CmsDefaults, ProdDefaults, ToolDefaults, WebDefaults};
-
- enum DbAuthenticationSystem { UndefinedAuthentication=0,CondDbKey, CoralXMLFile };
-
- class DbConnectionConfiguration{
- public:
- static const std::vector& defaultConfigurations();
- public:
- DbConnectionConfiguration();
- DbConnectionConfiguration( bool connectionSharing,
- int connectionTimeOut,
- bool readOnlySessionOnUpdateConnections,
- int connectionRetrialPeriod,
- int connectionRetrialTimeOut,
- bool poolAutomaticCleanUp,
- const std::string& authenticationPath,
- const std::string& transactionId,
- coral::MsgLevel msgLev,
- coral::monitor::Level monitorLev,
- bool SQLMonitoring );
-
- DbConnectionConfiguration( const DbConnectionConfiguration& rhs);
- ~DbConnectionConfiguration();
- DbConnectionConfiguration& operator=( const DbConnectionConfiguration& rhs);
- // configuration from edm parameter set
- void setParameters( const edm::ParameterSet& connectionPset );
- // configuration for individual connection parameters
- void setConnectionSharing( bool flag );
- void setConnectionTimeOut( int timeOut );
- void setReadOnlySessionOnUpdateConnections( bool flag );
- void setConnectionRetrialPeriod( int period );
- void setConnectionRetrialTimeOut( int timeout );
- void setPoolAutomaticCleanUp( bool flag );
- // authentication
- void setAuthenticationPath( const std::string& p );
- void setAuthenticationSystem( int authSysCode );
- // transaction Id for multijob (used by frontier)
- void setTransactionId( std::string const & tid);
- // message level
- void setMessageLevel( coral::MsgLevel l );
- // monitoring level
- void setMonitoringLevel( coral::monitor::Level l );
- // SQL monitoring
- void setSQLMonitoring( bool flag );
- // force the coral configuration
- void configure( coral::IConnectionServiceConfiguration& coralConfig) const;
- // getters
- bool isConnectionSharingEnabled() const;
- int connectionTimeOut() const;
- bool isReadOnlySessionOnUpdateConnectionEnabled() const;
- int connectionRetrialPeriod() const;
- int connectionRetrialTimeOut() const;
- bool isPoolAutomaticCleanUpEnabled() const;
- const std::string& authenticationPath() const;
- const std::string& transactionId() const;
- coral::MsgLevel messageLevel() const;
- bool isSQLMonitoringEnabled() const;
- private:
- std::pair m_connectionSharing;
- std::pair m_connectionTimeOut;
- std::pair m_readOnlySessionOnUpdateConnections;
- std::pair m_connectionRetrialPeriod;
- std::pair m_connectionRetrialTimeOut;
- std::pair m_poolAutomaticCleanUp;
- std::string m_authPath;
- int m_authSys;
- std::string m_transactionId;
- coral::MsgLevel m_messageLevel;
- coral::monitor::Level m_monitoringLevel;
- //int m_idleConnectionCleanupPeriod;
-
- bool m_SQLMonitoring;
- CoralServiceManager* m_pluginManager;
- };
-}
-#endif
diff --git a/CondCore/DBCommon/interface/DbOpenTransaction.h b/CondCore/DBCommon/interface/DbOpenTransaction.h
deleted file mode 100644
index c16f183416dd2..0000000000000
--- a/CondCore/DBCommon/interface/DbOpenTransaction.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef CondCore_DBCommon_DbOpenTransaction_H
-#define CondCore_DBCommon_DbOpenTransaction_H
-//
-// Package: DBCommon
-// Class : DbOpenTransaction
-//
-/**\class DbScopedTransaction DbScopedTransaction.h CondCore/DBCommon/interface/DbScopedTransaction.h
- Description:
-*/
-//
-//
-
-namespace cond{
-
- class DbTransaction;
-
- class DbOpenTransaction {
- public:
- explicit DbOpenTransaction( cond::DbTransaction& transaction );
-
- ~DbOpenTransaction();
- /// start transaction
- /// current transaction is readonly
- void ok();
- private:
- cond::DbTransaction& m_transaction;
- bool m_status;
-
- };
-}
-#endif
diff --git a/CondCore/DBCommon/interface/DbScopedTransaction.h b/CondCore/DBCommon/interface/DbScopedTransaction.h
deleted file mode 100644
index 3d2b4bfb31261..0000000000000
--- a/CondCore/DBCommon/interface/DbScopedTransaction.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef CondCore_DBCommon_DbScopedTransaction_H
-#define CondCore_DBCommon_DbScopedTransaction_H
-//
-// Package: DBCommon
-// Class : DbScopedTransaction
-//
-/**\class DbScopedTransaction DbScopedTransaction.h CondCore/DBCommon/interface/DbScopedTransaction.h
- Description:
-*/
-//
-//
-
-namespace cond{
-
- class DbSession;
-
- class DbScopedTransaction {
- public:
- explicit DbScopedTransaction( cond::DbSession& session );
-
- ~DbScopedTransaction();
- /// start transaction
- int start(bool readOnly = false);
- /// commit transaction. Will disconnect from database if connection timeout==0 or connectted time close to the threshold
- int commit();
- /// rollback transaction
- bool rollback();
- /// query if locally has been activated
- bool isLocallyActive() const;
- /// current transaction is active
- int isActive() const;
- /// current transaction is readonly
- bool isReadOnly() const;
- private:
- cond::DbSession& m_session;
- bool m_locallyActive;
-
- };
-}
-#endif
diff --git a/CondCore/DBCommon/interface/DbSession.h b/CondCore/DBCommon/interface/DbSession.h
deleted file mode 100644
index d9565aada0513..0000000000000
--- a/CondCore/DBCommon/interface/DbSession.h
+++ /dev/null
@@ -1,159 +0,0 @@
-#ifndef COND_DBCommon_DbSession_h
-#define COND_DBCommon_DbSession_h
-
-#include "CondCore/ORA/interface/Database.h"
-#include "CondCore/ORA/interface/PoolToken.h"
-#include
-#include
-
-//
-// Package: CondCore/DBCommon
-// Class: DbSession
-//
-/**\class DbSession DbSession.h CondCore/DBCommon/interface/DbSession.h
- Description: Class to prepare database connection setup
-*/
-
-namespace coral {
- class IConnectionService;
- class ISchema;
- class ISessionProxy;
-}
-
-namespace cond{
-
- class DbTransaction;
- class DbConnection;
- class SessionImpl;
-
- /*
- **/
- class DbSession{
- public:
- static const char* COND_SCHEMA_VERSION;
- static const char* CHANGE_SCHEMA_VERSION;
-
- public:
- DbSession();
-
- explicit DbSession( const DbConnection& connection );
-
- DbSession( const DbSession& rhs );
-
- virtual ~DbSession();
-
- DbSession& operator=( const DbSession& rhs );
-
- const std::string& connectionString() const;
-
- const DbConnection& connection() const;
-
- bool isTransactional() const;
-
- const std::string& blobStreamingService() const;
-
- void open( const std::string& connectionString, bool readOnly=false );
- void open( const std::string& connectionString, const std::string& role, bool readOnly=false );
- void openReadOnly( const std::string& connectionString, const std::string& id );
- void open( boost::shared_ptr& coralSession, const std::string& connectionString, const std::string& schemaName="" );
- void close();
-
- bool isOpen() const;
-
- DbTransaction& transaction();
-
- bool createDatabase();
-
- // TEMPORARY, for the IOV schema changeover.
- bool isOldSchema();
-
- coral::ISchema& schema(const std::string& schemaName);
-
- coral::ISchema& nominalSchema();
-
- bool deleteMapping( const std::string& mappingVersion );
-
- bool importMapping( const std::string& sourceConnectionString,
- const std::string& contName );
-
- ora::Object getObject( const std::string& objectId );
-
- template boost::shared_ptr getTypedObject( const std::string& objectId );
-
- template std::string storeObject( const T* object, const std::string& containerName );
-
- std::string storeObject( const ora::Object& objectRef, const std::string& containerName );
-
- template bool updateObject( const T* object, const std::string& objectId );
-
- bool deleteObject( const std::string& objectId );
-
- std::string importObject( cond::DbSession& fromDatabase, const std::string& objectId );
-
- std::string classNameForItem( const std::string& objectId );
-
- void flush();
-
- ora::Database& storage();
-
- private:
-
- boost::shared_ptr m_implementation;
- };
-
- class PoolTokenParser : public ora::ITokenParser {
- public:
- explicit PoolTokenParser( ora::Database& db );
- ~PoolTokenParser(){
- }
- ora::OId parse( const std::string& poolToken );
- std::string className( const std::string& poolToken );
-
- private:
- ora::Database& m_db;
- };
-
- class PoolTokenWriter : public ora::ITokenWriter {
- public:
- explicit PoolTokenWriter( ora::Database& db );
- ~PoolTokenWriter(){
- }
- std::string write( const ora::OId& oid );
- private:
- ora::Database& m_db;
- };
-
- template inline boost::shared_ptr DbSession::getTypedObject( const std::string& objectId ){
- ora::OId oid;
- oid.fromString( objectId );
- return storage().fetch( oid );
- }
-
- template inline std::string DbSession::storeObject( const T* object,
- const std::string& containerName ){
- std::string ret("");
- if( object ){
- ora::OId oid = storage().insert( containerName, *object );
- storage().flush();
- ret = oid.toString();
- }
- return ret;
- }
-
- template inline bool DbSession::updateObject( const T* object,
- const std::string& objectId ){
- bool ret = false;
- if( object ){
- ora::OId oid;
- oid.fromString( objectId );
- storage().update( oid, *object );
- storage().flush();
- ret = true;
- }
- return ret;
- }
-
-}
-
-#endif
-// DBSESSION_H
diff --git a/CondCore/DBCommon/interface/DbTransaction.h b/CondCore/DBCommon/interface/DbTransaction.h
deleted file mode 100644
index 1e500072ad8c6..0000000000000
--- a/CondCore/DBCommon/interface/DbTransaction.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef CondCore_DBCommon_DbTransaction_H
-#define CondCore_DBCommon_DbTransaction_H
-
-//
-// Package: DBCommon
-// Class : DbTransaction
-//
-/**\class DbTransaction DbTransaction.h CondCore/DBCommon/interface/DbTransaction.h
- Description:
-*/
-//
-//
-
-namespace ora {
- class Transaction;
-}
-
-namespace cond{
- class DbTransaction {
-
- public:
- DbTransaction( ora::Transaction& dbTrans, bool owned=true );
-
- ~DbTransaction();
- /// start transaction
- int start(bool readOnly = false);
- /// commit transaction.
- int commit();
- /// force the commit, regardless to the transaction clients
- bool forceCommit();
- /// rollback transaction
- bool rollback();
- /// current transaction is active
- int isActive() const;
- /// current transaction is readonly
- bool isReadOnly() const;
- private:
- ora::Transaction& m_dbTrans;
- bool m_readOnly;
- int m_clients;
- bool m_owned;
-
- };
-}
-#endif
diff --git a/CondCore/DBCommon/interface/DecodingKey.h b/CondCore/DBCommon/interface/DecodingKey.h
deleted file mode 100644
index c732f6f13d789..0000000000000
--- a/CondCore/DBCommon/interface/DecodingKey.h
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef CondCoreDBCommon_DecodingKey_H
-#define CondCoreDBCommon_DecodingKey_H
-
-#include
-#include
-#include
-#include
-
-namespace cond {
-
- struct ServiceCredentials {
- ServiceCredentials();
- std::string connectionString;
- std::string userName;
- std::string password;
- };
-
- class KeyGenerator {
- public:
-
- KeyGenerator();
-
- std::string make( size_t keySize );
- std::string makeWithRandomSize( size_t maxSize );
-
- private:
-
- int m_iteration;
-
- };
-
- class DecodingKey {
-
- public:
-
- static const std::string FILE_NAME;
- static const std::string FILE_PATH;
- static const size_t DEFAULT_KEY_SIZE = 100;
- static std::string templateFile();
-
- public:
-
- DecodingKey();
-
- virtual ~DecodingKey(){}
-
- size_t init( const std::string& keyFileName, const std::string& password, bool readMode = true );
-
- size_t createFromInputFile( const std::string& inputFileName, size_t generatedKeySize = 0 );
-
- void list( std::ostream& out );
-
- void flush();
-
- const std::string& principalName() const;
-
- const std::string& principalKey() const;
-
- bool isNominal() const;
-
- const std::string& ownerName() const;
-
- const std::map< std::string, ServiceCredentials >& services() const;
-
- void addDefaultService( const std::string& connectionString );
-
- void addService( const std::string& serviceName, const std::string& connectionString, const std::string& userName, const std::string& password );
-
-
- private:
-
- std::string m_fileName;
-
- bool m_mode;
-
- std::string m_pwd;
-
- std::string m_principalName;
-
- std::string m_principalKey;
-
- std::string m_owner;
-
- std::map< std::string, ServiceCredentials > m_services;
-
- };
-}
-
-inline
-cond::KeyGenerator::KeyGenerator():m_iteration(0){
-}
-
-inline
-cond::ServiceCredentials::ServiceCredentials():connectionString(""),userName(""),password(""){
-}
-
-inline
-cond::DecodingKey::DecodingKey():m_fileName(""),m_mode( true ),m_pwd(""),m_principalName(""),m_principalKey(""),m_owner(""),m_services(){
-}
-
-inline
-const std::string&
-cond::DecodingKey::principalName() const {
- return m_principalName;
-}
-
-inline
-const std::string&
-cond::DecodingKey::principalKey() const {
- return m_principalKey;
-}
-
-inline
-bool
-cond::DecodingKey::isNominal() const {
- return !m_owner.empty();
-}
-
-inline
-const std::string&
-cond::DecodingKey::ownerName() const {
- return m_owner;
-}
-
-inline
-const std::map< std::string, cond::ServiceCredentials >&
-cond::DecodingKey::services() const { return m_services; }
-
-#endif // CondCoreDBCommon_DecodingKey_H
-
-
diff --git a/CondCore/DBCommon/interface/Exception.h b/CondCore/DBCommon/interface/Exception.h
deleted file mode 100644
index 450a5ded48b3c..0000000000000
--- a/CondCore/DBCommon/interface/Exception.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifdef COND_EXP_WARNING
-#warning please ignore previous warning
-#endif
-#ifndef COND_EXCEPTION_H
-#define COND_EXCEPTION_H
-#include "FWCore/Utilities/interface/Exception.h"
-#include
-namespace cond{
- class Exception : public cms::Exception{
- public:
- explicit Exception( const std::string& message );
- virtual ~Exception() throw();
- };
- class noDataForRequiredTimeException : public Exception{
- public:
- noDataForRequiredTimeException(const std::string& from,
- const std::string& rcd,
- const std::string& current);
- virtual ~noDataForRequiredTimeException() throw();
- };
- class RefException : public Exception{
- public:
- RefException(const std::string& from,
- const std::string& msg);
- virtual ~RefException() throw(){}
- };
- class TransactionException : public Exception{
- public:
- TransactionException(const std::string& from,
- const std::string& msg);
- virtual ~TransactionException() throw(){}
- };
-
- void throwException [[noreturn]] ( std::string const& message, std::string const& methodName );
-}
-#endif
diff --git a/CondCore/DBCommon/interface/FipProtocolParser.h b/CondCore/DBCommon/interface/FipProtocolParser.h
deleted file mode 100644
index d61401a4109bf..0000000000000
--- a/CondCore/DBCommon/interface/FipProtocolParser.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef DBCommon_FipProtocolParser_H
-#define DBCommon_FipProtocolParser_H
-#include
-namespace cond{
- class FipProtocolParser{
- public:
- FipProtocolParser();
- ~FipProtocolParser();
- std::string getRealConnect(const std::string& fipConnect) const;
- };
-}//ns cond
-#endif
-
diff --git a/CondCore/DBCommon/interface/IOVInfo.h b/CondCore/DBCommon/interface/IOVInfo.h
deleted file mode 100644
index 3f676dca6193a..0000000000000
--- a/CondCore/DBCommon/interface/IOVInfo.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef COND_DBCommon_IOVInfo_H
-#define COND_DBCommon_IOVInfo_H
-
-#include
-
-namespace cond {
-
- // return a formatted information about the current user taken from the environment
- std::string userInfo();
-
-
-}
-
-
-#endif // COND_DBCommon_IOVInfo_H
diff --git a/CondCore/DBCommon/interface/LogDBEntry.h b/CondCore/DBCommon/interface/LogDBEntry.h
deleted file mode 100644
index 9837334598ac3..0000000000000
--- a/CondCore/DBCommon/interface/LogDBEntry.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef CondCore_DBCommon_LogDBEntry_H
-#define CondCore_DBCommon_LogDBEntry_H
-#include
-namespace cond{
-
- class UserLogInfo{
- public:
- std::string provenance;
- std::string usertext;
- };
-
- class NullUserLogInfo : public UserLogInfo{
- };
-
- class LogDBEntry{
- public:
- unsigned long long logId;
- std::string destinationDB;
- std::string provenance;
- std::string usertext;
- std::string iovtag;
- std::string iovtimetype;
- unsigned int payloadIdx;
- unsigned long long lastSince;
- std::string payloadClass;
- std::string payloadToken;
- std::string exectime;
- std::string execmessage;
- };
-}
-#endif
diff --git a/CondCore/DBCommon/interface/Logger.h b/CondCore/DBCommon/interface/Logger.h
deleted file mode 100644
index 289ebeacb1284..0000000000000
--- a/CondCore/DBCommon/interface/Logger.h
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef CONDCORE_DBCOMMON_LOGGER_H
-#define CONDCORE_DBCOMMON_LOGGER_H
-
-#include "CondCore/DBCommon/interface/DbSession.h"
-#include
-
-//
-// Package: CondCore/DBCommon
-// Class : Logger
-//
-/**\class
-*/
-//
-// Author: Zhen Xie
-//
-
-namespace coral{
- //class ISchema;
- class IQuery;
-}
-namespace cond{
- class UserLogInfo;
- class LogDBEntry;
- class SequenceManager;
- class Logger{
- public:
- explicit Logger(DbSession& sessionHandle);
- ~Logger();
-
- void connect( const std::string& logConnectionString, bool readOnly=false );
- //NB. for oracle only schema owner can do this
- void createLogDBIfNonExist();
- //
- //the current local time will be registered as execution time
- // payloadName and containerName are also logged but they are deduced from payloadToken
- void logOperationNow(
- const cond::UserLogInfo& userlogInfo,
- const std::string& destDB,
- const std::string& payloadToken,
- const std::string& payloadClass,
- const std::string& iovtag,
- const std::string& iovtimetype,
- unsigned int payloadIdx,
- unsigned long long lastSince
- );
- //
- //the current local time will be registered as execution time
- //
- // payloadName and containerName are also logged but they are deduced from payloadToken
- void logFailedOperationNow(
- const cond::UserLogInfo& userlogInfo,
- const std::string& destDB,
- const std::string& payloadToken,
- const std::string& payloadClass,
- const std::string& iovtag,
- const std::string& iovtimetype,
- unsigned int payloadIdx,
- unsigned long long lastSince,
- const std::string& exceptionMessage
- );
- //
- // Here we query the log for the last entry for these payloads.
- // Parameter LogDBEntry& result is both input and output
- // As input, it defines query condition.
- // Last: in the sense of max rowid satisfies the requirement
- // Note: if empty logentry is given, the absolute max is returned which
- // normally is useless.
- // return empty struct is no result found
- //
- void LookupLastEntryByProvenance( const std::string& provenance,
- LogDBEntry& logentry,
- bool filterFailedOp=true) const;
- //
- // Here we query the log for the last entry for these payloads.
- // Parameter LogDBEntry& result is both input and output
- // As input, it defines query condition.
- // Last: in the sense of max rowid satisfies the requirement
- // Note: if empty logentry is given, the absolute max is returned which
- // normally is useless.
- //
- void LookupLastEntryByTag( const std::string& iovtag,
- LogDBEntry& logentry,
- bool filterFailedOp=true) const;
-
- void LookupLastEntryByTag( const std::string& iovtag,
- const std::string & connectionStr,
- LogDBEntry& logentry,
- bool filterFailedOp=true) const;
-
- private:
- void insertLogRecord(unsigned long long logId,
- const std::string& utctime,
- const std::string& destDB,
- const std::string& payloadToken,
- const std::string& payloadClass,
- const cond::UserLogInfo& userLogInfo,
- const std::string& iovtag,
- const std::string& iovtimetype,
- unsigned int payloadIdx,
- unsigned long long lastSince,
- const std::string& exceptionMessage);
-
- mutable DbSession m_sessionHandle;
- //coral::ISchema& m_schema;
- bool m_locked;
- coral::IQuery* m_statusEditorHandle;
- SequenceManager* m_sequenceManager;
- bool m_logTableExists;
- };
-}//ns cond
-#endif
diff --git a/CondCore/DBCommon/interface/PayloadRef.h b/CondCore/DBCommon/interface/PayloadRef.h
deleted file mode 100644
index b95e83822926c..0000000000000
--- a/CondCore/DBCommon/interface/PayloadRef.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef CondCore_DBCommon_PayloadRef_h
-#define CondCore_DBCommon_PayloadRef_h
-#include "CondCore/DBCommon/interface/DbTransaction.h"
-
-namespace cond {
-
- /* manages various types of wrappers...
- */
- template
- class PayloadRef {
- public:
-
- PayloadRef() {}
- ~PayloadRef(){}
-
- // dereference (does not re-load)
- const DataT & operator*() const {
- return *m_Data;
- }
-
- void clear() {
- m_Data.reset();
- }
-
-
- bool load( DbSession& dbSess, std::string const & itoken) {
- clear();
- bool ok = false;
- // is it ok to open a transaction here? or could be at higher level?
- boost::shared_ptr tmp = dbSess.getTypedObject( itoken );
- if (tmp.get()) {
- m_Data = tmp;
- ok = true;
- }
- return ok;
- }
-
-
- private:
- boost::shared_ptr m_Data;
- };
-
-}
-#endif // CondCore_PayloadProxy_h
diff --git a/CondCore/DBCommon/interface/SQLReport.h b/CondCore/DBCommon/interface/SQLReport.h
deleted file mode 100644
index 0a0b5382e9634..0000000000000
--- a/CondCore/DBCommon/interface/SQLReport.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef CondCoreDBCommon_SQLReport_H
-#define CondCoreDBCommon_SQLReport_H
-#include
-#include
-#include "CondCore/DBCommon/interface/DbConnection.h"
-
-namespace cond {
-
- class DbConnection;
-
- class SQLReport {
-
- public:
-
- explicit SQLReport(DbConnection& connection);
-
- virtual ~SQLReport(){}
-
- void reportForConnection(const std::string& connectionString);
-
- bool putOnFile(std::string fileName=std::string(""));
-
- private:
-
- SQLReport();
-
- DbConnection m_connection;
-
- std::stringstream m_report;
-
- };
-}
-
-inline
-cond::SQLReport::SQLReport(DbConnection& connection):m_connection(connection),m_report(){
-}
-
-#endif // CondCoreDBCommon_SQLReport_H
-
-
diff --git a/CondCore/DBCommon/interface/SequenceManager.h b/CondCore/DBCommon/interface/SequenceManager.h
deleted file mode 100644
index 5bc106640e50f..0000000000000
--- a/CondCore/DBCommon/interface/SequenceManager.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef CondCore_DBCommon_SequenceManager_h
-#define CondCore_DBCommon_SequenceManager_h
-
-#include
-#include
-#include "CondCore/DBCommon/interface/DbSession.h"
-//
-// Package: DBCommon
-// Class : SequenceManager
-//
-/**\class SequenceManager SequenceManager.h CondCore/DBCommon/interface/SequenceManager.h
- Description: utility class. Handle sequences. Universal to all DB backend.
-*/
-//
-// Author: Zhen Xie
-//
-namespace coral{
- class ISchema;
- class AttributeList;
-}
-namespace cond {
- class CoralTransaction;
- class SequenceManager {
- public:
- /// Constructor
- SequenceManager(cond::DbSession& coraldb,
- const std::string& sequenceTableName);
-
- /// Destructor
- ~SequenceManager();
-
- /// Increments and returns a new valid oid for a table
- unsigned long long incrementId( const std::string& reftableName );
-
- /// Updates the last used id
- void updateId( const std::string& reftableName,
- unsigned long long lastId );
-
- /// Clears the internal state
- void clear();
-
- /// Whether sequence table exists
- bool existSequencesTable();
-
- /// Creates the table holding the sequences
- void createSequencesTable();
-
- private:
-
- /// Locks the id entry in the ref table and returns the lastId value
- bool lockEntry( coral::ISchema& schema,
- const std::string& reftableName,
- unsigned long long& lastId );
- void init();
- private:
- /// The coraldb in use
- cond::DbSession m_coraldb;
-
- /// Sequence table name
- std::string m_sequenceTableName;
-
- /// Map of ids used.
- std::map< std::string, unsigned long long > m_tableToId;
-
- /// Flag indicating whether the sequence table exists
- bool m_sequenceTableExists;
-
- /// The where clause pinning a sequence entry
- std::string m_whereClause;
-
- /// The data for the where clause
- coral::AttributeList* m_whereData;
-
- /// The set clause for updating a sequence entry
- std::string m_setClause;
- bool m_started;
- };
-}//ns cond
-#endif
diff --git a/CondCore/DBCommon/interface/SharedLibraryName.h b/CondCore/DBCommon/interface/SharedLibraryName.h
deleted file mode 100644
index e69de29bb2d1d..0000000000000
diff --git a/CondCore/DBCommon/interface/TagInfo.h b/CondCore/DBCommon/interface/TagInfo.h
deleted file mode 100644
index 2568915a33c0b..0000000000000
--- a/CondCore/DBCommon/interface/TagInfo.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifndef CondCore_DBCommon_TagInfo_H
-#define CondCore_DBCommon_TagInfo_H
-#endif
diff --git a/CondCore/DBCommon/interface/TagMetadata.h b/CondCore/DBCommon/interface/TagMetadata.h
deleted file mode 100644
index 2cdf02f3dc5fe..0000000000000
--- a/CondCore/DBCommon/interface/TagMetadata.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef DBCommon_TagMetadata_h
-#define DBCommon_TagMetadata_h
-#include
-#include
-namespace cond{
- class TagMetadata{
- public:
- std::string tag;
- std::string pfn;
- std::string recordname;
- std::string labelname;
- std::string objectname;
- std::size_t hashvalue()const{
- boost::hash hasher;
- std::size_t result=hasher(tag+pfn);
- return result;
- }
- bool operator<(const TagMetadata& toCompare ) const {
- return this->hashvalue()
-namespace cond{
- class DbSession;
- class TechnologyProxy{
- public:
- explicit TechnologyProxy( ){}
- virtual ~TechnologyProxy(){}
- virtual void initialize( const DbConnection& connection )=0;
- virtual std::string getRealConnectString( const std::string&userconnect ) const=0;
- virtual std::string getRealConnectString( const std::string&userconnect, const std::string& transactionId ) const=0;
- virtual bool isTransactional() const=0;
- private:
- TechnologyProxy( const TechnologyProxy& );
- const TechnologyProxy& operator=(const TechnologyProxy&);
- };
-}//ns cond
-#endif
diff --git a/CondCore/DBCommon/interface/TechnologyProxyFactory.h b/CondCore/DBCommon/interface/TechnologyProxyFactory.h
deleted file mode 100644
index 9ee524f5cb1fa..0000000000000
--- a/CondCore/DBCommon/interface/TechnologyProxyFactory.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef CondCore_DBCommon_TechnologyProxyFactory_h
-#define CondCore_DBCommon_TechnologyProxyFactory_h
-#include "FWCore/PluginManager/interface/PluginFactory.h"
-#include "CondCore/DBCommon/interface/TechnologyProxy.h"
-#include "CondCore/DBCommon/interface/Exception.h"
-
-#include
-#include
-namespace cond{
- typedef edmplugin::PluginFactory< cond::TechnologyProxy*() > TechnologyProxyFactory;
-}
-#endif
diff --git a/CondCore/DBCommon/interface/Time.h b/CondCore/DBCommon/interface/Time.h
deleted file mode 100644
index 00393549438d9..0000000000000
--- a/CondCore/DBCommon/interface/Time.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "CondFormats/Common/interface/Time.h"
diff --git a/CondCore/DBCommon/interface/UserLogInfo.h b/CondCore/DBCommon/interface/UserLogInfo.h
deleted file mode 100644
index e69de29bb2d1d..0000000000000
diff --git a/CondCore/DBCommon/plugins/BlobStreamingService.cc b/CondCore/DBCommon/plugins/BlobStreamingService.cc
deleted file mode 100644
index 40c337272d607..0000000000000
--- a/CondCore/DBCommon/plugins/BlobStreamingService.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-#include "CondCore/DBCommon/interface/BlobStreamerPluginFactory.h"
-#include "CondCore/DBCommon/interface/Exception.h"
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-
-#include "CondCore/ORA/interface/IBlobStreamingService.h"
-
-#include "TBufferBlobStreamingService.h"
-
-
-//
-#include
-//
-#include "CoralBase/Blob.h"
-//
-#include
-#include
-#include
-#include
-#include
-
-// Function for testing BlobStreamingService
-namespace test {
- namespace BlobStreaming {
- int test();
- }
-}
-
-namespace cond {
-
- class BlobStreamingService : virtual public ora::IBlobStreamingService {
- friend int test::BlobStreaming::test();
-
- public:
-
-
- BlobStreamingService();
-
- virtual ~BlobStreamingService();
-
- boost::shared_ptr write( const void* addressOfInputData, edm::TypeWithDict const & classDictionary, bool useCompression=true ) override;
-
- void read( const coral::Blob& blobData, void* addressOfContainer, edm::TypeWithDict const & classDictionary ) override;
-
-
- private:
-
- typedef std::pair uuid;
-
- static const size_t m_idsize=sizeof(uuid);
- static const size_t m_offset = m_idsize + sizeof(unsigned long long);
- static const size_t nVariants=3;
-
- enum Variant { OLD, COMPRESSED_TBUFFER, COMPRESSED_CHARS };
- static uuid const variantIds[nVariants];
-
-
- static Variant findVariant(const void* address);
- static int isVectorChar(edm::TypeWithDict const & classDictionary);
-
-
- static boost::shared_ptr compress(const void* addr, size_t isize);
- static boost::shared_ptr expand(const coral::Blob& blobIn);
-
-
- boost::shared_ptr rootService;
-
- };
-
-
- BlobStreamingService::BlobStreamingService() : rootService(new cond::TBufferBlobStreamingService()){}
-
- BlobStreamingService::~BlobStreamingService(){}
-
- boost::shared_ptr BlobStreamingService::write( const void* addressOfInputData, edm::TypeWithDict const & classDictionary, bool useCompression ) {
- boost::shared_ptr blobOut;
- int const k = isVectorChar(classDictionary);
- switch (k) {
- case 0 :
- {
- // at the moment we write TBuffer compressed, than we see....
- // we may wish to avoid one buffer copy...
- boost::shared_ptr buffer = rootService->write(addressOfInputData, classDictionary);
- if( useCompression ){
- blobOut = compress(buffer->startingAddress(),buffer->size());
- *reinterpret_cast(blobOut->startingAddress()) = variantIds[COMPRESSED_TBUFFER];
- } else {
- blobOut = buffer;
- }
- }
- break;
- case 1 :
- {
- if( useCompression ){
- std::vector const & v = *reinterpret_cast< std::vector const *> (addressOfInputData);
- blobOut = compress(&v.front(),v.size());
- *reinterpret_cast(blobOut->startingAddress()) = variantIds[COMPRESSED_CHARS];
- } else {
- blobOut = rootService->write(addressOfInputData,classDictionary);
- }
- }
- break;
- case 2 :
- {
- if( useCompression ){
- std::vector const & v = *reinterpret_cast const *> (addressOfInputData);
- blobOut = compress(&v.front(),v.size());
- *reinterpret_cast(blobOut->startingAddress()) = variantIds[COMPRESSED_CHARS];
- } else {
- blobOut = rootService->write(addressOfInputData,classDictionary);
- }
- }
- break;
-
- }
- return blobOut;
-
- }
-
-
- void BlobStreamingService::read( const coral::Blob& blobData, void* addressOfContainer, edm::TypeWithDict const & classDictionary ) {
- // protect against small blobs...
- Variant v = (size_t(blobData.size()) < m_offset) ? OLD : findVariant(blobData.startingAddress());
- switch (v) {
- case OLD :
- {
- rootService->read( blobData, addressOfContainer, classDictionary);
- }
- break;
- case COMPRESSED_TBUFFER :
- {
- boost::shared_ptr blobIn = expand(blobData);
- rootService->read( *blobIn, addressOfContainer, classDictionary);
- }
- break;
- case COMPRESSED_CHARS :
- {
- boost::shared_ptr blobIn = expand(blobData);
- int const k = isVectorChar(classDictionary);
- switch (k) {
- case 0 :
- {
- // error!!!
- }
- break;
- case 1:
- {
- std::vector & v = *reinterpret_cast< std::vector *> (addressOfContainer);
- // we should avoid the copy!
- v.resize(blobIn->size());
- std::memcpy(&v.front(),blobIn->startingAddress(),v.size());
- }
- break;
- case 2:
- {
- std::vector & v = *reinterpret_cast< std::vector *> (addressOfContainer);
- // we should avoid the copy!
- v.resize(blobIn->size());
- std::memcpy(&v.front(),blobIn->startingAddress(),v.size());
- }
- break;
- }
- }
- }
- }
-
-
-
-
- const BlobStreamingService::uuid BlobStreamingService::variantIds[nVariants] = {
- BlobStreamingService::uuid(0,0)
- ,BlobStreamingService::uuid(0xf4e92f169c974e8eLL, 0x97851f372586010dLL)
- ,BlobStreamingService::uuid(0xc9a95a45e60243cfLL, 0x8dc549534f9a9274LL)
- };
-
-
- int BlobStreamingService::isVectorChar(edm::TypeWithDict const& classDictionary) {
- if (classDictionary == typeid(std::vector)) return 1;
- if (classDictionary == typeid(std::vector)) return 2;
- return 0;
- }
-
-
-
- BlobStreamingService::Variant BlobStreamingService::findVariant(const void* address) {
- uuid const & id = *reinterpret_cast(address);
- uuid const * v = std::find(variantIds,variantIds+nVariants,id);
- return (v==variantIds+nVariants) ? OLD : (Variant)(v-variantIds);
- }
-
-
- boost::shared_ptr BlobStreamingService::compress(const void* addr, size_t isize) {
- uLongf destLen = compressBound(isize);
- size_t usize = destLen + m_offset;
- boost::shared_ptr theBlob( new coral::Blob(usize));
- void * startingAddress = (unsigned char*)(theBlob->startingAddress())+ m_offset;
- int zerr = compress2( (unsigned char*)(startingAddress), &destLen,
- (unsigned char*)(addr), isize,
- 9);
- if (zerr!=0) edm::LogError("BlobStreamingService")<< "Compression error " << zerr;
- destLen+= m_idsize + sizeof(unsigned long long);
- theBlob->resize(destLen);
-
- startingAddress = (unsigned char*)(theBlob->startingAddress())+ m_idsize;
- // write expanded size;
- *reinterpret_cast(startingAddress)=isize;
- return theBlob;
- }
-
- boost::shared_ptr BlobStreamingService::expand(const coral::Blob& blobIn) {
- if (size_t(blobIn.size()) < m_offset) return boost::shared_ptr(new coral::Blob());
- long long csize = blobIn.size() - m_offset;
- unsigned char const * startingAddress = (unsigned char const*)(blobIn.startingAddress())+ m_idsize;
- unsigned long long usize = *reinterpret_cast(startingAddress);
- startingAddress += sizeof(unsigned long long);
- boost::shared_ptr theBlob( new coral::Blob(usize));
- uLongf destLen = usize;
- int zerr = uncompress((unsigned char *)(theBlob->startingAddress()), &destLen,
- startingAddress, csize);
- if (zerr!=0 || usize!=destLen)
- edm::LogError("BlobStreamingService")<< "uncompressing error " << zerr
- << " original size was " << usize
- << " new size is " << destLen;
-
- return theBlob;
- }
-
-}
-
-// keep the old good name
-DEFINE_EDM_PLUGIN(cond::BlobStreamerPluginFactory,cond::BlobStreamingService,"COND/Services/BlobStreamingService");
diff --git a/CondCore/DBCommon/plugins/BuildFile.xml b/CondCore/DBCommon/plugins/BuildFile.xml
deleted file mode 100644
index 126e691392b4a..0000000000000
--- a/CondCore/DBCommon/plugins/BuildFile.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-