Public Member Functions | Protected Attributes | List of all members
nutools::dbi::DBIService Class Reference

Simple service to provide a RunHistory configured to the right run. More...

#include <DBIService.h>

Inheritance diagram for nutools::dbi::DBIService:
evdb::Reconfigurable

Public Member Functions

 DBIService (const fhicl::ParameterSet &pset)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
TableCreateTable (std::string tableName="", std::string schemaName="", int tableType=nutools::dbi::kConditionsTable, int dataSource=nutools::dbi::kOffline)
 
- Public Member Functions inherited from evdb::Reconfigurable
 Reconfigurable (fhicl::ParameterSet const &ps)
 
void do_reconfigure (fhicl::ParameterSet const &pset)
 

Protected Attributes

int fVerbosity
 
bool fTimeQueries
 
bool fTimeParsing
 
std::string fWebServiceURL
 
std::string fQueryEngineURL
 
std::string fDBUser
 

Detailed Description

Simple service to provide a RunHistory configured to the right run.

Definition at line 25 of file DBIService.h.

Constructor & Destructor Documentation

nutools::dbi::DBIService::DBIService ( const fhicl::ParameterSet pset)

Definition at line 18 of file DBI_service.cc.

18  : evdb::Reconfigurable{pset}
19  {
20  reconfigure(pset);
21  }
void reconfigure(const fhicl::ParameterSet &pset)
Definition: DBI_service.cc:24

Member Function Documentation

Table * nutools::dbi::DBIService::CreateTable ( std::string  tableName = "",
std::string  schemaName = "",
int  tableType = nutools::dbi::kConditionsTable,
int  dataSource = nutools::dbi::kOffline 
)

Definition at line 36 of file DBI_service.cc.

39  {
40  if (tableName.empty()) return 0;
41 
42  Table* t = new nutools::dbi::Table();
43  t->SetTableName(tableName);
44  t->SetDetector(schemaName);
45  if (tableType < 0 || tableType >= nutools::dbi::kNTableType)
46  t->SetTableType(nutools::dbi::kConditionsTable);
47  if (dataSource < 0 || dataSource >= nutools::dbi::kNDataSources)
48  t->SetDataSource(nutools::dbi::kOffline);
49 
50  t->SetVerbosity(fVerbosity);
51  t->SetTimeQueries(fTimeQueries);
52  t->SetTimeParsing(fTimeParsing);
53  if (!fWebServiceURL.empty())
54  t->SetWSURL(fWebServiceURL);
55  if (!fQueryEngineURL.empty())
56  t->SetQEURL(fQueryEngineURL);
57 
58  if (!fDBUser.empty())
59  t->SetUser(fDBUser);
60 
61  return t;
62  }
std::string fQueryEngineURL
Definition: DBIService.h:44
std::string fWebServiceURL
Definition: DBIService.h:43
std::string tableName
void nutools::dbi::DBIService::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 24 of file DBI_service.cc.

25  {
26  fVerbosity = pset.get< int >("Verbosity",0);
27  fTimeQueries = pset.get< bool >("TimeQueries", false);
28  fTimeParsing = pset.get< bool >("TimeParsing", false);
29 
30  fWebServiceURL = pset.get< std::string >("WebServiceURL");
31  fQueryEngineURL = pset.get< std::string >("QueryEngineURL");
32  fDBUser = pset.get< std::string >("DBUser");
33  }
std::string string
Definition: nybbler.cc:12
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fQueryEngineURL
Definition: DBIService.h:44
std::string fWebServiceURL
Definition: DBIService.h:43

Member Data Documentation

std::string nutools::dbi::DBIService::fDBUser
protected

Definition at line 45 of file DBIService.h.

std::string nutools::dbi::DBIService::fQueryEngineURL
protected

Definition at line 44 of file DBIService.h.

bool nutools::dbi::DBIService::fTimeParsing
protected

Definition at line 41 of file DBIService.h.

bool nutools::dbi::DBIService::fTimeQueries
protected

Definition at line 40 of file DBIService.h.

int nutools::dbi::DBIService::fVerbosity
protected

Definition at line 39 of file DBIService.h.

std::string nutools::dbi::DBIService::fWebServiceURL
protected

Definition at line 43 of file DBIService.h.


The documentation for this class was generated from the following files: