Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dbutils::daqconfig::DDTConnectConfig Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DatabaseUtils/cxx/include/DAQConfig/DDTConnectConfig.h"

Public Member Functions

 DDTConnectConfig (const std::vector< int64_t > &subsystemConfigIdList)
 
 DDTConnectConfig (const SubsystemNameSpec &nameSpec)
 
 DDTConnectConfig (const GlobalNameSpec &nameSpec)
 
 DDTConnectConfig (const int64_t &globalConfigId)
 
virtual ~DDTConnectConfig ()
 
virtual bool hasValidData () const
 
int64_t getPrimarySubsystemConfigId () const
 

Protected Member Functions

bool _fetchAllData (const std::vector< int64_t > &subsystemConfigIdList)
 

Protected Attributes

bool _hasValidData
 
int64_t _primarySubsystemConfigId
 
boost::shared_ptr< ConfigDataTree_ddtConfigDataTree
 

Detailed Description

Worker class to handle fetching of DDT Connection configuration data.

Author
Kurt Biery
Version
Revision
1.1.14.1
Date
2019/09/27 00:07:03

Definition at line 25 of file DDTConnectConfig.h.

Constructor & Destructor Documentation

dbutils::daqconfig::DDTConnectConfig::DDTConnectConfig ( const std::vector< int64_t > &  subsystemConfigIdList)

Creates a DDT Connection configuration object from the specified list of subsystem configuration IDs.

Parameters
subsystemConfigIdListThe list of subsystem configuration IDs.

Definition at line 23 of file DDTConnectConfig.cpp.

References _fetchAllData(), _hasValidData, and _primarySubsystemConfigId.

24  {
26  if (subsystemConfigIdList.size() > 0) {
27  _primarySubsystemConfigId = subsystemConfigIdList[0];
28  _hasValidData = _fetchAllData(subsystemConfigIdList);
29  }
30  else {
31  _hasValidData = false;
32  }
33  }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList)
dbutils::daqconfig::DDTConnectConfig::DDTConnectConfig ( const SubsystemNameSpec nameSpec)

Creates a DDT Connection configuration object from the specified subsystem configuration specification.

Parameters
nameSpecThe named configuration of interest.

Definition at line 41 of file DDTConnectConfig.cpp.

References _fetchAllData(), _hasValidData, and _primarySubsystemConfigId.

42  {
44  std::vector<int64_t> subsystemConfigIdList;
45  if (NamedConfigUtils::
46  getSubsystemConfigIdAncestry(nameSpec, subsystemConfigIdList)) {
47  _primarySubsystemConfigId = subsystemConfigIdList[0];
48  _hasValidData = _fetchAllData(subsystemConfigIdList);
49  }
50  else {
51  _hasValidData = false;
52  }
53  }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList)
dbutils::daqconfig::DDTConnectConfig::DDTConnectConfig ( const GlobalNameSpec nameSpec)

Creates a DDT Connection configuration object from the specified global configuration specification.

Parameters
nameSpecThe named configuration of interest.

Definition at line 61 of file DDTConnectConfig.cpp.

References _fetchAllData(), _hasValidData, _primarySubsystemConfigId, dbutils::daqconfig::IDSpec::DAQ, dbutils::daqconfig::NamedConfigUtils::getConfigIdAncestry(), dbutils::daqconfig::NamedConfigUtils::getSubsystemConfigIdFromGlobalName(), fabricate::status, and dbutils::daqconfig::IDSpec::SUBSYSTEM.

62  {
64  int64_t subsystemConfigId;
67  SubsystemNameSpec::
68  DDT_SUBSYSTEM_NAME,
69  SubsystemNameSpec::
70  CONNECT_CONFIG_TYPE,
71  subsystemConfigId);
72 
73  std::vector<int64_t> subsystemConfigIdList;
74  if (status) {
75  IDSpec idSpec(subsystemConfigId, IDSpec::SUBSYSTEM, IDSpec::DAQ);
76  status = NamedConfigUtils::
77  getConfigIdAncestry(idSpec, subsystemConfigIdList);
78  }
79 
80  if (status) {
81  _primarySubsystemConfigId = subsystemConfigIdList[0];
82  _hasValidData = _fetchAllData(subsystemConfigIdList);
83  }
84  else {
85  _hasValidData = false;
86  }
87  }
int status
Definition: fabricate.py:1613
static bool getConfigIdAncestry(const IDSpec &idSpec, std::vector< int64_t > &idList, const std::string &tableFile=DEFAULT_GLOBAL_NAMES_TABLE_FILE)
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList)
static bool getSubsystemConfigIdFromGlobalName(const GlobalNameSpec &globalNameSpec, const std::string &subsystemName, const std::string &subsystemConfigType, int64_t &subsystemConfigId, const std::string &globalNamesTableFile=DEFAULT_GLOBAL_NAMES_TABLE_FILE, const std::string &subsystemNamesTableFile=DEFAULT_SUBSYSTEM_NAMES_TABLE_FILE)
dbutils::daqconfig::DDTConnectConfig::DDTConnectConfig ( const int64_t &  globalConfigId)

