test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
cond Namespace Reference

Namespaces

 auth
 
 persistency
 
 RelationalAuthenticationService
 
 serialization
 
 service
 
 time
 
 utilities
 
 XMLAuthenticationService
 

Classes

struct  AuthorizationData
 
class  BaseKeyed
 
class  BasicPayload
 
class  Binary
 
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 >
 
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 ora::Guid Guid
 
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<typename T >
boost::shared_ptr< Tdefault_deserialize (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<typename T >
boost::shared_ptr< Tdeserialize (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
boost::shared_ptr< BaseKeyeddeserialize< BaseKeyed > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
boost::shared_ptr
< condex::Efficiency
deserialize< condex::Efficiency > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
boost::shared_ptr
< CSCReadoutMapping
deserialize< CSCReadoutMapping > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
boost::shared_ptr
< CSCReadoutMappingForSliceTest
deserialize< CSCReadoutMappingForSliceTest > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
template<>
boost::shared_ptr
< PerformancePayload
deserialize< PerformancePayload > (const std::string &payloadType, const Binary &payloadData, const Binary &streamerInfoData)
 
const TimeTypeSpecsfindSpecs (std::string const &name)
 
void * genMD5 (void *buffer, unsigned long len, void *code)
 
void genMD5 (const std::string &s, void *code)
 
void genMD5 (const string &s, void *code)
 
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)
 
std::pair< std::string, int > parseToken (const std::string &objectId)
 
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)
 
std::string writeToken (const std::string &containerName, int oid0, int oid1, const std::string &className)
 
std::string writeTokenContainerFragment (const std::string &containerName, const std::string &className)
 

Variables

static const char * fmt_oid = "[OID=%08X-%08X]"
 
static const char * fmt_tech = "[TECH=%08X]"
 
static constexpr unsigned int HASH_SIZE = 40
 
static std::pair< const char
*, SynchronizationType
s_obsoleteSynchronizationTypeArray []
 
static std::pair< const char
*, SynchronizationType
s_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 50 of file Serialization.h.

Definition at line 51 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.

Definition at line 26 of file Guid.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 79 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.

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.

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  }
long double T
template<typename T >
T* cond::createPayload ( const std::string &  payloadTypeName)

Definition at line 30 of file Serialization.h.

References ora::ClassUtils::demangledName(), 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  }
std::string demangledName(const std::type_info &typeInfo)
Definition: ClassUtils.cc:159
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 34 of file plugin.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and throwException().

34  {
35  if( payloadTypeName == "HcalCalibrationQIEData" ) return new HcalCalibrationQIEData(0);
36  throwException(std::string("Type mismatch, target object is type \"")+payloadTypeName+"\"",
37  "createPayload" );
38  }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<typename T >
boost::shared_ptr<T> cond::default_deserialize ( const std::string &  payloadType,
const Binary &  payloadData,
const Binary &  streamerInfoData 
)

Definition at line 73 of file Serialization.h.

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

75  {
76  boost::shared_ptr<T> payload;
77  std::stringbuf sstreamerInfoBuf;
78  sstreamerInfoBuf.pubsetbuf( static_cast<char*>(const_cast<void*>(streamerInfoData.data())), streamerInfoData.size() );
79  std::string streamerInfo = sstreamerInfoBuf.str();
80  try{
81  std::stringbuf sdataBuf;
82  sdataBuf.pubsetbuf( static_cast<char*>(const_cast<void*>(payloadData.data())), payloadData.size() );
83  std::istream dataBuffer( &sdataBuf );
84  CondInputArchive ia( dataBuffer );
85  payload.reset( createPayload<T>(payloadType) );
86  ia >> (*payload);
87  } catch ( const std::exception& e ){
88  std::string errorMsg("De-serialization failed: ");
89  std::string em( e.what() );
90  if( em == "unsupported version" ) {
91  errorMsg += "the current boost version ("+StreamerInfo::techVersion()+
92  ") is unable to read the payload. Data might have been serialized with an incompatible version.";
93  } else if( em == "input stream error" ) {
94  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.";
95  } else {
96  errorMsg += em;
97  }
98  if( !streamerInfo.empty() ) errorMsg += " Payload serialization info: "+streamerInfo;
99  throwException( errorMsg, "default_deserialize" );
100  }
101  return payload;
102  }
cond::serialization::InputArchive CondInputArchive
Definition: Serialization.h:50
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<typename T >
boost::shared_ptr<T> cond::deserialize ( const std::string &  payloadType,
const Binary &  payloadData,
const Binary &  streamerInfoData 
)

