00001 #include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabaseImpl.hh"
00002
00003 namespace hcal {
00004
00005 ConfigurationDatabaseImpl::ConfigurationDatabaseImpl() : m_logger(log4cplus::Logger::getInstance("hcal_ConfigurationDatabaseImpl")) {
00006 }
00007
00008 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) {
00009 std::string::size_type start,end;
00010
00011 method.clear(); host.clear(); port.clear(); user.clear(); db.clear(); params.clear();
00012
00013 if (accessor.empty()) return;
00014
00015
00016 start=0;
00017 end=accessor.find("://");
00018 if (end==std::string::npos) return;
00019
00020 method=accessor.substr(start,end-start);
00021 start=end+3;
00022
00023 end=accessor.find('@',start);
00024 if (end!=std::string::npos) {
00025 user=accessor.substr(start,end-start);
00026 start=end+1;
00027 }
00028
00029 end=accessor.find(':',start);
00030 if (end!=std::string::npos) {
00031 host=accessor.substr(start,end-start);
00032 start=end+1;
00033 }
00034
00035 end=accessor.find('/',start);
00036 if (end==std::string::npos) return;
00037 if (host.empty()) host=accessor.substr(start,end-start);
00038 else port=accessor.substr(start,end-start);
00039 start=end+1;
00040
00041 end=accessor.find('?',start);
00042 if (end==std::string::npos) {
00043 db=accessor.substr(start);
00044 return;
00045 } else db=accessor.substr(start,end-start);
00046 start=end;
00047
00048
00049 std::string pname,pvalue;
00050 while (start!=std::string::npos) {
00051 start+=1;
00052 end=accessor.find('=',start);
00053 if (end==std::string::npos) break;
00054 pname=accessor.substr(start,end-start);
00055 start=end+1;
00056 end=accessor.find_first_of(",&",start);
00057 if (end==std::string::npos) {
00058 pvalue=accessor.substr(start);
00059 } else {
00060 pvalue=accessor.substr(start,end-start);
00061 }
00062 params[pname]=pvalue;
00063 start=end;
00064 }
00065 }
00066
00067 std::vector<std::string> ConfigurationDatabaseImpl::getValidTags() throw (hcal::exception::ConfigurationDatabaseException) {
00068 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00069 }
00070 ConfigurationDatabase::ApplicationConfig ConfigurationDatabaseImpl::getApplicationConfig(const std::string& tag, const std::string& classname, int instance) throw (hcal::exception::ConfigurationDatabaseException) {
00071 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00072 }
00073
00074 std::string ConfigurationDatabaseImpl::getConfigurationDocument(const std::string& tag) throw (hcal::exception::ConfigurationDatabaseException) {
00075 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00076 }
00077
00078 unsigned int ConfigurationDatabaseImpl::getFirmwareChecksum(const std::string& board, unsigned int version) throw (hcal::exception::ConfigurationDatabaseException) {
00079 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00080 }
00081
00082 void ConfigurationDatabaseImpl::getFirmwareMCS(const std::string& board, unsigned int version, std::vector<std::string>& mcsLines) throw (hcal::exception::ConfigurationDatabaseException) {
00083 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00084 }
00085 void ConfigurationDatabaseImpl::getLUTs(const std::string& tag,int crate, int slot, std::map<ConfigurationDatabase::LUTId, ConfigurationDatabase::LUT >& LUTs) throw (hcal::exception::ConfigurationDatabaseException) {
00086 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00087 }
00088 void ConfigurationDatabaseImpl::getLUTChecksums(const std::string& tag, std::map<ConfigurationDatabase::LUTId, ConfigurationDatabase::MD5Fingerprint>& checksums) throw (hcal::exception::ConfigurationDatabaseException) {
00089 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00090 }
00091 void ConfigurationDatabaseImpl::getPatterns(const std::string& tag, int crate, int slot, std::map<ConfigurationDatabase::PatternId, ConfigurationDatabase::HTRPattern>& patterns) throw (hcal::exception::ConfigurationDatabaseException) {
00092 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00093 }
00094 void ConfigurationDatabaseImpl::getZSThresholds(const std::string& tag, int crate, int slot, std::map<ConfigurationDatabase::ZSChannelId, int>& thresholds) throw (hcal::exception::ConfigurationDatabaseException) {
00095 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00096 }
00097 void ConfigurationDatabaseImpl::getHLXMasks(const std::string& tag, int crate, int slot, std::map<ConfigurationDatabase::FPGAId, ConfigurationDatabase::HLXMasks>& masks) throw (hcal::exception::ConfigurationDatabaseException) {
00098 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00099 }
00100 void ConfigurationDatabaseImpl::getRBXdata(const std::string& tag,
00101 const std::string& rbx,
00102 ConfigurationDatabase::RBXdatumType dtype,
00103 std::map<ConfigurationDatabase::RBXdatumId, ConfigurationDatabase::RBXdatum>& RBXdata)
00104 throw (hcal::exception::ConfigurationDatabaseException) {
00105 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00106 }
00107 void ConfigurationDatabaseImpl::getRBXpatterns(const std::string& tag,
00108 const std::string& rbx,
00109 std::map<ConfigurationDatabase::RBXdatumId, ConfigurationDatabase::RBXpattern>& patterns)
00110 throw (hcal::exception::ConfigurationDatabaseException) {
00111 XCEPT_RAISE(hcal::exception::ConfigurationDatabaseException,"Not implemented");
00112 }
00113
00114
00115 oracle::occi::Connection * ConfigurationDatabaseImpl::getConnection( void ){
00116 return NULL;
00117 }
00118
00119 oracle::occi::Environment * ConfigurationDatabaseImpl::getEnvironment( void ){
00120 return NULL;
00121 }
00122
00123 }