Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup of dependencies from CondDBv1 code by moving to CondDBv2, and new interface for logging and FronTier security #13012

Merged
merged 13 commits into from Jan 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions Alignment/CocoaApplication/BuildFile.xml
@@ -1,8 +1,6 @@
<use name="clhep"/>
<use name="root"/>
<use name="DetectorDescription/Core"/>
<use name="CondCore/IOVService"/>
<use name="CondCore/MetaDataService"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="Geometry/Records"/>
Expand All @@ -14,6 +12,5 @@
<use name="Alignment/CocoaFit"/>
<use name="meschach"/>
<use name="Alignment/CocoaDaq"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/DBOutputService"/>
<flags EDM_PLUGIN="1"/>
1 change: 0 additions & 1 deletion 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"
Expand Down
1 change: 0 additions & 1 deletion Alignment/CocoaFit/BuildFile.xml
Expand Up @@ -10,7 +10,6 @@
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/Alignment"/>
<use name="CondFormats/AlignmentRecord"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/DBOutputService"/>
<export>
<lib name="1"/>
Expand Down
1 change: 0 additions & 1 deletion Alignment/CocoaFit/src/CocoaDBMgr.cc
Expand Up @@ -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"
Expand Down
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion Alignment/MuonAlignment/BuildFile.xml
Expand Up @@ -12,7 +12,6 @@
<use name="DataFormats/DetId"/>
<use name="FWCore/Framework"/>
<use name="FWCore/Concurrency"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/Alignment"/>
<use name="DataFormats/MuonDetId"/>
Expand Down
1 change: 0 additions & 1 deletion CalibCalorimetry/CaloMiscalibTools/BuildFile.xml
Expand Up @@ -11,7 +11,6 @@
<use name="DataFormats/EcalRecHit"/>
<use name="DataFormats/HcalRecHit"/>
<use name="Geometry/CaloTopology"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/DBOutputService"/>
<use name="xerces-c"/>
<export>
Expand Down
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion CalibCalorimetry/EcalTPGTools/BuildFile.xml
Expand Up @@ -5,7 +5,6 @@
<use name="SimCalorimetry/EcalSimAlgos"/>
<use name="FWCore/Framework"/>
<use name="FWCore/Utilities"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/DBOutputService"/>
<export>
<lib name="1"/>
Expand Down
2 changes: 1 addition & 1 deletion CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.h
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion CalibMuon/CSCCalibration/test/BuildFile.xml
Expand Up @@ -2,7 +2,6 @@
<use name="CondFormats/DataRecord"/>
<use name="CondCore/PopCon"/>
<use name="CondFormats/CSCObjects"/>
<use name="CondCore/DBCommon"/>
<library name="CSCCrosstalkPopConAnalyzer" file="stubs/CSCCrosstalkHandler.cc,stubs/CSCCrosstalkPopConAnalyzer.cc">
<flags EDM_PLUGIN="1"/>
</library>
Expand Down
3 changes: 0 additions & 3 deletions CalibTracker/SiPixelConnectivity/BuildFile.xml
Expand Up @@ -7,9 +7,6 @@
<use name="CondFormats/DataRecord"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="Geometry/CommonDetUnit"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/IOVService"/>
<use name="CondCore/MetaDataService"/>
<use name="boost"/>
<export>
<lib name="1"/>
Expand Down
1 change: 0 additions & 1 deletion CalibTracker/SiStripDCS/BuildFile.xml
Expand Up @@ -13,7 +13,6 @@
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="CondCore/DBOutputService"/>
<use name="DataFormats/SiStripDetId"/>
<use name="CondCore/DBCommon"/>
<use name="CoralCommon"/>
<use name="CondCore/PopCon"/>
<use name="OnlineDB/SiStripConfigDb"/>
Expand Down
13 changes: 5 additions & 8 deletions 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 <iterator>
Expand Down Expand Up @@ -36,13 +34,12 @@ class SiStripCoralIface

