8#include "daq/slc/runcontrol/RCNodeDaemon.h"
10#include <daq/slc/system/LogFile.h>
12#include <daq/slc/base/ConfigFile.h>
21 std::string host = config.get(
"nsm.host");
22 if (host.size() == 0) {
23 LogFile::error(
"nsm.host is empty");
26 int port = config.getInt(
"nsm.port");
28 LogFile::error(
"nsm.port is not a positive integer");
31 std::string name = config.get(
"nsm.nodename");
32 if (name.size() == 0) {
33 LogFile::error(
"nsm.nodename is empty");
36 callback->setNode(
NSMNode(name));
37 std::string rcconfig = config.get(
"rcconfig");
38 callback->setRunTypeRecord(config.get(
"runtype.record"));
39 if (rcconfig.size() > 0) {
40 callback->setRCConfig(rcconfig);
42 LogFile::notice(
"rcconfig is empty");
44 int timeout = config.getInt(
"timeout");
46 callback->setTimeout(timeout);
48 callback->setCategory(config.get(
"log.category"));
49 std::string file = config.get(
"file");
50 std::string dbtable = config.get(
"dbtable");
51 if (file.size() > 0) {
52 LogFile::info(
"read file %s", file.c_str());
53 callback->setDBFile(file);
55 if (dbtable.size() > 0) {
56 LogFile::debug(
"database.use=%s", config.getBool(
"database.use") ?
"TRUE" :
"FALSE");
57 if (config.getBool(
"database.use") && db != NULL) {
58 callback->setDB(db, dbtable);
60 callback->setDBTable(dbtable);
61 callback->setProvider(config.get(
"provider.host"),
62 config.getInt(
"provider.port"));
64 }
else if (file.size() > 0) {
67 LogFile::notice(
"dbtable is empty");
69 m_daemon.add(callback, host, port);
70 host = config.get(
"nsm.global.host");
71 port = config.getInt(
"nsm.global.port");
72 if (callback2 != NULL && host.size() > 0 && port > 0) {
73 callback2->setNode(
NSMNode(name));
74 m_daemon.add(callback2, host, port);
78void RCNodeDaemon::run()
Abstract base class for different kinds of events.