Definition at line 105 of file Serialization.h.

References HLT_25ns10e33_v2_cff::payloadType.

107  {
108  return default_deserialize<T>( payloadType, payloadData, streamerInfoData );
109  }
template<>
boost::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, HLT_25ns10e33_v2_cff::payloadType, 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<>
boost::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, HLT_25ns10e33_v2_cff::payloadType, 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<>
boost::shared_ptr<CSCReadoutMapping> cond::deserialize< CSCReadoutMapping > ( const std::string &  payloadType,
const Binary &  payloadData,
const Binary &  streamerInfoData 
)

Definition at line 64 of file plugin.cc.

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

66  {
67  // DESERIALIZE_BASE_CASE( CSCReadoutMapping ); abstract
69  // here we come if none of the deserializations above match the payload type:
70  throwException(std::string("Type mismatch, target object is type \"")+payloadType+"\"", "deserialize<>" );
71  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<>
boost::shared_ptr<CSCReadoutMappingForSliceTest> cond::deserialize< CSCReadoutMappingForSliceTest > ( const std::string &  payloadType,
const Binary &  payloadData,
const Binary &  streamerInfoData 
)

Definition at line 72 of file plugin.cc.

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

74  {
75  // DESERIALIZE_BASE_CASE( CSCReadoutMappingForSliceTest ); abstract
77  // here we come if none of the deserializations above match the payload type:
78  throwException(std::string("Type mismatch, target object is type \"")+payloadType+"\"", "deserialize<>" );
79  }
#define DESERIALIZE_POLIMORPHIC_CASE(BASETYPENAME, DERIVEDTYPENAME)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
template<>
boost::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, HLT_25ns10e33_v2_cff::payloadType, 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, i, TIMETYPE_LIST_MAX, and timeTypeSpecs.

Referenced by 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
int i
Definition: DBlmapReader.cc:9
const unsigned int TIMETYPE_LIST_MAX
Definition: Time.h:22
void * cond::genMD5 ( void *  buffer,
unsigned long  len,
void *  code 
)

Definition at line 358 of file GenMD5.cc.

Referenced by writeTokenContainerFragment().

358  {
359  MD5 checkSum((unsigned char*)buffer, len);
360  checkSum.raw_digest((unsigned char*)code);
361  return code;
362  }
void cond::genMD5 ( const std::string &  s,
void *  code 
)
void cond::genMD5 ( const string &  s,
void *  code 
)

Definition at line 363 of file GenMD5.cc.

363  {
364  MD5 checkSum((unsigned char*)s.c_str(), s.length());
365  checkSum.raw_digest((unsigned char*)code);
366  }
std::string cond::getLoginName ( )

Definition at line 41 of file DecodingKey.cc.

References visualization-live-secondInstance_cfg::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, testEve_cfg::level, and mix64.

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

49  {
50  register 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
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
tuple level
Definition: testEve_cfg.py:34
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, runTheMatrix::ret, and cond::Iov_t::since.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 57 of file DecodingKey.cc.

References ItemSeparator, 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
std::pair< std::string, int > cond::parseToken ( const std::string &  objectId)

Definition at line 16 of file PoolToken.cc.

References fmt_oid, p1, p2, p3, source, AlCaHLTBitMon_QueryRunRegistry::string, ora::throwException(), and tmp.

Referenced by ora::CondMetadataTable::getObjectByName().

16  {
17  if( source.empty() ) ora::throwException("Provided token is empty.","PoolToken::parseToken");
19  std::pair<std::string,int> oid;
20  oid.first = "";
21  oid.second = -1;
22  for(char* p1 = (char*)tmp.c_str(); p1; p1 = ::strchr(++p1,'[')) {
23  char* p2 = ::strchr(p1, '=');
24  char* p3 = ::strchr(p1, ']');
25  if ( p2 && p3 ) {
26  char* val = p2+1;
27  if ( ::strncmp("[DB=", p1, 4) == 0 ) {
28  *p3 = 0;
29  } else if ( ::strncmp("[CNT=", p1, 5) == 0 ) {
30  *p3 = 0;
31  oid.first = val;
32  } else if ( ::strncmp(fmt_oid, p1, 5) == 0 ) {
33  int nn;
34  ::sscanf(p1, fmt_oid, &nn, &oid.second);
35  } else {
36  *p3 = *p2 = 0;
37  }
38  *p3 = ']';
39  *p2 = '=';
40  }
41  }
42  return oid;
43  }
static const char * fmt_oid
Definition: PoolToken.cc:14
double p2[4]
Definition: TauolaWrapper.h:90
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
double p1[4]
Definition: TauolaWrapper.h:89
static std::string const source
Definition: EdmProvDump.cc:43
double p3[4]
Definition: TauolaWrapper.h:91
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 runTheMatrix::ret, 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  }
tuple ret
prodAgent to be discontinued
static const std::string serviceName
std::string cond::schemaLabelForCredentialStore ( const std::string &  connectionString)

Definition at line 172 of file CredentialStore.cc.

References mps_alisetup::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)
string connectionString
Definition: autoCondHLT.py:4
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, newFWLiteAna::found, cond::AuthorizationData::id, cond::AuthorizationData::key, P_ID_COL(), o2o::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")
tuple schema
Definition: dataDML.py:2334
static const std::string SCHEMA_COL("C_SCHEMA")
static const std::string COND_AUTHORIZATION_TABLE("COND_AUTHORIZATION")
string connectionString
Definition: autoCondHLT.py:4
static const std::string AUTH_ID_COL("AUTH_ID")
tuple query
Definition: o2o.py:269
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, newFWLiteAna::found, cond::CredentialData::id, cond::CredentialData::password, PASSWORD_COL(), o2o::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  }
tuple schema
Definition: dataDML.py:2334
static const std::string PASSWORD_COL("CRED5")
static const std::string COND_CREDENTIAL_TABLE("COND_CREDENTIAL")
static const std::string CONNECTION_KEY_COL("CRED7")
static const std::string VERIFICATION_KEY_COL("CRED6")
static const std::string USERNAME_COL("CRED4")
static const std::string CONNECTION_ID_COL("CONN_ID")
tuple query
Definition: o2o.py:269
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(), newFWLiteAna::found, cond::PrincipalData::id, PRINCIPAL_ID_COL(), PRINCIPAL_KEY_COL(), PRINCIPAL_NAME_COL(), cond::PrincipalData::principalKey, o2o::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  }
tuple schema
Definition: dataDML.py:2334
static const std::string COND_AUTHENTICATION_TABLE("COND_AUTHENTICATION")
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")
tuple query
Definition: o2o.py:269
static const std::string PRINCIPAL_NAME_COL("P_NAME")
template<typename T >
std::pair<Binary,Binary> cond::serialize ( const T payload)