/* member variables*/
std::string m_connectionString;
std::string m_authPath;
std::map<std::string,unsigned int> m_id_map;
// cond::DBSession* session;
cond::DbConnection m_connection;
cond::DbSession m_session;
cond::persistency::Session m_session;
std::auto_ptr<cond::persistency::TransactionScope> m_transaction;
// cond::CoralTransaction* m_coraldb;
// cond::Connection* con;
std::auto_ptr<cond::DbScopedTransaction> m_transaction;

bool debug_;
};
Expand Down
2 changes: 0 additions & 2 deletions CalibTracker/SiStripDCS/interface/SiStripDetVOffHandler.h
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion CalibTracker/SiStripDCS/plugins/BuildFile.xml
Expand Up @@ -4,7 +4,6 @@
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="CondCore/PopCon"/>
<use name="CondCore/DBCommon"/>
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/SiStripObjects"/>
Expand Down
20 changes: 10 additions & 10 deletions 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"
Expand All @@ -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();
}

Expand All @@ -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";
}
Expand All @@ -51,7 +51,7 @@ void SiStripCoralIface::initialize() {
void SiStripCoralIface::doQuery(std::string queryType, const coral::TimeStamp& startTime, const coral::TimeStamp& endTime, std::vector<coral::TimeStamp> &vec_changedate,
std::vector<float> &vec_actualValue, std::vector<std::string> &vec_dpname)
{
std::auto_ptr<coral::IQuery> query( m_session.schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
std::auto_ptr<coral::IQuery> 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;
Expand Down Expand Up @@ -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<coral::TimeStamp> &vec_changedate,
std::vector<float> &vec_settings, std::vector<std::string> &vec_dpname, std::vector<uint32_t> &vec_dpid)
{
std::auto_ptr<coral::IQuery> query( m_session.schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
std::auto_ptr<coral::IQuery> 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");
Expand Down Expand Up @@ -157,7 +157,7 @@ void SiStripCoralIface::doSettingsQuery(const coral::TimeStamp& startTime, const

void SiStripCoralIface::doNameQuery(std::vector<std::string> &vec_dpname, std::vector<uint32_t> &vec_dpid)
{
std::auto_ptr<coral::IQuery> query( m_session.schema(std::string("CMS_TRK_DCS_PVSS_COND")).newQuery());
std::auto_ptr<coral::IQuery> 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");
Expand Down
1 change: 0 additions & 1 deletion CalibTracker/SiStripESProducers/plugins/BuildFile.xml
@@ -1,7 +1,6 @@
<library file="fake/*.cc" name="CalibTrackerSiStripFakeESProducersPlugins">
<use name="CalibTracker/SiStripESProducers"/>
<use name="CondCore/DBOutputService"/>
<use name="CondCore/DBCommon"/>
<flags EDM_PLUGIN="1"/>
</library>
<library file="real/*.cc" name="CalibTrackerSiStripRealESProducersPlugins">
Expand Down
Expand Up @@ -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"

Expand Down
Expand Up @@ -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 <string>

Expand Down
Expand Up @@ -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"

Expand Down
Expand Up @@ -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"
Expand Down
Expand Up @@ -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"
Expand Down
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion CondCore/BeamSpotPlugins/BuildFile.xml
@@ -1,6 +1,5 @@
<use name="CondFormats/BeamSpotObjects"/>
<use name="CondFormats/DataRecord"/>
<use name="CondCore/DBCommon"/>
<use name="FWCore/PluginManager"/>
<use name="CondCore/ESSources"/>
<flags EDM_PLUGIN="1"/>
1 change: 0 additions & 1 deletion CondCore/CondDB/BuildFile.xml
@@ -1,4 +1,3 @@
<use name="CondCore/DBCommon"/>
<use name="CondFormats/Serialization"/>
<use name="CondFormats/Common"/>
<use name="FWCore/Framework"/>
Expand Down
32 changes: 32 additions & 0 deletions CondCore/CondDB/interface/Auth.h
@@ -0,0 +1,32 @@
#ifndef CondCore_CondDB_Auth_h
#define CondCore_CondDB_Auth_h

#include <string>

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

41 changes: 41 additions & 0 deletions CondCore/CondDB/interface/Cipher.h
@@ -0,0 +1,41 @@
#ifndef CondCore_CondDB_Cipher_h
#define CondCore_CondDB_Cipher_h

#include <iostream>
#include <string>

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