CMS 3D CMS Logo

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

Namespaces

 auth
 
 payloadInspector
 
 persistency
 
 RelationalAuthenticationService
 
 serialization
 
 service
 
 time
 
 XMLAuthenticationService
 

Classes

struct  AuthorizationData
 
class  BaseKeyed
 
class  BasicPayload
 
class  Binary
 
class  BTransitionAnalyzer
 
class  CoralServiceFactory
 
class  CoralServiceManager
 
struct  CredentialData
 
class  CredentialStore
 
class  CSScopedSession
 
class  DataProxyWrapperBase
 
struct  DefaultInitializer
 
class  EmptyIOVSource
 
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
 
struct  PrincipalData
 
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< coral::Service *(const std::string &) > CoralServicePluginFactory
 
typedef persistency::Exception Exception
 
typedef std::string Hash
 
typedef edmplugin::PluginFactory< cond::DataProxyWrapperBase *() > ProxyFactory
 
typedef TagInfo_t TagInfo
 
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 classNameForTypeId (const std::type_info &typeInfo)
 
template<typename T >
std::string convertToXML (const std::string &payloadData, const std::string &payloadType)
 
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::shared_ptr< Tdefault_deserialize (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<typename T >
std::shared_ptr< Tdeserialize (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::shared_ptr< BaseKeyeddeserialize< BaseKeyed > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::shared_ptr< condex::Efficiencydeserialize< condex::Efficiency > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::shared_ptr< CSCReadoutMappingdeserialize< CSCReadoutMapping > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::shared_ptr< CSCReadoutMappingForSliceTestdeserialize< CSCReadoutMappingForSliceTest > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
std::shared_ptr< PerformancePayloaddeserialize< PerformancePayload > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
const TimeTypeSpecsfindSpecs (std::string const &name)
 
std::string getLoginName ()
 
unsigned long long hash64 (unsigned char *k, unsigned long long length, unsigned long long level)
 
const Time_t invalidTime (0)
 
const std::string invalidToken (" ")
 
Iov_t makeIov (cond::Time_t since, const Hash &payloadId)
 
void parseLineForNamedParams (const std::string &line, std::map< std::string, std::string > &params)
 
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 (coral::ISchema &schema, int principalId, const std::string &role, const std::string &connectionString, AuthorizationData &destination)
 
bool selectConnection (coral::ISchema &schema, const std::string &connectionLabel, CredentialData &destination)
 
bool selectPrincipal (coral::ISchema &schema, const std::string &principal, PrincipalData &destination)
 
template<typename T >
std::pair< Binary, Binaryserialize (const T &payload)
 
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)
 

Variables

static constexpr unsigned int HASH_SIZE = 40
 
static std::pair< const char *, SynchronizationTypes_obsoleteSynchronizationTypeArray []
 
static std::pair< const char *, SynchronizationTypes_synchronizationTypeArray []
 
const unsigned int TIMETYPE_LIST_MAX =5
 
const cond::TimeType timeTypeList [TIMETYPE_LIST_MAX]
 
const TimeTypeSpecs timeTypeSpecs []
 
const cond::TimeType timeTypeValues []
 

Detailed Description

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

Typedef Documentation

Definition at line 58 of file Serialization.h.

Definition at line 59 of file Serialization.h.

typedef edmplugin::PluginFactory< coral::Service*(const std::string&) > cond::CoralServicePluginFactory

Definition at line 24 of file CoralServiceFactory.h.

Definition at line 25 of file Exception.h.

typedef std::string cond::Hash

Definition at line 45 of file Types.h.

Definition at line 29 of file ProxyFactory.h.

Definition at line 80 of file Types.h.

typedef unsigned long long cond::Time_t

Definition at line 16 of file Time.h.

typedef unsigned long long cond::uint64_t

Definition at line 15 of file Time.h.

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

Definition at line 17 of file Time.h.

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

Definition at line 19 of file Time.h.

Enumeration Type Documentation

Enumerator
SYNCH_ANY 
SYNCH_VALIDATION 
SYNCH_OFFLINE 
SYNCH_MC 
SYNCH_RUNMC 
SYNCH_HLT 
SYNCH_EXPRESS 
SYNCH_PROMPT 
SYNCH_PCL 

Definition at line 29 of file Types.h.

Enumerator
invalid 
runnumber 
timestamp 
lumiid 
hash 
userid 

Definition at line 21 of file Time.h.

cond::TimeType TimeType
Definition: Time.h:29

Function Documentation

std::string cond::classNameForTypeId ( const std::type_info &  typeInfo)
inline

Definition at line 29 of file PoolDBOutputService.h.

References edm::TypeID::className().

29  {
30  edm::TypeID type( typeInfo );
31  return type.className();
32  }
type
Definition: HCALResponse.h:21
template<typename T >
std::string cond::convertToXML ( const std::string &  payloadData,
const std::string &  payloadType 
)

Definition at line 21 of file PayloadToXML.h.

References jetCorrFactors_cfi::payload.

21  {
22 
23  std::unique_ptr< T > payload;
24  std::stringbuf sdataBuf;
25  sdataBuf.pubsetbuf( const_cast<char *> ( payloadData.c_str() ), payloadData.size() );
26 
27  std::istream inBuffer( &sdataBuf );
28  eos::portable_iarchive ia( inBuffer );
29  payload.reset( new T );
30  ia >> (*payload);
31 
32  // now we have the object in memory, convert it to xml in a string and return it
33 
34  std::ostringstream outBuffer;
35  boost::archive::xml_oarchive xmlResult( outBuffer );
36  xmlResult << boost::serialization::make_nvp( "cmsCondPayload", *payload );
37 
38  return outBuffer.str();
39 
40  }
payload
payload postfix for testing
long double T
template<typename T >
T* cond::createPayload ( const std::string &  payloadTypeName)

Definition at line 30 of file Serialization.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

30  {
31  std::string userTypeName = demangledName( typeid(T) );
32  if( userTypeName != payloadTypeName )
33  throwException(std::string("Type mismatch, user type: \""+userTypeName+"\", target type: \"")+payloadTypeName+"\"",
34  "createPayload" );
35  return new T;
36  }
long double T
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<>
HcalCalibrationQIEData* cond::createPayload< HcalCalibrationQIEData > ( const std::string &  payloadTypeName)

Definition at line 37 of file plugin.cc.

References MillePedeFileConverter_cfg::e, HcalFrontEndMap::initialize(), HcalSiPMCharacteristics::initialize(), HcalElectronicsMap::initialize(), HcalDcsMap::initialize(), AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

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

Definition at line 38 of file Serialization.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

38  {
39  std::string userTypeName = demangledName( typeid(std::string) );
40  if( payloadTypeName != userTypeName && payloadTypeName != "std::string" )
41  throwException(std::string("Type mismatch, user type: \"std::string\", target type: \"")+payloadTypeName+"\"",
42  "createPayload" );
43  return new std::string;
44  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<typename T >
std::shared_ptr<T> cond::default_deserialize ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 81 of file Serialization.h.

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

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

Definition at line 113 of file Serialization.h.

References Phase2ITPixelClusterizer_cfi::payloadType.

115  {
116  return default_deserialize<T>( payloadType, payloadData, streamerInfoData );
117  }
template<>
std::shared_ptr< BaseKeyed > cond::deserialize< BaseKeyed > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 39 of file plugin.cc.

References DESERIALIZE_BASE_CASE, DESERIALIZE_POLIMORPHIC_CASE, MillePedeFileConverter_cfg::e, condex::Efficiency::initialize(), AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

41  {
42  DESERIALIZE_BASE_CASE( BaseKeyed );
45 
46  // here we come if none of the deserializations above match the payload type:
47  throwException(std::string("Type mismatch, target object is type \"")+payloadType+"\"", "deserialize<>" );
48  }
#define DESERIALIZE_BASE_CASE(BASETYPENAME)
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<>
std::shared_ptr<condex::Efficiency> cond::deserialize< condex::Efficiency > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 25 of file plugin.cc.

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

27  {
28  // DESERIALIZE_BASE_CASE( condex::Efficiency ); abstract
31 
32  // here we come if none of the deserializations above match the payload type:
33  throwException(std::string("Type mismatch, target object is type \"")+payloadType+"\"", "deserialize<>" );
34  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<>
std::shared_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, 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:14
template<>
std::shared_ptr<CSCReadoutMappingForSliceTest> cond::deserialize< CSCReadoutMappingForSliceTest > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 73 of file plugin.cc.

References DESERIALIZE_POLIMORPHIC_CASE, 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:14
template<>
std::shared_ptr<PerformancePayload> cond::deserialize< PerformancePayload > ( const std::string &  payloadType,
const Binary payloadData,
const Binary streamerInfoData 
)

Definition at line 17 of file PerformanceRecordPlugin.cc.

References DESERIALIZE_POLIMORPHIC_CASE, MillePedeFileConverter_cfg::e, PerformancePayload::initialize(), AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

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

Definition at line 33 of file Time.cc.

References Exception, mps_fire::i, and TIMETYPE_LIST_MAX.

Referenced by cond::TimeTypeTraits< type >::specs(), and cond::time::timeTypeFromName().

33  {
34  size_t i=0;
35  for (; i<TIMETYPE_LIST_MAX; i++)
36  if (name==timeTypeSpecs[i].name) return timeTypeSpecs[i];
37  throw cms::Exception("invalid timetype: "+name);
38  return timeTypeSpecs[0]; // compiler happy
39  }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
const unsigned int TIMETYPE_LIST_MAX
Definition: Time.h:22
std::string cond::getLoginName ( )

Definition at line 41 of file DecodingKey.cc.

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

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

41  {
42  std::string loginName("");
43  struct passwd* userp = ::getpwuid(::getuid());
44  if(userp) {
45  char* uName = userp->pw_name;
46  if(uName){
47  loginName += uName;
48  }
49  }
50  if(loginName.empty()){
51  std::string msg("Cannot determine login name.");
52  throwException(msg,"DecodingKey::getLoginName");
53  }
54  return loginName;
55  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
ub8 cond::hash64 ( unsigned char *  k,
unsigned long long  length,
unsigned long long  level 
)

Definition at line 45 of file hash64.cc.

References a, b, EnergyCorrector::c, hcalDigis_cfi::level, and mix64.

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

49  {
50  ub8 a,b,c,len;
51 
52  /* Set up the internal state */
53  len = length;
54  a = b = level; /* the previous hash value */
55  c = 0x9e3779b97f4a7c13LL; /* the golden ratio; an arbitrary value */
56 
57  /*---------------------------------------- handle most of the key */
58  if (((unsigned long)k)&7)
59  {
60  while (len >= 24)
61  {
62  a += (k[0] +((ub8)k[ 1]<< 8)+((ub8)k[ 2]<<16)+((ub8)k[ 3]<<24)
63  +((ub8)k[4 ]<<32)+((ub8)k[ 5]<<40)+((ub8)k[ 6]<<48)+((ub8)k[ 7]<<56));
64  b += (k[8] +((ub8)k[ 9]<< 8)+((ub8)k[10]<<16)+((ub8)k[11]<<24)
65  +((ub8)k[12]<<32)+((ub8)k[13]<<40)+((ub8)k[14]<<48)+((ub8)k[15]<<56));
66  c += (k[16] +((ub8)k[17]<< 8)+((ub8)k[18]<<16)+((ub8)k[19]<<24)
67  +((ub8)k[20]<<32)+((ub8)k[21]<<40)+((ub8)k[22]<<48)+((ub8)k[23]<<56));
68  mix64(a,b,c);
69  k += 24; len -= 24;
70  }
71  }
72  else
73  {
74  while (len >= 24) /* aligned */
75  {
76  a += *(ub8 *)(k+0);
77  b += *(ub8 *)(k+8);
78  c += *(ub8 *)(k+16);
79  mix64(a,b,c);
80  k += 24; len -= 24;
81  }
82  }
83 
84  /*------------------------------------- handle the last 23 bytes */
85  c += length;
86  switch(len) /* all the case statements fall through */
87  {
88  case 23: c+=((ub8)k[22]<<56);
89  case 22: c+=((ub8)k[21]<<48);
90  case 21: c+=((ub8)k[20]<<40);
91  case 20: c+=((ub8)k[19]<<32);
92  case 19: c+=((ub8)k[18]<<24);
93  case 18: c+=((ub8)k[17]<<16);
94  case 17: c+=((ub8)k[16]<<8);
95  /* the first byte of c is reserved for the length */
96  case 16: b+=((ub8)k[15]<<56);
97  case 15: b+=((ub8)k[14]<<48);
98  case 14: b+=((ub8)k[13]<<40);
99  case 13: b+=((ub8)k[12]<<32);
100  case 12: b+=((ub8)k[11]<<24);
101  case 11: b+=((ub8)k[10]<<16);
102  case 10: b+=((ub8)k[ 9]<<8);
103  case 9: b+=((ub8)k[ 8]);
104  case 8: a+=((ub8)k[ 7]<<56);
105  case 7: a+=((ub8)k[ 6]<<48);
106  case 6: a+=((ub8)k[ 5]<<40);
107  case 5: a+=((ub8)k[ 4]<<32);
108  case 4: a+=((ub8)k[ 3]<<24);
109  case 3: a+=((ub8)k[ 2]<<16);
110  case 2: a+=((ub8)k[ 1]<<8);
111  case 1: a+=((ub8)k[ 0]);
112  /* case 0: nothing left to add */
113  }
114  mix64(a,b,c);
115  /*-------------------------------------------- report the result */
116  return c;
117  }
#define mix64(a, b, c)
Definition: hash64.cc:22
unsigned long long ub8
Definition: hash64.cc:38
int k[5][pyjets_maxn]
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const Time_t cond::invalidTime ( )
const std::string cond::invalidToken ( " "  )
Iov_t cond::makeIov ( cond::Time_t  since,
const Hash payloadId 
)

Definition at line 20 of file CondDBPyWrappers.cc.

References cond::Iov_t::payloadId, cond::Iov_t::since, and ntuplemaker::since.

Referenced by BOOST_PYTHON_MODULE().

20  {
21  Iov_t ret;
22  ret.since = since;
23  ret.payloadId = payloadId;
24  return ret;
25  }
void cond::parseLineForNamedParams ( const std::string &  line,
std::map< std::string, std::string > &  params 
)

Definition at line 57 of file DecodingKey.cc.

References ItemSeparator, harvestTrackValidationPlots::str, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 33 of file ProxyFactory.cc.

34  {
35  return "CondProxyFactory";
36  }
char cond::randomChar ( )

Definition at line 36 of file DecodingKey.cc.

References b64str, and rand().

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

36  {
37  int irand = ::rand()%(::strlen(b64str));
38  return b64str[irand];
39  }
static const char * b64str
Definition: DecodingKey.cc:17
Signal rand(Signal arg)
Definition: vlib.cc:442
std::string cond::schemaLabel ( const std::string &  serviceName,
const std::string &  userName 
)

std::string defaultConnectionString( const std::string& serviceConnectionString, const std::string& serviceName, const std::string& userName ){ size_t pos = serviceConnectionString.find( serviceName ); std::string technologyPrefix = serviceConnectionString.substr(0,pos); std::stringstream connStr; connStr << technologyPrefix; if( !userName.empty() ) connStr <<"/"<< userName; return connStr.str(); }

Definition at line 164 of file CredentialStore.cc.

References serviceName, and AlCaHLTBitMon_QueryRunRegistry::string.

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

165  {
166  std::string ret = userName;
167  if( !serviceName.empty() ){
168  ret += "@"+serviceName;
169  }
170  return ret;
171  }
static const std::string serviceName
std::string cond::schemaLabelForCredentialStore ( const std::string &  connectionString)

Definition at line 172 of file CredentialStore.cc.

References createfilelist::parser, schemaLabel(), serviceName, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::CredentialStore::installAdmin(), and cond::CredentialStore::updatePrincipal().

172  {
173  coral::URIParser parser;
174  parser.setURI( connectionString );
175  std::string serviceName = parser.hostName();
176  std::string schemaName = parser.databaseOrSchemaName();
177  return schemaLabel( serviceName, schemaName );
178  }
static const std::string serviceName
std::string schemaLabel(const std::string &serviceName, const std::string &userName)
bool cond::selectAuthorization ( coral::ISchema &  schema,
int  principalId,
const std::string &  role,
const std::string &  connectionString,
AuthorizationData destination 
)

Definition at line 301 of file CredentialStore.cc.

References AUTH_ID_COL(), AUTH_KEY_COL(), C_ID_COL(), COND_AUTHORIZATION_TABLE(), cond::AuthorizationData::connectionId, runEdmFileComparison::found, cond::AuthorizationData::id, cond::AuthorizationData::key, P_ID_COL(), das::query(), ROLE_COL(), SCHEMA_COL(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

301  {
302  std::auto_ptr<coral::IQuery> query(schema.tableHandle(COND_AUTHORIZATION_TABLE).newQuery());
303  coral::AttributeList readBuff;
304  readBuff.extend<int>(AUTH_ID_COL);
305  readBuff.extend<int>(C_ID_COL);
306  readBuff.extend<std::string>(AUTH_KEY_COL);
307  coral::AttributeList whereData;
308  whereData.extend<int>(P_ID_COL);
309  whereData.extend<std::string>(ROLE_COL);
310  whereData.extend<std::string>(SCHEMA_COL);
311  whereData[ P_ID_COL ].data<int>() = principalId;
312  whereData[ ROLE_COL ].data<std::string>() = role;
313  whereData[ SCHEMA_COL ].data<std::string>() = connectionString;
314  std::stringstream whereClause;
315  whereClause << P_ID_COL << " = :"<<P_ID_COL;
316  whereClause << " AND " << ROLE_COL << " = :"<<ROLE_COL;
317  whereClause << " AND " << SCHEMA_COL << " = :"<<SCHEMA_COL;
318  query->defineOutput(readBuff);
319  query->addToOutputList( AUTH_ID_COL );
320  query->addToOutputList( C_ID_COL );
321  query->addToOutputList( AUTH_KEY_COL );
322  query->setCondition( whereClause.str(), whereData );
323  coral::ICursor& cursor = query->execute();
324  bool found = false;
325  if ( cursor.next() ) {
326  const coral::AttributeList& row = cursor.currentRow();
327  destination.id = row[AUTH_ID_COL].data<int>();
328  destination.connectionId = row[C_ID_COL].data<int>();
329  destination.key = row[AUTH_KEY_COL].data<std::string>();
330  found = true;
331  }
332  return found;
333  }
static const std::string ROLE_COL("C_ROLE")
static const std::string SCHEMA_COL("C_SCHEMA")
static const std::string COND_AUTHORIZATION_TABLE("COND_AUTHORIZATION")
def query(query_str, verbose=False)
Definition: das.py:5
Definition: query.py:1
static const std::string AUTH_ID_COL("AUTH_ID")
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")
bool cond::selectConnection ( coral::ISchema &  schema,
const std::string &  connectionLabel,
CredentialData destination 
)

Definition at line 257 of file CredentialStore.cc.

References COND_CREDENTIAL_TABLE(), CONNECTION_ID_COL(), CONNECTION_KEY_COL(), CONNECTION_LABEL_COL(), cond::CredentialData::connectionKey, runEdmFileComparison::found, cond::CredentialData::id, cond::CredentialData::password, PASSWORD_COL(), das::query(), AlCaHLTBitMon_QueryRunRegistry::string, cond::CredentialData::userName, USERNAME_COL(), VERIFICATION_KEY_COL(), and cond::CredentialData::verificationKey.

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

257  {
258 
259  std::auto_ptr<coral::IQuery> query(schema.tableHandle(COND_CREDENTIAL_TABLE).newQuery());
260  coral::AttributeList readBuff;
261  readBuff.extend<int>( CONNECTION_ID_COL );
262  readBuff.extend<std::string>( USERNAME_COL );
263  readBuff.extend<std::string>( PASSWORD_COL );
264  readBuff.extend<std::string>( VERIFICATION_KEY_COL );
265  readBuff.extend<std::string>( CONNECTION_KEY_COL );
266  coral::AttributeList whereData;
267  whereData.extend<std::string>( CONNECTION_LABEL_COL );
268  whereData[ CONNECTION_LABEL_COL ].data<std::string>() = connectionLabel;
269  std::string whereClause = CONNECTION_LABEL_COL + " = :" + CONNECTION_LABEL_COL;
270  query->defineOutput(readBuff);
271  query->addToOutputList( CONNECTION_ID_COL );
272  query->addToOutputList( USERNAME_COL );
273  query->addToOutputList( PASSWORD_COL );
274  query->addToOutputList( VERIFICATION_KEY_COL );
275  query->addToOutputList( CONNECTION_KEY_COL );
276  query->setCondition( whereClause, whereData );
277  coral::ICursor& cursor = query->execute();
278  bool found = false;
279  if ( cursor.next() ) {
280  const coral::AttributeList& row = cursor.currentRow();
281  destination.id = row[ CONNECTION_ID_COL].data<int>();
282  destination.userName = row[ USERNAME_COL].data<std::string>();
283  destination.password = row[ PASSWORD_COL].data<std::string>();
284  destination.verificationKey = row[ VERIFICATION_KEY_COL].data<std::string>();
285  destination.connectionKey = row[ CONNECTION_KEY_COL].data<std::string>();
286  found = true;
287  }
288  return found;
289  }
static const std::string PASSWORD_COL("CRED5")
def query(query_str, verbose=False)
Definition: das.py:5
static const std::string COND_CREDENTIAL_TABLE("COND_CREDENTIAL")
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")
static const std::string CONNECTION_LABEL_COL("CONN_LABEL")
bool cond::selectPrincipal ( coral::ISchema &  schema,
const std::string &  principal,
PrincipalData destination 
)

Definition at line 213 of file CredentialStore.cc.

References ADMIN_KEY_COL(), cond::PrincipalData::adminKey, COND_AUTHENTICATION_TABLE(), runEdmFileComparison::found, cond::PrincipalData::id, PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), cond::PrincipalData::principalKey, das::query(), AlCaHLTBitMon_QueryRunRegistry::string, VERIFICATION_COL(), and cond::PrincipalData::verifKey.

Referenced by cond::CredentialStore::importForPrincipal(), cond::CredentialStore::installAdmin(), cond::CredentialStore::removePrincipal(), cond::CredentialStore::setPermission(), cond::CredentialStore::startSession(), cond::CredentialStore::unsetPermission(), and cond::CredentialStore::updatePrincipal().

213  {
214  std::auto_ptr<coral::IQuery> query(schema.tableHandle(COND_AUTHENTICATION_TABLE).newQuery());
215  coral::AttributeList readBuff;
216  readBuff.extend<int>(PRINCIPAL_ID_COL);
217  readBuff.extend<std::string>(VERIFICATION_COL);
218  readBuff.extend<std::string>(PRINCIPAL_KEY_COL);
219  readBuff.extend<std::string>(ADMIN_KEY_COL);
220  coral::AttributeList whereData;
221  whereData.extend<std::string>(PRINCIPAL_NAME_COL);
222  whereData[ PRINCIPAL_NAME_COL ].data<std::string>() = principal;
223  std::string whereClause = PRINCIPAL_NAME_COL + " = :" + PRINCIPAL_NAME_COL;
224  query->defineOutput(readBuff);
225  query->addToOutputList( PRINCIPAL_ID_COL );
226  query->addToOutputList( VERIFICATION_COL );
227  query->addToOutputList( PRINCIPAL_KEY_COL );
228  query->addToOutputList( ADMIN_KEY_COL );
229  query->setCondition( whereClause, whereData );
230  coral::ICursor& cursor = query->execute();
231  bool found = false;
232  if ( cursor.next() ) {
233  found = true;
234  const coral::AttributeList& row = cursor.currentRow();
235  destination.id = row[ PRINCIPAL_ID_COL ].data<int>();
236  destination.verifKey = row[ VERIFICATION_COL ].data<std::string>();
237  destination.principalKey = row[ PRINCIPAL_KEY_COL ].data<std::string>();
238  destination.adminKey = row[ ADMIN_KEY_COL ].data<std::string>();
239  }
240  return found;
241  }
static const std::string COND_AUTHENTICATION_TABLE("COND_AUTHENTICATION")
def query(query_str, verbose=False)
Definition: das.py:5
Definition: query.py:1
def principal(options)
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")
static const std::string PRINCIPAL_NAME_COL("P_NAME")
template<typename T >
std::pair<Binary,Binary> cond::serialize ( const T payload)

Definition at line 62 of file Serialization.h.

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

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

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

Definition at line 50 of file Types.cc.

References mps_fire::i, and throwException().

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

50  {
51  for (auto const &i : s_synchronizationTypeArray)
52  if (name.compare(i.first)==0) return i.second;
53  for (auto const &i : s_obsoleteSynchronizationTypeArray)
54  if (name.compare(i.first)==0) return i.second;
55  throwException( "SynchronizationType \""+name+"\" is unknown.","synchronizationTypeFromName");
56  }
static std::pair< const char *, SynchronizationType > s_synchronizationTypeArray[]
Definition: Types.cc:32
static std::pair< const char *, SynchronizationType > s_obsoleteSynchronizationTypeArray[]
Definition: Types.cc:42
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
std::string cond::synchronizationTypeNames ( SynchronizationType  type)

Definition at line 46 of file Types.cc.

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

46  {
47  return s_synchronizationTypeArray[type].first;
48  }
type
Definition: HCALResponse.h:21
static std::pair< const char *, SynchronizationType > s_synchronizationTypeArray[]
Definition: Types.cc:32
void cond::throwException ( const std::string &  message,
const std::string &  methodName 
)

Definition at line 21 of file Exception.cc.

References cond::persistency::Exception::Exception().

Referenced by cond::service::PoolDBOutputService::appendSinceTime(), cond::auth::Cipher::b64decrypt(), cond::service::PoolDBOutputService::closeIOV(), cond::auth::DecodingKey::createFromInputFile(), cond::service::PoolDBOutputService::createNewIOV(), 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::auth::DecodingKey::flush(), cond::persistency::getConnectionParams(), getLoginName(), cond::CredentialStore::importForPrincipal(), cond::persistency::importPayload(), cond::auth::DecodingKey::init(), cond::service::PoolDBOutputService::initDB(), cond::CredentialStore::installAdmin(), cond::persistency::KeyList::load(), cond::persistency::IOVEditor::load(), cond::service::PoolDBOutputService::lookUpRecord(), cond::CredentialStore::removeConnection(), cond::CredentialStore::removePrincipal(), serialize(), cond::CredentialStore::setPermission(), cond::CredentialStore::setUpForService(), cond::Binary::size(), synchronizationTypeFromName(), cond::CredentialStore::unsetPermission(), and cond::CredentialStore::updatePrincipal().

22  {
23  throw Exception( message, methodName );
24  }
const Time_t cond::TIMELIMIT ( std::numeric_limits< Time_t ::max())
std::string const & cond::timeTypeNames ( int  i)

Definition at line 15 of file Time.cc.

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

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

15  {
16  static const std::string local[]=
17  {"runnumber","timestamp","lumiid","hash","userid"};
18  return local[i];
19  }

Variable Documentation

constexpr unsigned int cond::HASH_SIZE = 40
static

Definition at line 46 of file Types.h.

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 42 of file Types.cc.

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 32 of file Types.cc.

const unsigned int cond::TIMETYPE_LIST_MAX =5

Definition at line 22 of file Time.h.

Referenced by findSpecs().

const cond::TimeType cond::timeTypeList
Initial value:

Definition at line 9 of file Time.cc.

const TimeTypeSpecs cond::timeTypeSpecs
const cond::TimeType cond::timeTypeValues
Initial value:

Definition at line 12 of file Time.cc.