Definition at line 54 of file Serialization.h.

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

Referenced by cond::persistency::Session::storePayload(), and RawEventFileWriterForBU::writeJsds().

54  {
55  std::pair<Binary,Binary> ret;
56  std::string streamerInfo( StreamerInfo::jsonString() );
57  try{
58  // save data to buffers
59  std::ostringstream dataBuffer;
60  CondOutputArchive oa( dataBuffer );
61  oa << payload;
62  //TODO: avoid (2!!) copies
63  ret.first.copy( dataBuffer.str() );
64  ret.second.copy( streamerInfo );
65  } catch ( const std::exception& e ){
66  std::string em( e.what() );
67  throwException("Serialization failed: "+em+". Serialization info:"+streamerInfo,"serialize");
68  }
69  return ret;
70  }
tuple ret
prodAgent to be discontinued
cond::serialization::OutputArchive CondOutputArchive
Definition: Serialization.h:51
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 citk::for(), i, s_obsoleteSynchronizationTypeArray, s_synchronizationTypeArray, 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;
54  if (name.compare(i.first)==0) return i.second;
55  throwException( "SynchronizationType \""+name+"\" is unknown.","synchronizationTypeFromName");
56  }
int i
Definition: DBlmapReader.cc:9
static std::pair< const char *, SynchronizationType > s_synchronizationTypeArray[]
Definition: Types.cc:32
static std::pair< const char *, SynchronizationType > s_obsoleteSynchronizationTypeArray[]
Definition: Types.cc:42
for(const auto &isodef:isoDefs)
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.

