CMS 3D CMS Logo

Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
cond Namespace Reference

Namespaces

 auth
 
 hdf5
 
 impl
 
 lhcInfoHelper
 
 payloadInspector
 
 persistency
 
 RelationalAuthenticationService
 
 serialization
 
 service
 
 theLHCInfoPerFillPopConImpl
 
 time
 
 XMLAuthenticationService
 

Classes

struct  AuthorizationData
 
class  BaseKeyed
 
class  BasicPayload
 
class  Binary
 
class  BTransitionAnalyzer
 
class  CoralServiceFactory
 
class  CoralServiceManager
 
struct  CoralServiceWrapper
 
struct  CoralServiceWrapperBase
 
struct  CredentialData
 
class  CredentialStore
 
class  CSScopedSession
 
struct  DefaultInitializer
 
class  EmptyIOVSource
 
class  FileBasedEmptySource
 
class  FileReader
 
class  GenericSummary
 
class  GTEntry_t
 
struct  GTMetadata_t
 
struct  Iov_t
 
class  IOVDescription
 
class  IOVKeysDescription
 
class  IOVProvenance
 
class  IOVUserMetaData
 
class  KeyedElement
 
struct  LessFrame
 
struct  LogDBEntry_t
 
class  OMSService
 
class  OMSServiceQuery
 
class  OMSServiceResult
 
class  OMSServiceResultIterator
 
class  OMSServiceResultRef
 
struct  PrincipalData
 
class  ProductResolver
 
class  ProductResolverWrapperBase
 
struct  RealTimeType
 
struct  RealTimeType< hash >
 
struct  RealTimeType< lumiid >
 
struct  RealTimeType< runnumber >
 
struct  RealTimeType< timestamp >
 
struct  RealTimeType< userid >
 
struct  RunInfo_t
 
class  SmallWORMDict
 
class  StreamerInfo
 
class  Summary
 
struct  Tag_t
 
struct  TagInfo_t
 
struct  TagMetadata_t
 
struct  TimeTypeSpecs
 
struct  TimeTypeTraits
 
class  UnregisteredRecordException
 
struct  UserLogInfo
 
class  Utilities
 
class  UtilitiesError
 

Typedefs

typedef cond::serialization::InputArchive CondInputArchive
 
typedef cond::serialization::OutputArchive CondOutputArchive
 
typedef edmplugin::PluginFactory< cond::CoralServiceWrapperBase *()> CoralServicePluginFactory
 
typedef persistency::Exception Exception
 
typedef std::string Hash
 
typedef edmplugin::PluginFactory< cond::ProductResolverWrapperBase *()> ProductResolverFactory
 
typedef unsigned long long Time_t
 
typedef unsigned long long uint64_t
 
typedef std::pair< unsigned int, unsigned int > UnpackedTime
 
typedef std::pair< Time_t, Time_tValidityInterval
 

Enumerations

enum  SynchronizationType {
  SYNCH_ANY = 0, SYNCH_VALIDATION, SYNCH_OFFLINE, SYNCH_MC,
  SYNCH_RUNMC, SYNCH_HLT, SYNCH_EXPRESS, SYNCH_PROMPT,
  SYNCH_PCL
}
 
enum  TimeType {
  invalid = -1, runnumber = 0, timestamp, lumiid,
  hash, userid
}
 

Functions

std::string boost_version_label ()
 
template<typename T >
TcreatePayload (const std::string &payloadTypeName)
 
template<>
HcalCalibrationQIEDatacreatePayload< HcalCalibrationQIEData > (const std::string &payloadTypeName)
 
template<>
std::string * createPayload< std::string > (const std::string &payloadTypeName)
 