Creates a DDT Connection configuration object from the specified global configuration ID.

Parameters
globalConfigIdThe ID of the global configuration of interest.

Definition at line 95 of file DDTConnectConfig.cpp.

References _fetchAllData(), _hasValidData, _primarySubsystemConfigId, dbutils::daqconfig::IDSpec::DAQ, and dbutils::daqconfig::IDSpec::GLOBAL.

96  {
97  IDSpec idSpec(globalConfigId, IDSpec::GLOBAL, IDSpec::DAQ);
99  std::vector<int64_t> subsystemConfigIdList;
100  if (NamedConfigUtils::
101  getSubsystemConfigIdAncestryFromGlobalId(idSpec,
102  SubsystemNameSpec::
103  DDT_SUBSYSTEM_NAME,
104  SubsystemNameSpec::
105  CONNECT_CONFIG_TYPE,
106  subsystemConfigIdList)) {
107  _primarySubsystemConfigId = subsystemConfigIdList[0];
108  _hasValidData = _fetchAllData(subsystemConfigIdList);
109  }
110  else {
111  _hasValidData = false;
112  }
113  }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList)
virtual dbutils::daqconfig::DDTConnectConfig::~DDTConnectConfig ( )
inlinevirtual

Definition at line 41 of file DDTConnectConfig.h.

41 {};

Member Function Documentation

bool dbutils::daqconfig::DDTConnectConfig::_fetchAllData ( const std::vector< int64_t > &  subsystemConfigIdList)
protected

Definition at line 116 of file DDTConnectConfig.cpp.

References _ddtConfigDataTree, dbutils::daqconfig::ConfigDataSelector::addSelectionColumn(), dbutils::daqconfig::DBColumnParams::HOSTNAME_COLUMN_NAME, and string.

Referenced by DDTConnectConfig(), and getPrimarySubsystemConfigId().

117  {
118  std::string table_name =
119  "NovaDatabase/tables/DAQConfig/DDTManagerConnectParameters.xml";
120 
121  ConfigDataSelector cfgSelector;
122  cfgSelector.addSelectionColumn(DBColumnParams::HOSTNAME_COLUMN_NAME);
123 
124  std::vector<std::string> dataColumnsOfInterest;
125  dataColumnsOfInterest.push_back("configPath");
126  dataColumnsOfInterest.push_back("nProcesses");
127  dataColumnsOfInterest.push_back("version");
128  dataColumnsOfInterest.push_back("qualifier");
129 
130  _ddtConfigDataTree.reset
131  (new ConfigDataTree(table_name, subsystemConfigIdList,
132  cfgSelector, dataColumnsOfInterest));
133 
134  return _ddtConfigDataTree->hasValidData();
135  }
static const std::string HOSTNAME_COLUMN_NAME
boost::shared_ptr< ConfigDataTree > _ddtConfigDataTree
enum BeamMode string
int64_t dbutils::daqconfig::DDTConnectConfig::getPrimarySubsystemConfigId ( ) const
inline
virtual bool dbutils::daqconfig::DDTConnectConfig::hasValidData ( ) const
inlinevirtual

Definition at line 47 of file DDTConnectConfig.h.

References _hasValidData.

Member Data Documentation

boost::shared_ptr<ConfigDataTree> dbutils::daqconfig::DDTConnectConfig::_ddtConfigDataTree
protected

Definition at line 57 of file DDTConnectConfig.h.

Referenced by _fetchAllData().

bool dbutils::daqconfig::DDTConnectConfig::_hasValidData
protected

Definition at line 54 of file DDTConnectConfig.h.

Referenced by DDTConnectConfig(), and hasValidData().

int64_t dbutils::daqconfig::DDTConnectConfig::_primarySubsystemConfigId
protected

Definition at line 55 of file DDTConnectConfig.h.

Referenced by DDTConnectConfig(), and getPrimarySubsystemConfigId().


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