References s_synchronizationTypeArray.

Referenced by cond::persistency::IOVEditor::flush().

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.

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 >(), 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::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(), cond::CredentialStore::updatePrincipal(), and cond::service::PoolDBOutputService::writeOne().

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 i, 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  }
int i
Definition: DBlmapReader.cc:9
std::string cond::writeToken ( const std::string &  containerName,
int  oid0,
int  oid1,
const std::string &  className 
)

Definition at line 45 of file PoolToken.cc.

References fmt_oid, AlCaHLTBitMon_QueryRunRegistry::string, runonSM::text, and writeTokenContainerFragment().

Referenced by ora::CondMetadataTable::getNamesForObject(), and ora::CondMetadataTable::setObjectName().

48  {
49  std::string str = writeTokenContainerFragment( containerName, className );
50  char text[128];
51  ::sprintf(text, fmt_oid, oid0, oid1);
52  str += text;
53  return str;
54  }
static const char * fmt_oid
Definition: PoolToken.cc:14
std::string writeTokenContainerFragment(const std::string &containerName, const std::string &className)
Definition: PoolToken.cc:56
tuple text
Definition: runonSM.py:42
std::string className(const T &t)
Definition: ClassName.h:30
std::string cond::writeTokenContainerFragment ( const std::string &  containerName,
const std::string &  className 
)

Definition at line 56 of file PoolToken.cc.

References edm::TypeWithDict::byName(), fmt_tech, genMD5(), ora::ClassUtils::getClassProperty(), ora::Guid::null(), AlCaHLTBitMon_QueryRunRegistry::string, runonSM::text, and ora::Guid::toString().

Referenced by ora::CondMetadataTable::getNamesForContainer(), and writeToken().

57  {
58 
59  char buff[20];
60  std::string clguid("");
61  // first lookup the class guid in the dictionary
63  if( containerType ){
64  clguid = ora::ClassUtils::getClassProperty( std::string("ClassID"),containerType );
65  }
66  // if not found, generate one...
67  if( clguid.empty() ){
68  genMD5(className,buff);
69  Guid* gd = reinterpret_cast<Guid*>(buff);
70  clguid = gd->toString();
71  }
72  int tech = 0xB01;
73  char text[128];
74  std::string str = "[DB="+Guid::null()+"][CNT=" + containerName + "][CLID="+clguid+"]";
75  ::sprintf(text, fmt_tech, tech);
76  str += text;
77  return str;
78  }
std::string toString() const
Definition: Guid.cc:27
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
static const char * fmt_tech
Definition: PoolToken.cc:13
void * genMD5(void *buffer, unsigned long len, void *code)
Definition: GenMD5.cc:358
tuple text
Definition: runonSM.py:42
std::string getClassProperty(const std::string &propertyName, const edm::TypeWithDict &type)
Definition: ClassUtils.cc:500
ora::Guid Guid
Definition: Guid.h:26
std::string className(const T &t)
Definition: ClassName.h:30

Variable Documentation

const char* cond::fmt_oid = "[OID=%08X-%08X]"
static

Definition at line 14 of file PoolToken.cc.

Referenced by parseToken(), and writeToken().

const char* cond::fmt_tech = "[TECH=%08X]"
static

Definition at line 13 of file PoolToken.cc.

Referenced by writeTokenContainerFragment().

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.

Referenced by synchronizationTypeFromName().

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.

Referenced by synchronizationTypeFromName(), and synchronizationTypeNames().

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.