template<typename T >
std::unique_ptr< Tdefault_deserialize (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<typename T >
std::unique_ptr< Tdeserialize (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::unique_ptr< BaseKeyeddeserialize< BaseKeyed > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::unique_ptr< condex::Efficiencydeserialize< condex::Efficiency > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::unique_ptr< CSCReadoutMappingdeserialize< CSCReadoutMapping > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::unique_ptr< CSCReadoutMappingForSliceTestdeserialize< CSCReadoutMappingForSliceTest > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::unique_ptr< PerformancePayloaddeserialize< PerformancePayload > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
LHCInfo::FillType fillTypeFromString (const std::string &s_fill_type)
 
const TimeTypeSpecsfindSpecs (std::string const &name)
 
size_t getAuthorizationEntries (const std::string &schemaVersion, coral::ISchema &schema, int principalId, const std::string &role, const std::string &connectionString)
 
static size_t getBodyCallback (void *contents, size_t size, size_t nmemb, void *ptr)
 
int getch ()
 
std::tuple< std::string, std::string, std::string > getDbCredentials (const std::string &connectionString, int accessType, const std::string &authPath)
 
cond::Time_t getLastLumiFromOMS (const std::string &omsServiceUrl)
 
cond::Time_t getLatestLumiFromFile (const std::string &fileName)
 
std::string getLoginName ()
 
bool getNextSequenceValue (const std::string &schemaVersion, coral::ISchema &schema, const std::string &sequenceName, int &value)
 
std::string getpass (const std::string &prompt, bool show_asterisk=true)
 
std::string getpassForUser (const std::string &userName)
 
unsigned long long hash64 (unsigned char *k, unsigned long long length, unsigned long long level)
 
unsigned long httpGet (const std::string &urlString, std::string &info)
 
const Time_t invalidTime (0)
 
Iov_t makeIov (cond::Time_t since, const Hash &payloadId)
 
void parseLineForNamedParams (const std::string &line, std::map< std::string, std::string > &params)
 
LHCInfo::ParticleType particleTypeFromString (const std::string &s_particle_type)
 
const char * pluginCategory ()
 
char randomChar ()
 
std::string schemaLabel (const std::string &serviceName, const std::string &userName)
 
std::string schemaLabelForCredentialStore (const std::string &connectionString)
 
bool selectAuthorization (const std::string &schemaVersion, coral::ISchema &schema, int principalId, const std::string &role, const std::string &connectionString, AuthorizationData &destination)
 
bool selectConnection (const std::string &schemaVersion, coral::ISchema &schema, const std::string &connectionLabel, CredentialData &destination)
 
bool selectPrincipal (const std::string &schemaVersion, coral::ISchema &schema, const std::string &principal, PrincipalData &destination)
 
template<typename T >
std::pair< Binary, Binaryserialize (const T &payload)
 
bool setPermissionData (const std::string &schemaVersion, coral::ISchema &schema, int principalId, const std::string &principalKey, const std::string &role, const std::string &connectionString, int connectionId, const std::string &connectionKey, std::stringstream &log)
 
SynchronizationType synchronizationTypeFromName (const std::string &name)
 
std::string synchronizationTypeNames (SynchronizationType type)
 
void throwException (const std::string &message, const std::string &methodName)
 
const Time_t TIMELIMIT (std::numeric_limits< Time_t >::max())
 
std::string const & timeTypeNames (int)
 
std::pair< int, std::string > updateConnectionData (const std::string &schemaVersion, coral::ISchema &schema, const std::string &adminKey, const std::string &connectionLabel, const std::string &userName, const std::string &password, bool forceUpdate, std::stringstream &log)
 
std::pair< int, std::string > updatePrincipalData (const std::string &schemaVersion, coral::ISchema &schema, const std::string &authenticationKey, const std::string &principalName, const std::string &adminKey, bool init, std::stringstream &log)
 

Variables

static constexpr unsigned int HASH_SIZE = 40
 
static const std::pair< const char *, LHCInfo::FillTypes_fillTypeMap []
 
static std::pair< const char *, SynchronizationTypes_obsoleteSynchronizationTypeArray []
 
static const std::pair< const char *, LHCInfo::ParticleTypes_particleTypeMap []
 
static std::pair< const char *, SynchronizationTypes_synchronizationTypeArray []
 
const unsigned int TIMETYPE_LIST_MAX = 5
 
const cond::TimeType timeTypeList [TIMETYPE_LIST_MAX] = {runnumber, timestamp, lumiid, hash, userid}
 
const TimeTypeSpecs timeTypeSpecs []
 
const cond::TimeType timeTypeValues [] = {runnumber, timestamp, lumiid, hash, userid}
 

Detailed Description

The wrapper is used to allow edm::PluginFactory to change its return type to unique_ptr from a raw pointer. The unique_ptr does not work for coral::Service, because its destructor is protected and ownership is managed by intrusive reference counting.

Serialization.h CondCore/CondDB/interface/Serialization.h Description: functions for serializing the payload objects.

Typedef Documentation

◆ CondInputArchive

Definition at line 61 of file Serialization.h.

◆ CondOutputArchive

Definition at line 62 of file Serialization.h.

◆ CoralServicePluginFactory

Definition at line 25 of file CoralServiceFactory.h.

◆ Exception

Definition at line 25 of file Exception.h.

◆ Hash

typedef std::string cond::Hash

Definition at line 43 of file Types.h.

◆ ProductResolverFactory

Definition at line 29 of file ProductResolverFactory.h.

◆ Time_t

typedef unsigned long long cond::Time_t

Definition at line 14 of file Time.h.

◆ uint64_t

typedef unsigned long long cond::uint64_t

Definition at line 13 of file Time.h.

◆ UnpackedTime

typedef std::pair<unsigned int, unsigned int> cond::UnpackedTime

Definition at line 15 of file Time.h.

◆ ValidityInterval

typedef std::pair<Time_t, Time_t> cond::ValidityInterval

Definition at line 17 of file Time.h.

Enumeration Type Documentation

◆ SynchronizationType

Enumerator
SYNCH_ANY 
SYNCH_VALIDATION 
SYNCH_OFFLINE 
SYNCH_MC 
SYNCH_RUNMC 
SYNCH_HLT 
SYNCH_EXPRESS 
SYNCH_PROMPT 
SYNCH_PCL 

Definition at line 27 of file Types.h.

◆ TimeType

Enumerator
invalid 
runnumber 
timestamp 
lumiid 
hash 
userid 

Definition at line 19 of file Time.h.

Function Documentation

◆ boost_version_label()

std::string cond::boost_version_label ( )
inline

Definition at line 24 of file Payload2XMLModule.h.

References contentValuesCheck::ss.

Referenced by PYBIND11_MODULE().

24  {
25  std::stringstream ss;
26  ss << BOOST_VERSION / 100000 << ".";
27  ss << BOOST_VERSION / 100 % 1000 << ".";
28  ss << BOOST_VERSION % 100;
29  return ss.str();
30  }

◆ createPayload()

template<typename T >
T* cond::createPayload ( const std::string &  payloadTypeName)

Definition at line 31 of file Serialization.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

31  {
32  std::string userTypeName = demangledName(typeid(T));
33  if (userTypeName != payloadTypeName)
35  std::string("Type mismatch, user type: \"" + userTypeName + "\", target type: \"") + payloadTypeName + "\"",
36  "createPayload");
37  return new T;
38  }
long double T
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ createPayload< HcalCalibrationQIEData >()

template<>
HcalCalibrationQIEData* cond::createPayload< HcalCalibrationQIEData > ( const std::string &  payloadTypeName)

Definition at line 37 of file plugin.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

37  {
38  if (payloadTypeName == "HcalCalibrationQIEData")
39  return new HcalCalibrationQIEData(nullptr);
40  throwException(std::string("Type mismatch, target object is type \"") + payloadTypeName + "\"", "createPayload");
41  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ createPayload< std::string >()

template<>
std::string* cond::createPayload< std::string > ( const std::string &  payloadTypeName)
inline

Definition at line 41 of file Serialization.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

41  {
42  std::string userTypeName = demangledName(typeid(std::string));
43  if (payloadTypeName != userTypeName && payloadTypeName != "std::string")
44  throwException(std::string("Type mismatch, user type: \"std::string\", target type: \"") + payloadTypeName + "\"",
45  "createPayload");
46  return new std::string;
47  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ default_deserialize()

template<typename T >
std::unique_ptr<T> cond::default_deserialize ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 86 of file Serialization.h.

References cond::Binary::data(), MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, jetsAK4_Puppi_cff::payload, HLT_2024v13_cff::payloadType, cond::Binary::size(), AlCaHLTBitMon_QueryRunRegistry::string, cond::StreamerInfo::techVersion(), and throwException().

88  {
89  std::unique_ptr<T> payload;
90  std::stringbuf sstreamerInfoBuf;
91  sstreamerInfoBuf.pubsetbuf(static_cast<char*>(const_cast<void*>(streamerInfoData.data())), streamerInfoData.size());
92  std::string streamerInfo = sstreamerInfoBuf.str();
93  try {
94  std::stringbuf sdataBuf;
95  sdataBuf.pubsetbuf(static_cast<char*>(const_cast<void*>(payloadData.data())), payloadData.size());
96  std::istream dataBuffer(&sdataBuf);
97  CondInputArchive ia(dataBuffer);
98  payload.reset(createPayload<T>(payloadType));
99  ia >> (*payload);
100  } catch (const std::exception& e) {
101  std::string errorMsg("De-serialization failed: ");
102  std::string em(e.what());
103  if (em == "unsupported version") {
104  errorMsg += "the current boost version (" + StreamerInfo::techVersion() +
105  ") is unable to read the payload. Data might have been serialized with an incompatible version.";
106  } else if (em == "input stream error") {
107  errorMsg += "data size does not fit with the current class layout. The Class " + payloadType +
108  " might have been changed with respect to the layout used in the upload.";
109  } else {
110  errorMsg += em;
111  }
112  if (!streamerInfo.empty())
113  errorMsg += " Payload serialization info: " + streamerInfo;
114  throwException(errorMsg, "default_deserialize");
115  }
116  return payload;
117  }
cond::serialization::InputArchive CondInputArchive
Definition: Serialization.h:61
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ deserialize()

template<typename T >
std::unique_ptr<T> cond::deserialize ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 121 of file Serialization.h.

References HLT_2024v13_cff::payloadType.

123  {
124  return default_deserialize<T>(payloadType, payloadData, streamerInfoData);
125  }

◆ deserialize< BaseKeyed >()

template<>
std::unique_ptr<BaseKeyed> cond::deserialize< BaseKeyed > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 22 of file plugin.cc.

References DESERIALIZE_BASE_CASE, DESERIALIZE_POLIMORPHIC_CASE, HLT_2024v13_cff::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

24  {
25  DESERIALIZE_BASE_CASE(BaseKeyed);
28 
29  // here we come if none of the deserializations above match the payload type:
30  throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "deserialize<>");
31  }
#define DESERIALIZE_BASE_CASE(BASETYPENAME)
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ deserialize< condex::Efficiency >()

template<>
std::unique_ptr<condex::Efficiency> cond::deserialize< condex::Efficiency > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 23 of file plugin.cc.

References DESERIALIZE_POLIMORPHIC_CASE, HLT_2024v13_cff::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

25  {
26  // DESERIALIZE_BASE_CASE( condex::Efficiency ); abstract
29 
30  // here we come if none of the deserializations above match the payload type:
31  throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "deserialize<>");
32  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ deserialize< CSCReadoutMapping >()

template<>
std::unique_ptr<CSCReadoutMapping> cond::deserialize< CSCReadoutMapping > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 65 of file plugin.cc.

References DESERIALIZE_POLIMORPHIC_CASE, HLT_2024v13_cff::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

67  {
68  // DESERIALIZE_BASE_CASE( CSCReadoutMapping ); abstract
70  // here we come if none of the deserializations above match the payload type:
71  throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "deserialize<>");
72  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ deserialize< CSCReadoutMappingForSliceTest >()

template<>
std::unique_ptr<CSCReadoutMappingForSliceTest> cond::deserialize< CSCReadoutMappingForSliceTest > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 74 of file plugin.cc.

References DESERIALIZE_POLIMORPHIC_CASE, HLT_2024v13_cff::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

75  {
76  // DESERIALIZE_BASE_CASE( CSCReadoutMappingForSliceTest ); abstract
78  // here we come if none of the deserializations above match the payload type:
79  throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "deserialize<>");
80  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ deserialize< PerformancePayload >()

template<>
std::unique_ptr<PerformancePayload> cond::deserialize< PerformancePayload > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 18 of file PerformanceRecordPlugin.cc.

References DESERIALIZE_POLIMORPHIC_CASE, HLT_2024v13_cff::payloadType, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

20  {
21  // DESERIALIZE_BASE_CASE( PerformancePayload ); abstract
25  // here we come if none of the deserializations above match the payload type:
26  throwException(std::string("Type mismatch, target object is type \"") + payloadType + "\"", "createPayload");
27  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ fillTypeFromString()

LHCInfo::FillType cond::fillTypeFromString ( const std::string &  s_fill_type)

Definition at line 36 of file LHCInfoPopConSourceHandler.cc.

References mps_fire::i, s_fillTypeMap, and LHCInfo::UNKNOWN.

36  {
37  for (auto const& i : s_fillTypeMap)
38  if (s_fill_type == i.first)
39  return i.second;
40  return LHCInfo::UNKNOWN;
41  }
static const std::pair< const char *, LHCInfo::FillType > s_fillTypeMap[]

◆ findSpecs()

const TimeTypeSpecs & cond::findSpecs ( std::string const &  name)

Definition at line 23 of file Time.cc.

References Exception, mps_fire::i, Skims_PA_cff::name, TIMETYPE_LIST_MAX, and timeTypeSpecs.

Referenced by cond::time::timeTypeFromName().

23  {
24  size_t i = 0;
25  for (; i < TIMETYPE_LIST_MAX; i++)
26  if (name == timeTypeSpecs[i].name)
27  return timeTypeSpecs[i];
28  throw cms::Exception("invalid timetype: " + name);
29  return timeTypeSpecs[0]; // compiler happy
30  }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:16
const unsigned int TIMETYPE_LIST_MAX
Definition: Time.h:20

◆ getAuthorizationEntries()

size_t cond::getAuthorizationEntries ( const std::string &  schemaVersion,
coral::ISchema &  schema,
int  principalId,
const std::string &  role,
const std::string &  connectionString 
)

Definition at line 322 of file CredentialStore.cc.

References AUTH_ID_COL(), AUTHORIZATION_TABLE(), l1RCTOmdsFedVectorProducer_cfi::connectionString, P_ID_COL(), contentValuesFiles::query, ROLE_COL(), SCHEMA_COL(), AlCaHLTBitMon_QueryRunRegistry::string, and tname().

Referenced by cond::CredentialStore::unsetPermission().

326  {
327  std::unique_ptr<coral::IQuery> query(schema.tableHandle(tname(AUTHORIZATION_TABLE, schemaVersion)).newQuery());
328  coral::AttributeList readBuff;
329  readBuff.extend<int>(AUTH_ID_COL);
330  coral::AttributeList whereData;
331  whereData.extend<std::string>(SCHEMA_COL);
332  std::stringstream whereClause;
333  whereClause << SCHEMA_COL << " = :" << SCHEMA_COL;
334  if (principalId >= 0) {
335  whereData.extend<int>(P_ID_COL);
336  whereClause << "AND" << P_ID_COL << " = :" << P_ID_COL;
337  }
338  if (!role.empty()) {
339  whereData.extend<std::string>(ROLE_COL);
340  whereClause << " AND " << ROLE_COL << " = :" << ROLE_COL;
341  }
342  whereData[SCHEMA_COL].data<std::string>() = connectionString;
343  if (principalId >= 0)
344  whereData[P_ID_COL].data<int>() = principalId;
345  if (!role.empty())
346  whereData[ROLE_COL].data<std::string>() = role;
347  query->defineOutput(readBuff);
348  query->addToOutputList(AUTH_ID_COL);
349  query->setCondition(whereClause.str(), whereData);
350  coral::ICursor& cursor = query->execute();
351  size_t n_entries = 0;
352  while (cursor.next()) {
353  n_entries += 1;
354  }
355  return n_entries;
356  }
static const std::string ROLE_COL("C_ROLE")
static const std::string SCHEMA_COL("C_SCHEMA")
Definition: query.py:1
static const std::string AUTH_ID_COL("AUTH_ID")
static const std::string AUTHORIZATION_TABLE("AUTHORIZATION")
std::string tname(const std::string &tableName, const std::string &schemaVersion)
static const std::string P_ID_COL("P_ID")

◆ getBodyCallback()

static size_t cond::getBodyCallback ( void *  contents,
size_t  size,
size_t  nmemb,
void *  ptr 
)
static

Definition at line 10 of file WebUtils.cc.

References relmon_rootfiles_spy::contents, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by httpGet().

10  {
11  // Cast ptr to std::string pointer and append contents to that string
12  ((std::string*)ptr)->append((char*)contents, size * nmemb);
13  return size * nmemb;
14  }
size
Write out results.

◆ getch()

int cond::getch ( )

Definition at line 19 of file Utilities.cc.

Referenced by getpass().

19  {
20  int ch;
21  struct termios t_old, t_new;
22 
23  tcgetattr(STDIN_FILENO, &t_old);
24  t_new = t_old;
25  t_new.c_lflag &= ~(ICANON | ECHO);
26  tcsetattr(STDIN_FILENO, TCSANOW, &t_new);
27 
28  ch = getchar();
29 
30  tcsetattr(STDIN_FILENO, TCSANOW, &t_old);
31  return ch;
32  }

◆ getDbCredentials()

std::tuple<std::string, std::string, std::string> cond::getDbCredentials ( const std::string &  connectionString,
int  accessType,
const std::string &  authPath 
)

Definition at line 8 of file CondDBPyBind11Wrappers.cc.

References lumi_dqm_sourceclient-live_cfg::authPath, cond::auth::COND_AUTH_PATH, l1RCTOmdsFedVectorProducer_cfi::connectionString, dqmdumpme::first, cond::CredentialStore::getUserCredentials(), cond::CredentialStore::keyPrincipalName(), runTheMatrix::ret, cond::auth::s_roleCodeArray, cond::CredentialStore::setUpForConnectionString(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by PYBIND11_MODULE().

10  {
11  std::string ap = authPath;
12  if (ap.empty()) {
13  ap = std::string(std::getenv(cond::auth::COND_AUTH_PATH));
14  }
15  auto ret = std::make_tuple(std::string(""), std::string(""), std::string(""));
16  if (!ap.empty()) {
17  CredentialStore credDb;
18  credDb.setUpForConnectionString(connectionString, ap);
20  auto creds = credDb.getUserCredentials(connectionString, role);
21  ret = std::tie(credDb.keyPrincipalName(), creds.first, creds.second);
22  }
23  return ret;
24  }
ret
prodAgent to be discontinued
static constexpr const char *const COND_AUTH_PATH
Definition: Auth.h:11
static const std::pair< const char *, RoleCode > s_roleCodeArray[]
Definition: Auth.h:28

◆ getLastLumiFromOMS()

cond::Time_t cond::getLastLumiFromOMS ( const std::string &  omsServiceUrl)

Definition at line 58 of file OnlineDBOutputService.cc.

References getInfoFromService(), info(), cond::time::lumiTime(), cond::time::MIN_VAL(), beam_dqm_sourceclient-live_cfg::omsServiceUrl, writedatasetfile::run, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::service::OnlineDBOutputService::getLastLumiProcessed().

58  {
59  cond::Time_t lastLumiProcessed = cond::time::MIN_VAL;
60  std::string info("");
62  throw Exception("Can't get data from OMS Service.");
63  std::istringstream sinfo(info);
64  std::string srun;
65  if (!std::getline(sinfo, srun, ',')) {
66  throw Exception("Can't get run runmber info from OMS Service.");
67  }
68  std::string slumi;
69  if (!std::getline(sinfo, slumi, ',')) {
70  throw Exception("Can't get lumi id from OMS Service.");
71  }
72  unsigned int run = std::stoul(srun);
73  unsigned int lumi = std::stoul(slumi);
74  lastLumiProcessed = cond::time::lumiTime(run, lumi);
75  return lastLumiProcessed;
76  }
static const TGPicture * info(bool iBackgroundIsBlack)
const Time_t MIN_VAL(0)
unsigned long long Time_t
Definition: Time.h:14
Time_t lumiTime(unsigned int run, unsigned int lumiId)
Definition: Time.cc:66
bool getInfoFromService(const std::string &urlString, std::string &info)

◆ getLatestLumiFromFile()

cond::Time_t cond::getLatestLumiFromFile ( const std::string &  fileName)

Definition at line 47 of file OnlineDBOutputService.cc.

References MillePedeFileConverter_cfg::fileName, beam_dqm_sourceclient-live_cfg::lastLumiFile, cond::time::MIN_VAL(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::service::OnlineDBOutputService::getLastLumiProcessed().

47  {
48  cond::Time_t lastLumiProcessed = cond::time::MIN_VAL;
49  std::ifstream lastLumiFile(fileName);
50  if (lastLumiFile) {
51  lastLumiFile >> lastLumiProcessed;
52  } else {
53  throw Exception(std::string("Can't access lastLumi file ") + fileName);
54  }
55  return lastLumiProcessed;
56  }
const Time_t MIN_VAL(0)
unsigned long long Time_t
Definition: Time.h:14

◆ getLoginName()

std::string cond::getLoginName ( )

Definition at line 42 of file DecodingKey.cc.

References mps_check::msg, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by cond::auth::DecodingKey::init().

42  {
43  std::string loginName("");
44  struct passwd* userp = ::getpwuid(::getuid());
45  if (userp) {
46  char* uName = userp->pw_name;
47  if (uName) {
48  loginName += uName;
49  }
50  }
51  if (loginName.empty()) {
52  std::string msg("Cannot determine login name.");
53  throwException(msg, "DecodingKey::getLoginName");
54  }
55  return loginName;
56  }
tuple msg
Definition: mps_check.py:286
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ getNextSequenceValue()

bool cond::getNextSequenceValue ( const std::string &  schemaVersion,
coral::ISchema &  schema,
const std::string &  sequenceName,
int &  value 
)

Definition at line 358 of file CredentialStore.cc.

References contentValuesFiles::query, runTheMatrix::ret, SEQUENCE_NAME_COL(), SEQUENCE_TABLE(), SEQUENCE_VALUE_COL(), TrackCollections2monitor_cff::sequenceName, AlCaHLTBitMon_QueryRunRegistry::string, and tname().

Referenced by setPermissionData(), updateConnectionData(), and updatePrincipalData().

361  {
362  bool ret = false;
363  std::unique_ptr<coral::IQuery> query(schema.tableHandle(tname(SEQUENCE_TABLE, schemaVersion)).newQuery());
364  query->limitReturnedRows(1, 0);
365  query->addToOutputList(SEQUENCE_VALUE_COL);
366  query->defineOutputType(SEQUENCE_VALUE_COL, coral::AttributeSpecification::typeNameForType<int>());
367  query->setForUpdate();
368  std::string whereClause(SEQUENCE_NAME_COL + " = :" + SEQUENCE_NAME_COL);
369  coral::AttributeList rowData;
370  rowData.extend<std::string>(SEQUENCE_NAME_COL);
371  rowData.begin()->data<std::string>() = sequenceName;
372  query->setCondition(whereClause, rowData);
373  coral::ICursor& cursor = query->execute();
374  if (cursor.next()) {
375  value = cursor.currentRow().begin()->data<int>() + 1;
376  ret = true;
377  } else {
378  return false;
379  }
380  // update...
381  coral::AttributeList updateData;
382  updateData.extend<std::string>(SEQUENCE_NAME_COL);
383  updateData.extend<int>(SEQUENCE_VALUE_COL);
384  std::string setClause(SEQUENCE_VALUE_COL + " = :" + SEQUENCE_VALUE_COL);
385  std::string whClause(SEQUENCE_NAME_COL + " = :" + SEQUENCE_NAME_COL);
386  coral::AttributeList::iterator iAttribute = updateData.begin();
387  iAttribute->data<std::string>() = sequenceName;
388  ++iAttribute;
389  iAttribute->data<int>() = value;
390  schema.tableHandle(tname(SEQUENCE_TABLE, schemaVersion)).dataEditor().updateRows(setClause, whClause, updateData);
391  return ret;
392  }
static const std::string SEQUENCE_VALUE_COL("VALUE")
ret
prodAgent to be discontinued
Definition: query.py:1
static const std::string SEQUENCE_TABLE("CREDENTIAL_SEQUENCE")
static const std::string SEQUENCE_NAME_COL("NAME")
Definition: value.py:1
std::string tname(const std::string &tableName, const std::string &schemaVersion)

◆ getpass()

std::string cond::getpass ( const std::string &  prompt,
bool  show_asterisk = true 
)

Definition at line 34 of file Utilities.cc.

References gather_cfg::cout, getch(), EcalCondDBWriter_cfi::password, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getpassForUser().

34  {
35  const char BACKSPACE = 127;
36  const char RETURN = 10;
37 
39  unsigned char ch = 0;
40 
41  std::cout << prompt;
42 
43  while ((ch = getch()) != RETURN) {
44  if (ch == BACKSPACE) {
45  if (password.length() != 0) {
46  if (show_asterisk)
47  std::cout << "\b \b";
48  password.resize(password.length() - 1);
49  }
50  } else {
51  password += ch;
52  if (show_asterisk)
53  std::cout << '*';
54  }
55  }
56  std::cout << std::endl;
57  return password;
58  }
int getch()
Definition: Utilities.cc:19

◆ getpassForUser()

std::string cond::getpassForUser ( const std::string &  userName)

Definition at line 60 of file Utilities.cc.

References getpass(), AlCaHLTBitMon_QueryRunRegistry::string, and EcalCondDBWriter_cfi::userName.

60  {
61  std::string prompt("Enter password for user ");
62  prompt += userName;
63  prompt += ": ";
64  return getpass(prompt, true);
65  }
std::string getpass(const std::string &prompt, bool show_asterisk=true)
Definition: Utilities.cc:34

◆ hash64()

ub8 cond::hash64 ( unsigned char *  k,
unsigned long long  length,
unsigned long long  level 
)

Definition at line 68 of file hash64.cc.

References a, b, DummyCfis::c, dqmdumpme::k, personalPlayback::level, L1DTConfigBti_cff::LL, and mix64.

Referenced by cond::KeyedElement::convert().

72  {
73  ub8 a, b, c, len;
74 
75  /* Set up the internal state */
76  len = length;
77  a = b = level; /* the previous hash value */
78  c = 0x9e3779b97f4a7c13LL; /* the golden ratio; an arbitrary value */
79 
80  /*---------------------------------------- handle most of the key */
81  if (((unsigned long)k) & 7) {
82  while (len >= 24) {
83  a += (k[0] + ((ub8)k[1] << 8) + ((ub8)k[2] << 16) + ((ub8)k[3] << 24) + ((ub8)k[4] << 32) + ((ub8)k[5] << 40) +
84  ((ub8)k[6] << 48) + ((ub8)k[7] << 56));
85  b += (k[8] + ((ub8)k[9] << 8) + ((ub8)k[10] << 16) + ((ub8)k[11] << 24) + ((ub8)k[12] << 32) +
86  ((ub8)k[13] << 40) + ((ub8)k[14] << 48) + ((ub8)k[15] << 56));
87  c += (k[16] + ((ub8)k[17] << 8) + ((ub8)k[18] << 16) + ((ub8)k[19] << 24) + ((ub8)k[20] << 32) +
88  ((ub8)k[21] << 40) + ((ub8)k[22] << 48) + ((ub8)k[23] << 56));
89  mix64(a, b, c);
90  k += 24;
91  len -= 24;
92  }
93  } else {
94  while (len >= 24) /* aligned */
95  {
96  a += *(ub8 *)(k + 0);
97  b += *(ub8 *)(k + 8);
98  c += *(ub8 *)(k + 16);
99  mix64(a, b, c);
100  k += 24;
101  len -= 24;
102  }
103  }
104 
105  /*------------------------------------- handle the last 23 bytes */
106  c += length;
107  switch (len) /* all the case statements fall through */
108  {
109  case 23:
110  c += ((ub8)k[22] << 56);
111  [[fallthrough]];
112  case 22:
113  c += ((ub8)k[21] << 48);
114  [[fallthrough]];
115  case 21:
116  c += ((ub8)k[20] << 40);
117  [[fallthrough]];
118  case 20:
119  c += ((ub8)k[19] << 32);
120  [[fallthrough]];
121  case 19:
122  c += ((ub8)k[18] << 24);
123  [[fallthrough]];
124  case 18:
125  c += ((ub8)k[17] << 16);
126  [[fallthrough]];
127  case 17:
128  c += ((ub8)k[16] << 8);
129  [[fallthrough]];
130  /* the first byte of c is reserved for the length */
131  case 16:
132  b += ((ub8)k[15] << 56);
133  [[fallthrough]];
134  case 15:
135  b += ((ub8)k[14] << 48);
136  [[fallthrough]];
137  case 14:
138  b += ((ub8)k[13] << 40);
139  [[fallthrough]];
140  case 13:
141  b += ((ub8)k[12] << 32);
142  [[fallthrough]];
143  case 12:
144  b += ((ub8)k[11] << 24);
145  [[fallthrough]];
146  case 11:
147  b += ((ub8)k[10] << 16);
148  [[fallthrough]];
149  case 10:
150  b += ((ub8)k[9] << 8);
151  [[fallthrough]];
152  case 9:
153  b += ((ub8)k[8]);
154  [[fallthrough]];
155  case 8:
156  a += ((ub8)k[7] << 56);
157  [[fallthrough]];
158  case 7:
159  a += ((ub8)k[6] << 48);
160  [[fallthrough]];
161  case 6:
162  a += ((ub8)k[5] << 40);
163  [[fallthrough]];
164  case 5:
165  a += ((ub8)k[4] << 32);
166  [[fallthrough]];
167  case 4:
168  a += ((ub8)k[3] << 24);
169  [[fallthrough]];
170  case 3:
171  a += ((ub8)k[2] << 16);
172  [[fallthrough]];
173  case 2:
174  a += ((ub8)k[1] << 8);
175  [[fallthrough]];
176  case 1:
177  a += ((ub8)k[0]);
178  /* case 0: nothing left to add */
179  }
180  mix64(a, b, c);
181  /*-------------------------------------------- report the result */
182  return c;
183  }
#define mix64(a, b, c)
Definition: hash64.cc:22
unsigned long long ub8
Definition: hash64.cc:62
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

◆ httpGet()

unsigned long cond::httpGet ( const std::string &  urlString,
std::string &  info 
)

Definition at line 16 of file WebUtils.cc.

References mps_merge::body, getBodyCallback(), info(), runTheMatrix::ret, submitPVResolutionJobs::stderr, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::OMSServiceQuery::execute().

16  {
17  CURL* curl;
18  CURLcode res;
20  char errbuf[CURL_ERROR_SIZE];
21 
22  curl = curl_easy_init();
23  unsigned long ret = false;
24  if (curl) {
25  struct curl_slist* chunk = nullptr;
26  chunk = curl_slist_append(chunk, "content-type:application/json");
27  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
28  curl_easy_setopt(curl, CURLOPT_URL, urlString.c_str());
29  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, getBodyCallback);
30  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
31  curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
32  res = curl_easy_perform(curl);
33  curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &ret);
34  if (CURLE_OK == res) {
35  info = body;
36  } else {
37  size_t len = strlen(errbuf);
38  fprintf(stderr, "\nlibcurl: (%d) ", res);
39  if (len)
40  fprintf(stderr, "%s%s", errbuf, ((errbuf[len - 1] != '\n') ? "\n" : ""));
41  else
42  fprintf(stderr, "%s\n", curl_easy_strerror(res));
43  }
44  curl_easy_cleanup(curl);
45  }
46  return ret;
47  }
static const TGPicture * info(bool iBackgroundIsBlack)
static size_t getBodyCallback(void *contents, size_t size, size_t nmemb, void *ptr)
Definition: WebUtils.cc:10
ret
prodAgent to be discontinued
Definition: Electron.h:6
body
create merge config
Definition: mps_merge.py:62

◆ invalidTime()

const Time_t cond::invalidTime ( )

◆ makeIov()

Iov_t cond::makeIov ( cond::Time_t  since,
const Hash payloadId 
)

Definition at line 20 of file CondDBPyWrappers.cc.

References runTheMatrix::ret, and SiStripBadComponentsDQMServiceTemplate_cfg::since.

Referenced by BOOST_PYTHON_MODULE().

20  {
21  Iov_t ret;
22  ret.since = since;
23  ret.payloadId = payloadId;
24  return ret;
25  }
ret
prodAgent to be discontinued

◆ parseLineForNamedParams()

void cond::parseLineForNamedParams ( const std::string &  line,
std::map< std::string, std::string > &  params 
)

Definition at line 58 of file DecodingKey.cc.

References B2GTnPMonitor_cfi::item, ItemSeparator, mps_splice::line, submitPVValidationJobs::params, str, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::auth::DecodingKey::createFromInputFile().

58  {
59  std::stringstream str(line);
60  std::string paramName("");
61  std::string paramValue("");
62  while (str.good()) {
63  std::string item("");
64  getline(str, item, ItemSeparator);
65  if (item.size() > 3) {
66  paramName = item.substr(0, 2);
67  paramValue = item.substr(2);
68  params.insert(std::make_pair(paramName, paramValue));
69  }
70  }
71  }
constexpr char ItemSeparator
Definition: DecodingKey.cc:14
#define str(s)

◆ particleTypeFromString()

LHCInfo::ParticleType cond::particleTypeFromString ( const std::string &  s_particle_type)

Definition at line 43 of file LHCInfoPopConSourceHandler.cc.

References mps_fire::i, LHCInfo::NONE, and s_particleTypeMap.

43  {
44  for (auto const& i : s_particleTypeMap)
45  if (s_particle_type == i.first)
46  return i.second;
47  return LHCInfo::NONE;
48  }
static const std::pair< const char *, LHCInfo::ParticleType > s_particleTypeMap[]

◆ pluginCategory()

const char * cond::pluginCategory ( )

◆ randomChar()

char cond::randomChar ( )

Definition at line 37 of file DecodingKey.cc.

References b64str.

Referenced by cond::auth::KeyGenerator::make().

37  {
38  int irand = ::rand() % (::strlen(b64str));
39  return b64str[irand];
40  }
static const char * b64str
Definition: DecodingKey.cc:18

◆ schemaLabel()

std::string cond::schemaLabel ( const std::string &  serviceName,
const std::string &  userName 
)

Definition at line 160 of file CredentialStore.cc.

References runTheMatrix::ret, serviceName, AlCaHLTBitMon_QueryRunRegistry::string, to_lower(), and EcalCondDBWriter_cfi::userName.

Referenced by cond::CredentialStore::createSchema(), cond::CredentialStore::importForPrincipal(), cond::CredentialStore::resetAdmin(), and schemaLabelForCredentialStore().

160  {
162  if (!serviceName.empty()) {
163  ret += "@" + serviceName;
164  ret = to_lower(ret);
165  }
166  return ret;
167  }
ret
prodAgent to be discontinued
std::string to_lower(const std::string &s)
static const std::string serviceName

◆ schemaLabelForCredentialStore()

std::string cond::schemaLabelForCredentialStore ( const std::string &  connectionString)

Definition at line 169 of file CredentialStore.cc.

References l1RCTOmdsFedVectorProducer_cfi::connectionString, writedatasetfile::parser, schemaLabel(), serviceName, and AlCaHLTBitMon_QueryRunRegistry::string.

169  {
170  coral::URIParser parser;
171  parser.setURI(connectionString);
172  std::string serviceName = parser.hostName();
173  std::string schemaName = parser.databaseOrSchemaName();
174  return schemaLabel(serviceName, schemaName);
175  }
static const std::string serviceName
std::string schemaLabel(const std::string &serviceName, const std::string &userName)

◆ selectAuthorization()

bool cond::selectAuthorization ( const std::string &  schemaVersion,
coral::ISchema &  schema,
int  principalId,
const std::string &  role,
const std::string &  connectionString,
AuthorizationData destination 
)

Definition at line 283 of file CredentialStore.cc.

References AUTH_ID_COL(), AUTH_KEY_COL(), AUTHORIZATION_TABLE(), C_ID_COL(), l1RCTOmdsFedVectorProducer_cfi::connectionString, HLTMuonOfflineAnalyzer_cff::destination, newFWLiteAna::found, P_ID_COL(), contentValuesFiles::query, ROLE_COL(), SCHEMA_COL(), AlCaHLTBitMon_QueryRunRegistry::string, tname(), and to_lower().

Referenced by setPermissionData().

288  {
289  std::unique_ptr<coral::IQuery> query(schema.tableHandle(tname(AUTHORIZATION_TABLE, schemaVersion)).newQuery());
290  coral::AttributeList readBuff;
291  readBuff.extend<int>(AUTH_ID_COL);
292  readBuff.extend<int>(C_ID_COL);
293  readBuff.extend<std::string>(AUTH_KEY_COL);
294  coral::AttributeList whereData;
295  whereData.extend<int>(P_ID_COL);
296  whereData.extend<std::string>(ROLE_COL);
297  whereData.extend<std::string>(SCHEMA_COL);
298  whereData[P_ID_COL].data<int>() = principalId;
299  whereData[ROLE_COL].data<std::string>() = role;
300  whereData[SCHEMA_COL].data<std::string>() = to_lower(connectionString);
301  std::stringstream whereClause;
302  whereClause << P_ID_COL << " = :" << P_ID_COL;
303  whereClause << " AND " << ROLE_COL << " = :" << ROLE_COL;
304  whereClause << " AND " << SCHEMA_COL << " = :" << SCHEMA_COL;
305  query->defineOutput(readBuff);
306  query->addToOutputList(AUTH_ID_COL);
307  query->addToOutputList(C_ID_COL);
308  query->addToOutputList(AUTH_KEY_COL);
309  query->setCondition(whereClause.str(), whereData);
310  coral::ICursor& cursor = query->execute();
311  bool found = false;
312  if (cursor.next()) {
313  const coral::AttributeList& row = cursor.currentRow();
314  destination.id = row[AUTH_ID_COL].data<int>();
315  destination.connectionId = row[C_ID_COL].data<int>();
316  destination.key = row[AUTH_KEY_COL].data<std::string>();
317  found = true;
318  }
319  return found;
320  }
static const std::string ROLE_COL("C_ROLE")
static const std::string SCHEMA_COL("C_SCHEMA")
std::string to_lower(const std::string &s)
Definition: query.py:1
static const std::string AUTH_ID_COL("AUTH_ID")
static const std::string AUTHORIZATION_TABLE("AUTHORIZATION")
std::string tname(const std::string &tableName, const std::string &schemaVersion)
static const std::string P_ID_COL("P_ID")
static const std::string C_ID_COL("C_ID")
static const std::string AUTH_KEY_COL("CRED3")

◆ selectConnection()

bool cond::selectConnection ( const std::string &  schemaVersion,
coral::ISchema &  schema,
const std::string &  connectionLabel,
CredentialData destination 
)

Definition at line 240 of file CredentialStore.cc.

References CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), CREDENTIAL_TABLE(), HLTMuonOfflineAnalyzer_cff::destination, newFWLiteAna::found, PASSWORD_COL(), contentValuesFiles::query, AlCaHLTBitMon_QueryRunRegistry::string, tname(), USERNAME_COL(), and VERIFICATION_KEY_COL().

Referenced by cond::CredentialStore::removeConnection(), cond::CredentialStore::setPermission(), updateConnectionData(), and cond::CredentialStore::updatePrincipal().

243  {
244  std::unique_ptr<coral::IQuery> query(schema.tableHandle(tname(CREDENTIAL_TABLE, schemaVersion)).newQuery());
245  coral::AttributeList readBuff;
246  readBuff.extend<int>(CONNECTION_ID_COL);
247  readBuff.extend<std::string>(USERNAME_COL);
248  readBuff.extend<std::string>(PASSWORD_COL);
249  readBuff.extend<std::string>(VERIFICATION_KEY_COL);
250  readBuff.extend<std::string>(CONNECTION_KEY_COL);
251  coral::AttributeList whereData;
252  whereData.extend<std::string>(CONNECTION_LABEL_COL);
253  whereData[CONNECTION_LABEL_COL].data<std::string>() = connectionLabel;
254  std::string whereClause = CONNECTION_LABEL_COL + " = :" + CONNECTION_LABEL_COL;
255  query->defineOutput(readBuff);
256  query->addToOutputList(CONNECTION_ID_COL);
257  query->addToOutputList(USERNAME_COL);
258  query->addToOutputList(PASSWORD_COL);
259  query->addToOutputList(VERIFICATION_KEY_COL);
260  query->addToOutputList(CONNECTION_KEY_COL);
261  query->setCondition(whereClause, whereData);
262  coral::ICursor& cursor = query->execute();
263  bool found = false;
264  if (cursor.next()) {
265  const coral::AttributeList& row = cursor.currentRow();
266  destination.id = row[CONNECTION_ID_COL].data<int>();
267  destination.userName = row[USERNAME_COL].data<std::string>();
268  destination.password = row[PASSWORD_COL].data<std::string>();
269  destination.verificationKey = row[VERIFICATION_KEY_COL].data<std::string>();
270  destination.connectionKey = row[CONNECTION_KEY_COL].data<std::string>();
271  found = true;
272  }
273  return found;
274  }
static const std::string PASSWORD_COL("CRED5")
static const std::string CONNECTION_KEY_COL("CRED7")
Definition: query.py:1
static const std::string VERIFICATION_KEY_COL("CRED6")
static const std::string USERNAME_COL("CRED4")
static const std::string CONNECTION_ID_COL("CONN_ID")
std::string tname(const std::string &tableName, const std::string &schemaVersion)
static const std::string CREDENTIAL_TABLE("CREDENTIAL")
static const std::string CONNECTION_LABEL_COL("CONN_LABEL")

◆ selectPrincipal()

bool cond::selectPrincipal ( const std::string &  schemaVersion,
coral::ISchema &  schema,
const std::string &  principal,
PrincipalData destination 
)

Definition at line 198 of file CredentialStore.cc.

References ADMIN_KEY_COL(), AUTHENTICATION_TABLE(), HLTMuonOfflineAnalyzer_cff::destination, newFWLiteAna::found, PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), contentValuesFiles::query, AlCaHLTBitMon_QueryRunRegistry::string, tname(), and VERIFICATION_COL().

Referenced by cond::CredentialStore::importForPrincipal(), cond::CredentialStore::removePrincipal(), cond::CredentialStore::resetAdmin(), cond::CredentialStore::setPermission(), cond::CredentialStore::startSession(), cond::CredentialStore::unsetPermission(), and updatePrincipalData().

201  {
202  std::unique_ptr<coral::IQuery> query(schema.tableHandle(tname(AUTHENTICATION_TABLE, schemaVersion)).newQuery());
203  coral::AttributeList readBuff;
204  readBuff.extend<int>(PRINCIPAL_ID_COL);
205  readBuff.extend<std::string>(VERIFICATION_COL);
206  readBuff.extend<std::string>(PRINCIPAL_KEY_COL);
207  readBuff.extend<std::string>(ADMIN_KEY_COL);
208  coral::AttributeList whereData;
209  whereData.extend<std::string>(PRINCIPAL_NAME_COL);
210  whereData[PRINCIPAL_NAME_COL].data<std::string>() = principal;
211  std::string whereClause = PRINCIPAL_NAME_COL + " = :" + PRINCIPAL_NAME_COL;
212  query->defineOutput(readBuff);
213  query->addToOutputList(PRINCIPAL_ID_COL);
214  query->addToOutputList(VERIFICATION_COL);
215  query->addToOutputList(PRINCIPAL_KEY_COL);
216  query->addToOutputList(ADMIN_KEY_COL);
217  query->setCondition(whereClause, whereData);
218  coral::ICursor& cursor = query->execute();
219  bool found = false;
220  if (cursor.next()) {
221  found = true;
222  const coral::AttributeList& row = cursor.currentRow();
223  destination.id = row[PRINCIPAL_ID_COL].data<int>();
224  destination.verifKey = row[VERIFICATION_COL].data<std::string>();
225  destination.principalKey = row[PRINCIPAL_KEY_COL].data<std::string>();
226  destination.adminKey = row[ADMIN_KEY_COL].data<std::string>();
227  }
228  return found;
229  }
static const std::string AUTHENTICATION_TABLE("AUTHENTICATION")
Definition: query.py:1
static const std::string ADMIN_KEY_COL("CRED2")
static const std::string VERIFICATION_COL("CRED0")
static const std::string PRINCIPAL_ID_COL("P_ID")
static const std::string PRINCIPAL_KEY_COL("CRED1")
std::string tname(const std::string &tableName, const std::string &schemaVersion)
static const std::string PRINCIPAL_NAME_COL("P_NAME")

◆ serialize()

template<typename T >
std::pair<Binary, Binary> cond::serialize ( const T payload)

Definition at line 66 of file Serialization.h.

References MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, cond::StreamerInfo::jsonString(), jetsAK4_Puppi_cff::payload, runTheMatrix::ret, AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

Referenced by cond::persistency::Session::storePayload< std::string >(), cond::persistency::Session::storePayload(), and RawEventFileWriterForBU::writeJsds().

66  {
67  std::pair<Binary, Binary> ret;
68  std::string streamerInfo(StreamerInfo::jsonString());
69  try {
70  // save data to buffers
71  std::ostringstream dataBuffer;
72  CondOutputArchive oa(dataBuffer);
73  oa << payload;
74  //TODO: avoid (2!!) copies
75  ret.first.copy(dataBuffer.str());
76  ret.second.copy(streamerInfo);
77  } catch (const std::exception& e) {
78  std::string em(e.what());
79  throwException("Serialization failed: " + em + ". Serialization info:" + streamerInfo, "serialize");
80  }
81  return ret;
82  }
ret
prodAgent to be discontinued
cond::serialization::OutputArchive CondOutputArchive
Definition: Serialization.h:62
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ setPermissionData()

bool cond::setPermissionData ( const std::string &  schemaVersion,
coral::ISchema &  schema,
int  principalId,
const std::string &  principalKey,
const std::string &  role,
const std::string &  connectionString,
int  connectionId,
const std::string &  connectionKey,
std::stringstream &  log 
)

Definition at line 457 of file CredentialStore.cc.

References AUTH_ID_COL(), AUTH_KEY_COL(), AUTHORIZATION_TABLE(), cond::auth::Cipher::b64encrypt(), C_ID_COL(), l1RCTOmdsFedVectorProducer_cfi::connectionString, spr::find(), newFWLiteAna::found, getNextSequenceValue(), cond::AuthorizationData::id, dqm-mbProfile::log, GetRecoTauVFromDQM_MC_cff::next, P_ID_COL(), ROLE_COL(), cond::auth::ROLES, SCHEMA_COL(), selectAuthorization(), AlCaHLTBitMon_QueryRunRegistry::string, cond::persistency::throwException(), tname(), and to_lower().

Referenced by cond::CredentialStore::createSchema(), cond::CredentialStore::importForPrincipal(), cond::CredentialStore::resetAdmin(), cond::CredentialStore::setPermission(), and cond::CredentialStore::updatePrincipal().

465  {
466  if (cond::auth::ROLES.find(role) == cond::auth::ROLES.end()) {
467  throwException(std::string("Role ") + role + " does not exists.", "CredentialStore::setPermission");
468  }
469  auth::Cipher cipher(principalKey);
470  std::string encryptedConnectionKey = cipher.b64encrypt(connectionKey);
471  AuthorizationData authData;
472  bool found = selectAuthorization(schemaVersion, schema, principalId, role, connectionString, authData);
473 
474  std::string authorization_table_name = tname(AUTHORIZATION_TABLE, schemaVersion);
475  coral::ITableDataEditor& editor = schema.tableHandle(authorization_table_name).dataEditor();
476  if (found) {
477  log << "Updating permission for principal id " << principalId << " to access resource " << connectionString
478  << " with role " << role << std::endl;
479  coral::AttributeList updateData;
480  updateData.extend<int>(AUTH_ID_COL);
481  updateData.extend<int>(C_ID_COL);
482  updateData.extend<std::string>(AUTH_KEY_COL);
483  updateData[AUTH_ID_COL].data<int>() = authData.id;
484  updateData[C_ID_COL].data<int>() = connectionId;
485  updateData[AUTH_KEY_COL].data<std::string>() = encryptedConnectionKey;
486  std::string setCl = C_ID_COL + " = :" + C_ID_COL + ", " + AUTH_KEY_COL + " = :" + AUTH_KEY_COL;
487  std::string whereCl = AUTH_ID_COL + " = :" + AUTH_ID_COL;
488  editor.updateRows(setCl, whereCl, updateData);
489  } else {
490  int next = -1;
491  if (!getNextSequenceValue(schemaVersion, schema, authorization_table_name, next))
492  throwException("Can't find " + authorization_table_name + " sequence.", "CredentialStore::setPermission");
493  log << "Setting permission for principal id " << principalId << " to access resource " << connectionString
494  << " with role " << role << std::endl;
495  coral::AttributeList insertData;
496  insertData.extend<int>(AUTH_ID_COL);
497  insertData.extend<int>(P_ID_COL);
498  insertData.extend<std::string>(ROLE_COL);
499  insertData.extend<std::string>(SCHEMA_COL);
500  insertData.extend<std::string>(AUTH_KEY_COL);
501  insertData.extend<int>(C_ID_COL);
502  insertData[AUTH_ID_COL].data<int>() = next;
503  insertData[P_ID_COL].data<int>() = principalId;
504  insertData[ROLE_COL].data<std::string>() = role;
505  insertData[SCHEMA_COL].data<std::string>() = to_lower(connectionString);
506  insertData[AUTH_KEY_COL].data<std::string>() = encryptedConnectionKey;
507  insertData[C_ID_COL].data<int>() = connectionId;
508  editor.insertRow(insertData);
509  }
510  return true;
511  }
static const std::string ROLE_COL("C_ROLE")
static const std::string SCHEMA_COL("C_SCHEMA")
std::string to_lower(const std::string &s)
bool selectAuthorization(const std::string &schemaVersion, coral::ISchema &schema, int principalId, const std::string &role, const std::string &connectionString, AuthorizationData &destination)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool getNextSequenceValue(const std::string &schemaVersion, coral::ISchema &schema, const std::string &sequenceName, int &value)
static const std::set< std::string > ROLES
Definition: Auth.h:21
static const std::string AUTH_ID_COL("AUTH_ID")
static const std::string AUTHORIZATION_TABLE("AUTHORIZATION")
std::string tname(const std::string &tableName, const std::string &schemaVersion)
static const std::string P_ID_COL("P_ID")
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12
static const std::string C_ID_COL("C_ID")
static const std::string AUTH_KEY_COL("CRED3")

◆ synchronizationTypeFromName()

SynchronizationType cond::synchronizationTypeFromName ( const std::string &  name)

Definition at line 47 of file Types.cc.

References mps_fire::i, Skims_PA_cff::name, s_obsoleteSynchronizationTypeArray, s_synchronizationTypeArray, and throwException().

Referenced by cond::persistency::GetFromRow< cond::SynchronizationType >::operator()().

47  {
48  for (auto const &i : s_synchronizationTypeArray)
49  if (name == i.first)
50  return i.second;
51  for (auto const &i : s_obsoleteSynchronizationTypeArray)
52  if (name == i.first)
53  return i.second;
54  throwException("SynchronizationType \"" + name + "\" is unknown.", "synchronizationTypeFromName");
55  }
static std::pair< const char *, SynchronizationType > s_synchronizationTypeArray[]
Definition: Types.cc:29
static std::pair< const char *, SynchronizationType > s_obsoleteSynchronizationTypeArray[]
Definition: Types.cc:40
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ synchronizationTypeNames()

std::string cond::synchronizationTypeNames ( SynchronizationType  type)

Definition at line 45 of file Types.cc.

References s_synchronizationTypeArray.

Referenced by cond::persistency::f_add_attribute(), and cond::persistency::IOVEditor::flush().

45 { return s_synchronizationTypeArray[type].first; }
static std::pair< const char *, SynchronizationType > s_synchronizationTypeArray[]
Definition: Types.cc:29

◆ throwException()

void cond::throwException ( const std::string &  message,
const std::string &  methodName 
)

Definition at line 18 of file Exception.cc.

Referenced by cond::service::PoolDBOutputService::appendOneIOV(), cond::service::PoolDBOutputService::appendSinceTime(), cond::auth::Cipher::b64decrypt(), cond::service::PoolDBOutputService::closeIOV(), cond::auth::DecodingKey::createFromInputFile(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::createOneIOV(), createPayload(), createPayload< HcalCalibrationQIEData >(), createPayload< std::string >(), cond::CredentialStore::createSchema(), cond::RelationalAuthenticationService::RelationalAuthenticationService::credentials(), cond::Binary::data(), default_deserialize(), deserialize< BaseKeyed >(), deserialize< condex::Efficiency >(), deserialize< CSCReadoutMapping >(), deserialize< CSCReadoutMappingForSliceTest >(), deserialize< PerformancePayload >(), cond::service::PoolDBOutputService::eraseSinceTime(), cond::auth::DecodingKey::flush(), cond::service::PoolDBOutputService::forceInit(), cond::persistency::getConnectionParams(), getLoginName(), cond::service::PoolDBOutputService::getRecord(), cond::payloadInspector::PlotBase::getTag(), cond::CredentialStore::importForPrincipal(), cond::persistency::importPayload(), cond::auth::DecodingKey::init(), cond::service::PoolDBOutputService::isNewTagRequest(), cond::persistency::IOVEditor::load(), cond::persistency::KeyList::loadFromDB(), cond::service::PoolDBOutputService::lookUpRecord(), cond::CredentialStore::removeConnection(), cond::CredentialStore::removePrincipal(), cond::CredentialStore::resetAdmin(), serialize(), cond::persistency::KeyList::setKeys(), cond::CredentialStore::setPermission(), cond::CredentialStore::setUpForService(), cond::Binary::size(), synchronizationTypeFromName(), cond::service::PoolDBOutputService::tagInfo(), cond::CredentialStore::unsetPermission(), cond::CredentialStore::updatePrincipal(), cond::service::PoolDBOutputService::writeMany(), and cond::service::PoolDBOutputService::writeOneIOV().

18  {
19  throw Exception(message, methodName);
20  }

◆ TIMELIMIT()

const Time_t cond::TIMELIMIT ( std::numeric_limits< Time_t ::max())

◆ timeTypeNames()

std::string const & cond::timeTypeNames ( int  i)

Definition at line 11 of file Time.cc.

References mps_fire::i, DTRecHitClients_cfi::local, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CondDBESSource::setIntervalFor(), and cond::TimeTypeTraits< type >::specs().

11  {
12  static const std::string local[] = {"runnumber", "timestamp", "lumiid", "hash", "userid"};
13  return local[i];
14  }

◆ updateConnectionData()

std::pair<int, std::string> cond::updateConnectionData ( const std::string &  schemaVersion,
coral::ISchema &  schema,
const std::string &  adminKey,
const std::string &  connectionLabel,
const std::string &  userName,
const std::string &  password,
bool  forceUpdate,
std::stringstream &  log 
)

Definition at line 513 of file CredentialStore.cc.

References cond::auth::Cipher::b64decrypt(), cond::auth::Cipher::b64encrypt(), cond::auth::COND_DB_KEY_SIZE, CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), cond::CredentialData::connectionKey, CREDENTIAL_TABLE(), newFWLiteAna::found, relval_steps::gen(), getNextSequenceValue(), cond::CredentialData::id, dqm-mbProfile::log, EcalCondDBWriter_cfi::password, PASSWORD_COL(), selectConnection(), AlCaHLTBitMon_QueryRunRegistry::string, cond::persistency::throwException(), tname(), EcalCondDBWriter_cfi::userName, USERNAME_COL(), VERIFICATION_KEY_COL(), and cond::CredentialData::verificationKey.

Referenced by cond::CredentialStore::createSchema(), cond::CredentialStore::importForPrincipal(), cond::CredentialStore::resetAdmin(), and cond::CredentialStore::updateConnection().

520  {
521  CredentialData credsData;
522  bool found = selectConnection(schemaVersion, schema, connectionLabel, credsData);
523  int connId = credsData.id;
524 
525  auth::Cipher adminCipher(adminKey);
526  std::string connectionKey("");
527  std::string credential_table_name = tname(CREDENTIAL_TABLE, schemaVersion);
528  coral::ITableDataEditor& editor = schema.tableHandle(credential_table_name).dataEditor();
529  if (found) {
530  connectionKey = adminCipher.b64decrypt(credsData.connectionKey);
531  auth::Cipher cipher(connectionKey);
532  std::string verificationKey = cipher.b64decrypt(credsData.verificationKey);
533  if (verificationKey != connectionLabel) {
534  throwException("Decoding of connection key failed.", "CredentialStore::updateConnection");
535  }
536  if (forceUpdate) {
537  std::string encryptedUserName = cipher.b64encrypt(userName);
538  std::string encryptedPassword = cipher.b64encrypt(password);
539  log << "Forcing update of connection " << connectionLabel << std::endl;
540  coral::AttributeList updateData;
541  updateData.extend<int>(CONNECTION_ID_COL);
542  updateData.extend<std::string>(USERNAME_COL);
543  updateData.extend<std::string>(PASSWORD_COL);
544  updateData[CONNECTION_ID_COL].data<int>() = connId;
545  updateData[USERNAME_COL].data<std::string>() = encryptedUserName;
546  updateData[PASSWORD_COL].data<std::string>() = encryptedPassword;
547  std::stringstream setCl;
548  setCl << USERNAME_COL << " = :" << USERNAME_COL;
549  setCl << ", " << PASSWORD_COL << " = :" << PASSWORD_COL;
550  std::string whereCl = CONNECTION_ID_COL + " = :" + CONNECTION_ID_COL;
551  editor.updateRows(setCl.str(), whereCl, updateData);
552  }
553  } else {
554  auth::KeyGenerator gen;
555  connectionKey = gen.make(auth::COND_DB_KEY_SIZE);
556  auth::Cipher cipher(connectionKey);
557  std::string encryptedUserName = cipher.b64encrypt(userName);
558  std::string encryptedPassword = cipher.b64encrypt(password);
559  std::string encryptedLabel = cipher.b64encrypt(connectionLabel);
560 
561  if (!getNextSequenceValue(schemaVersion, schema, credential_table_name, connId))
562  throwException("Can't find " + credential_table_name + " sequence.", "CredentialStore::updateConnection");
563  log << "Creating new connection " << connectionLabel << std::endl;
564  coral::AttributeList insertData;
565  insertData.extend<int>(CONNECTION_ID_COL);
566  insertData.extend<std::string>(CONNECTION_LABEL_COL);
567  insertData.extend<std::string>(USERNAME_COL);
568  insertData.extend<std::string>(PASSWORD_COL);
569  insertData.extend<std::string>(VERIFICATION_KEY_COL);
570  insertData.extend<std::string>(CONNECTION_KEY_COL);
571  insertData[CONNECTION_ID_COL].data<int>() = connId;
572  insertData[CONNECTION_LABEL_COL].data<std::string>() = connectionLabel;
573  insertData[USERNAME_COL].data<std::string>() = encryptedUserName;
574  insertData[PASSWORD_COL].data<std::string>() = encryptedPassword;
575  insertData[VERIFICATION_KEY_COL].data<std::string>() = encryptedLabel;
576  insertData[CONNECTION_KEY_COL].data<std::string>() = adminCipher.b64encrypt(connectionKey);
577  ;
578  editor.insertRow(insertData);
579  }
580  return std::make_pair(connId, connectionKey);
581  }
static const std::string PASSWORD_COL("CRED5")
static const std::string CONNECTION_KEY_COL("CRED7")
bool getNextSequenceValue(const std::string &schemaVersion, coral::ISchema &schema, const std::string &sequenceName, int &value)
static const std::string VERIFICATION_KEY_COL("CRED6")
static constexpr unsigned int COND_DB_KEY_SIZE
Definition: Auth.h:38
static const std::string USERNAME_COL("CRED4")
def gen(fragment, howMuch)
Production test section ####.
static const std::string CONNECTION_ID_COL("CONN_ID")
bool selectConnection(const std::string &schemaVersion, coral::ISchema &schema, const std::string &connectionLabel, CredentialData &destination)
std::string tname(const std::string &tableName, const std::string &schemaVersion)
static const std::string CREDENTIAL_TABLE("CREDENTIAL")
static const std::string CONNECTION_LABEL_COL("CONN_LABEL")
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12

◆ updatePrincipalData()

std::pair<int, std::string> cond::updatePrincipalData ( const std::string &  schemaVersion,
coral::ISchema &  schema,
const std::string &  authenticationKey,
const std::string &  principalName,
const std::string &  adminKey,
bool  init,
std::stringstream &  log 
)
Parameters
init= false *

Definition at line 394 of file CredentialStore.cc.

References ADMIN_KEY_COL(), cond::PrincipalData::adminKey, AUTHENTICATION_TABLE(), cond::auth::Cipher::b64decrypt(), cond::auth::Cipher::b64encrypt(), cond::auth::COND_DB_KEY_SIZE, newFWLiteAna::found, relval_steps::gen(), getNextSequenceValue(), cond::PrincipalData::id, dqm-mbProfile::log, PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), selectPrincipal(), AlCaHLTBitMon_QueryRunRegistry::string, cond::persistency::throwException(), tname(), and VERIFICATION_COL().

