CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConfigurationDatabaseImpl.cc
Go to the documentation of this file.
1 #include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabaseImpl.hh"
2 
3 #ifndef HAVE_XDAQ
4 #include "CaloOnlineTools/HcalOnlineDb/interface/xdaq_compat.h" // Includes typedef for log4cplus::Logger
5 #endif
6 
7 #include <iostream> // std::cout
8 
9 namespace hcal {
10 
11 ConfigurationDatabaseImpl::ConfigurationDatabaseImpl() : m_logger(&std::cout) {
12  }
13 
14  void ConfigurationDatabaseImpl::parseAccessor(const std::string& accessor, std::string& method, std::string& host, std::string& port, std::string& user, std::string& db, std::map<std::string,std::string>& params) {
16 
17  method.clear(); host.clear(); port.clear(); user.clear(); db.clear(); params.clear();
18 
19  if (accessor.empty()) return;
20 
21  // method
22  start=0;
23  end=accessor.find("://");
24  if (end==std::string::npos) return;
25 
26  method=accessor.substr(start,end-start);
27  start=end+3; // skip past ://
28 
29  end=accessor.find('@',start); // user?
30  if (end!=std::string::npos) {
31  user=accessor.substr(start,end-start);
32  start=end+1;
33  }
34 
35  end=accessor.find(':',start); // port?
36  if (end!=std::string::npos) {
37  host=accessor.substr(start,end-start); // host is here, port is next
38  start=end+1;
39  }
40 
41  end=accessor.find('/',start); // port or host
42  if (end==std::string::npos) return; // problems...
43  if (host.empty()) host=accessor.substr(start,end-start);
44  else port=accessor.substr(start,end-start);
45  start=end+1;
46 
47  end=accessor.find('?',start); // database
48  if (end==std::string::npos) {
49  db=accessor.substr(start);
50  return;
51  } else db=accessor.substr(start,end-start);
52  start=end; // beginning of the parameters
53 
54  // parameters
55  std::string pname,pvalue;
56  while (start!=std::string::npos) {
57  start+=1;
58  end=accessor.find('=',start);
59  if (end==std::string::npos) break; // no equals
60  pname=accessor.substr(start,end-start);
61  start=end+1;
62  end=accessor.find_first_of(",&",start);
63  if (end==std::string::npos) {
64  pvalue=accessor.substr(start);
65  } else {
66  pvalue=accessor.substr(start,end-start);
67  }
68  params[pname]=pvalue;
69  start=end;
70  }
71  }
72 
73  std::vector<std::string> ConfigurationDatabaseImpl::getValidTags() throw (hcal::exception::ConfigurationDatabaseException) {
74  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
75  }
76  ConfigurationDatabase::ApplicationConfig ConfigurationDatabaseImpl::getApplicationConfig(const std::string& tag, const std::string& classname, int instance) throw (hcal::exception::ConfigurationDatabaseException) {
77  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
78  }
79 
80  std::string ConfigurationDatabaseImpl::getConfigurationDocument(const std::string& tag) throw (hcal::exception::ConfigurationDatabaseException) {
81  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
82  }
83 
84  unsigned int ConfigurationDatabaseImpl::getFirmwareChecksum(const std::string& board, unsigned int version) throw (hcal::exception::ConfigurationDatabaseException) {
85  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
86  }
87 
88  void ConfigurationDatabaseImpl::getFirmwareMCS(const std::string& board, unsigned int version, std::vector<std::string>& mcsLines) throw (hcal::exception::ConfigurationDatabaseException) {
89  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
90  }
91  void ConfigurationDatabaseImpl::getLUTs(const std::string& tag,int crate, int slot, std::map<ConfigurationDatabase::LUTId, ConfigurationDatabase::LUT >& LUTs) throw (hcal::exception::ConfigurationDatabaseException) {
92  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
93  }
94  void ConfigurationDatabaseImpl::getLUTChecksums(const std::string& tag, std::map<ConfigurationDatabase::LUTId, ConfigurationDatabase::MD5Fingerprint>& checksums) throw (hcal::exception::ConfigurationDatabaseException) {
95  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
96  }
97  void ConfigurationDatabaseImpl::getPatterns(const std::string& tag, int crate, int slot, std::map<ConfigurationDatabase::PatternId, ConfigurationDatabase::HTRPattern>& patterns) throw (hcal::exception::ConfigurationDatabaseException) {
98  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
99  }
100  void ConfigurationDatabaseImpl::getZSThresholds(const std::string& tag, int crate, int slot, std::map<ConfigurationDatabase::ZSChannelId, int>& thresholds) throw (hcal::exception::ConfigurationDatabaseException) {
101  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
102  }
103  void ConfigurationDatabaseImpl::getHLXMasks(const std::string& tag, int crate, int slot, std::map<ConfigurationDatabase::FPGAId, ConfigurationDatabase::HLXMasks>& masks) throw (hcal::exception::ConfigurationDatabaseException) {
104  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
105  }
106  void ConfigurationDatabaseImpl::getRBXdata(const std::string& tag,
107  const std::string& rbx,
108  ConfigurationDatabase::RBXdatumType dtype,
109  std::map<ConfigurationDatabase::RBXdatumId, ConfigurationDatabase::RBXdatum>& RBXdata)
110  throw (hcal::exception::ConfigurationDatabaseException) {
111  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
112  }
113  void ConfigurationDatabaseImpl::getRBXpatterns(const std::string& tag,
114  const std::string& rbx,
115  std::map<ConfigurationDatabase::RBXdatumId, ConfigurationDatabase::RBXpattern>& patterns)
116  throw (hcal::exception::ConfigurationDatabaseException) {
117  XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
118  }
119 
120  // added by Gena Kukartsev
121  oracle::occi::Connection * ConfigurationDatabaseImpl::getConnection( void ){
122  return NULL;
123  }
124 
125  oracle::occi::Environment * ConfigurationDatabaseImpl::getEnvironment( void ){
126  return NULL;
127  }
128 
129 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
static PFTauRenderPlugin instance
dictionary thresholds
Definition: fff_deleter.py:273
tuple db
Definition: EcalCondDB.py:151
#define NULL
Definition: scimark2.h:8
uint16_t size_type
int port
Definition: query.py:115
#define end
Definition: vmac.h:37
string host
Definition: query.py:114
tuple cout
Definition: gather_cfg.py:121
static const uint32_t masks[]
Definition: CaloRecHit.cc:12