Referenced by cond::CredentialStore::createSchema(), cond::CredentialStore::resetAdmin(), and cond::CredentialStore::updatePrincipal().

400  {
401  PrincipalData princData;
402  bool found = selectPrincipal(schemaVersion, schema, principalName, princData);
403 
404  auth::Cipher cipher0(authenticationKey);
405  auth::Cipher cipher1(adminKey);
406 
407  std::string verifStr = cipher0.b64encrypt(principalName);
408  std::string principalKey("");
409  int principalId = princData.id;
410 
411  std::string authentication_table_name = tname(AUTHENTICATION_TABLE, schemaVersion);
412 
413  coral::ITableDataEditor& editor = schema.tableHandle(authentication_table_name).dataEditor();
414  if (found) {
415  log << "Updating existing principal " << principalName << " (id: " << principalId << " )" << std::endl;
416  principalKey = cipher1.b64decrypt(princData.adminKey);
417  coral::AttributeList updateData;
418  updateData.extend<int>(PRINCIPAL_ID_COL);
419  updateData.extend<std::string>(VERIFICATION_COL);
420  updateData.extend<std::string>(PRINCIPAL_KEY_COL);
421  updateData.extend<std::string>(ADMIN_KEY_COL);
422  updateData[PRINCIPAL_ID_COL].data<int>() = principalId;
423  updateData[VERIFICATION_COL].data<std::string>() = verifStr;
424  updateData[PRINCIPAL_KEY_COL].data<std::string>() = cipher0.b64encrypt(principalKey);
425  updateData[ADMIN_KEY_COL].data<std::string>() = cipher1.b64encrypt(principalKey);
426  std::stringstream setClause;
427  setClause << VERIFICATION_COL << " = :" << VERIFICATION_COL << ", ";
428  setClause << PRINCIPAL_KEY_COL << " = :" << PRINCIPAL_KEY_COL << ", ";
429  setClause << ADMIN_KEY_COL << " = :" << ADMIN_KEY_COL;
430  std::string whereClause = PRINCIPAL_ID_COL + " = :" + PRINCIPAL_ID_COL;
431  editor.updateRows(setClause.str(), whereClause, updateData);
432  } else {
433  if (init) {
434  principalKey = adminKey;
435  } else {
436  auth::KeyGenerator gen;
437  principalKey = gen.make(auth::COND_DB_KEY_SIZE);
438  }
439  coral::ITableDataEditor& editor0 = schema.tableHandle(authentication_table_name).dataEditor();
440 
441  if (!getNextSequenceValue(schemaVersion, schema, authentication_table_name, principalId))
442  throwException("Can't find " + authentication_table_name + " sequence.", "CredentialStore::updatePrincipal");
443  log << "Creating new principal " << principalName << " (id: " << principalId << " )" << std::endl;
444  coral::AttributeList authData;
445  editor0.rowBuffer(authData);
446  authData[PRINCIPAL_ID_COL].data<int>() = principalId;
447  authData[PRINCIPAL_NAME_COL].data<std::string>() = principalName;
448  authData[VERIFICATION_COL].data<std::string>() = verifStr;
449  authData[PRINCIPAL_KEY_COL].data<std::string>() = cipher0.b64encrypt(principalKey);
450  authData[ADMIN_KEY_COL].data<std::string>() = cipher1.b64encrypt(principalKey);
451  editor0.insertRow(authData);
452  }
453 
454  return std::make_pair(principalId, principalKey);
455  }
static const std::string AUTHENTICATION_TABLE("AUTHENTICATION")
bool getNextSequenceValue(const std::string &schemaVersion, coral::ISchema &schema, const std::string &sequenceName, int &value)
static const std::string ADMIN_KEY_COL("CRED2")
static constexpr unsigned int COND_DB_KEY_SIZE
Definition: Auth.h:38
static const std::string VERIFICATION_COL("CRED0")
def gen(fragment, howMuch)
Production test section ####.
Definition: init.py:1
static const std::string PRINCIPAL_ID_COL("P_ID")
static const std::string PRINCIPAL_KEY_COL("CRED1")
std::string tname(const std::string &tableName, const std::string &schemaVersion)
bool selectPrincipal(const std::string &schemaVersion, coral::ISchema &schema, const std::string &principal, PrincipalData &destination)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12
static const std::string PRINCIPAL_NAME_COL("P_NAME")

Variable Documentation

◆ HASH_SIZE

constexpr unsigned int cond::HASH_SIZE = 40
static

Definition at line 44 of file Types.h.

◆ s_fillTypeMap

const std::pair<const char*, LHCInfo::FillType> cond::s_fillTypeMap[]
static
Initial value:
= {std::make_pair("PROTONS", LHCInfo::PROTONS),
std::make_pair("IONS", LHCInfo::IONS),
std::make_pair("COSMICS", LHCInfo::COSMICS),
std::make_pair("GAP", LHCInfo::GAP)}

Definition at line 24 of file LHCInfoPopConSourceHandler.cc.

Referenced by fillTypeFromString().

◆ s_obsoleteSynchronizationTypeArray

std::pair<const char *, SynchronizationType> cond::s_obsoleteSynchronizationTypeArray[]
static
Initial value:
= {
std::make_pair("Offline", SYNCH_OFFLINE),
std::make_pair("HLT", SYNCH_HLT),
std::make_pair("Prompt", SYNCH_PROMPT),
std::make_pair("Pcl", SYNCH_PCL)}

Definition at line 40 of file Types.cc.

Referenced by synchronizationTypeFromName().

◆ s_particleTypeMap

const std::pair<const char*, LHCInfo::ParticleType> cond::s_particleTypeMap[]
static
Initial value:
= {
std::make_pair("PROTON", LHCInfo::PROTON),
std::make_pair("PB82", LHCInfo::PB82),
std::make_pair("AR18", LHCInfo::AR18),
std::make_pair("D", LHCInfo::D),
std::make_pair("XE54", LHCInfo::XE54)}

Definition at line 29 of file LHCInfoPopConSourceHandler.cc.

Referenced by particleTypeFromString().

◆ s_synchronizationTypeArray

std::pair<const char *, SynchronizationType> cond::s_synchronizationTypeArray[]
static
Initial value:
= {
std::make_pair("any", SYNCH_ANY),
std::make_pair("validation", SYNCH_VALIDATION),
std::make_pair("offline", SYNCH_OFFLINE),
std::make_pair("mc", SYNCH_MC),
std::make_pair("runmc", SYNCH_RUNMC),
std::make_pair("hlt", SYNCH_HLT),
std::make_pair("express", SYNCH_EXPRESS),
std::make_pair("prompt", SYNCH_PROMPT),
std::make_pair("pcl", SYNCH_PCL)}

Definition at line 29 of file Types.cc.

Referenced by synchronizationTypeFromName(), and synchronizationTypeNames().

◆ TIMETYPE_LIST_MAX

const unsigned int cond::TIMETYPE_LIST_MAX = 5

Definition at line 20 of file Time.h.

Referenced by findSpecs().

◆ timeTypeList

const cond::TimeType cond::timeTypeList = {runnumber, timestamp, lumiid, hash, userid}

Definition at line 7 of file Time.cc.

◆ timeTypeSpecs

const TimeTypeSpecs cond::timeTypeSpecs

◆ timeTypeValues

const cond::TimeType cond::timeTypeValues = {runnumber, timestamp, lumiid, hash, userid}

Definition at line 9 of file Time.cc.