otsdaq  3.09.00
GatewaySupervisor.h
1 #ifndef _ots_GatewaySupervisor_h
2 #define _ots_GatewaySupervisor_h
3 #include <atomic>
4 #include <condition_variable>
5 #include <mutex>
6 
7 #include "otsdaq/CoreSupervisors/ConfigurationSupervisorBase.h"
8 #include "otsdaq/CoreSupervisors/CorePropertySupervisorBase.h"
9 #include "otsdaq/FiniteStateMachine/RunControlStateMachine.h"
10 #include "otsdaq/GatewaySupervisor/Iterator.h"
11 #include "otsdaq/SOAPUtilities/SOAPMessenger.h"
12 #include "otsdaq/SupervisorInfo/AllSupervisorInfo.h"
13 #include "otsdaq/WebUsersUtilities/WebUsers.h"
14 #include "otsdaq/WorkLoopManager/WorkLoopManager.h"
15 
16 #include "otsdaq/CodeEditor/CodeEditor.h"
17 #include "otsdaq/TablePlugins/DesktopIconTable.h"
18 
19 #include "otsdaq/NetworkUtilities/TransceiverSocket.h" // for UDP state changer
20 
21 #pragma GCC diagnostic push
22 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
23 #include <xdaq/Application.h>
24 #pragma GCC diagnostic pop
25 #include "otsdaq/Macros/XDAQApplicationMacros.h"
26 
27 #include <toolbox/task/WorkLoop.h>
28 #include <xdata/String.h>
29 #include <xgi/Method.h>
30 #include "otsdaq/GatewaySupervisor/PixelHistoPicGen.h"
31 
32 #include <pthread.h> // for pthread_setcancelstate in broadcastMessageThread
33 #include <set>
34 #include <sstream>
35 #include <string>
36 
37 // clang-format off
38 
40 // #define FSM_LAST_CONFIGURED_GROUP_ALIAS_FILE std::string("FSMLastConfiguredGroupAlias.hist")
41 // #define FSM_LAST_STARTED_GROUP_ALIAS_FILE std::string("FSMLastStartedGroupAlias.hist")
42 
43 // #define FSM_CONFIGURED_GROUP_ALIASES_FILE std::string("FSMConfiguredGroupAliases.hist")
44 // #define FSM_STARTED_GROUP_ALIASES_FILE std::string("FSMStartedGroupAlias.hist")
45 
46 // #define FSM_CONFIGURED_OR_STARTED_GROUP_ALIASES_FILE std::string("FSMConfiguredOrStartedGroupAlias.hist")
47 
48 // #define FSM_CONFIGURED_CONTEXTS_FILE std::string("FSMConfiguredContexts.hist")
49 // #define FSM_STARTED_CONTEXTS_FILE std::string("FSMStartedContexts.hist")
50 // #define FSM_CONFIGURED_OR_STARTED_CONTEXTS_FILE std::string("FSMConfiguredOrStartedContexts.hist")
51 
52 // #define FSM_CONFIGURED_BACKBONES_FILE std::string("FSMConfiguredBackbones.hist")
53 // #define FSM_STARTED_BACKBONES_FILE std::string("FSMStartedBackbones.hist")
54 // #define FSM_CONFIGURED_OR_STARTED_BACKBONES_FILE std::string("FSMConfiguredOrStartedBackbones.hist")
55 
56 // #define FSM_CONFIGURED_ITERATORS_FILE std::string("FSMConfiguredIterators.hist")
57 // #define FSM_STARTED_ITERATORS_FILE std::string("FSMStartedIterators.hist")
58 // #define FSM_CONFIGURED_OR_STARTED_ITERATORS_FILE std::string("FSMConfiguredOrStartedIterators.hist")
59 
60 
61 namespace ots
62 {
63 class ConfigurationManager;
64 class TableGroupKey;
65 class WorkLoopManager;
66 
67 
72  class GatewaySupervisor : public xdaq::Application,
73  public SOAPMessenger,
77  {
78  friend class WizardSupervisor;
79  friend class Iterator;
80 
81  static const std::string COMMAND_PARAM_LOG_ENTRY_PREAMBLE;
82  static const std::string COMMAND_PARAM_SUBSYSTEM_COMMON_PREAMBLE;
83  static const std::string COMMAND_PARAM_SUBSYSTEM_COMMON_OVERRIDE_PREAMBLE;
84  static const std::string COMMAND_PARAM_ITERATION_INDEX_PREAMBLE;
85 
86  public:
87  XDAQ_INSTANTIATOR();
88 
89  GatewaySupervisor (xdaq::ApplicationStub* s);
90  virtual ~GatewaySupervisor (void);
91 
92  void init (void);
93 
94  void Default (xgi::Input* in, xgi::Output* out);
95 
96  void loginRequest (xgi::Input* in, xgi::Output* out);
97  void request (xgi::Input* in, xgi::Output* out);
98  void tooltipRequest (xgi::Input* in, xgi::Output* out);
99  void XGI_Turtle (xgi::Input* in, xgi::Output* out);
100 
101  void addStateMachineStatusToXML (HttpXmlDocument& xmlOut, const std::string& fsmName, bool getRunNumber = true);
102  void addFilteredConfigAliasesToXML (HttpXmlDocument& xmlOut, const std::string& fsmName);
103  void addRequiredFsmLogInputToXML (HttpXmlDocument& xmlOut, const std::string& fsmName);
104 
105  // State Machine requests handlers
106  void stateMachineXgiHandler(xgi::Input* in, xgi::Output* out);
107  void stateMachineIterationBreakpoint(xgi::Input* in, xgi::Output* out);
108 
109  static std::string getIconHeaderString(void);
110  static bool handleAddDesktopIconRequest(const std::string& author, cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut, std::vector<DesktopIconTable::DesktopIcon>* newIcons = nullptr);
111  static void handleGetApplicationIdRequest(AllSupervisorInfo* applicationInfo, cgicc::Cgicc& cgiIn, HttpXmlDocument& xmlOut, std::map<std::string /* requestOrigin */, std::map<std::string /* requestUrlHostPort */, std::string /* translatedHostPort */>>* portTranslationMap = nullptr);
112 
113  xoap::MessageReference stateMachineXoapHandler(xoap::MessageReference msg);
114 
115  bool stateMachineThread(toolbox::task::WorkLoop* workLoop);
116 
117  // Status requests handlers
118  void statusRequest(xgi::Input* in, xgi::Output* out);
119  void infoRequestResultHandler(xgi::Input* in, xgi::Output* out);
120  bool infoRequestThread(toolbox::task::WorkLoop* workLoop);
121 
122  // External GatewaySupervisor XOAP handlers
123  xoap::MessageReference supervisorCookieCheck(xoap::MessageReference msg);
124  xoap::MessageReference supervisorGetActiveUsers(xoap::MessageReference msg);
125  xoap::MessageReference supervisorSystemMessage(xoap::MessageReference msg);
126  xoap::MessageReference supervisorGetUserInfo(xoap::MessageReference msg);
127  xoap::MessageReference supervisorSystemLogbookEntry(xoap::MessageReference msg);
128  xoap::MessageReference supervisorLastTableGroupRequest(xoap::MessageReference msg);
129 
130  // Finite State Machine States
131  void stateInitial(toolbox::fsm::FiniteStateMachine& fsm) override;
132  void statePaused(toolbox::fsm::FiniteStateMachine& fsm) override;
133  void stateRunning(toolbox::fsm::FiniteStateMachine& fsm) override;
134  void stateHalted(toolbox::fsm::FiniteStateMachine& fsm) override;
135  void stateConfigured(toolbox::fsm::FiniteStateMachine& fsm) override;
136  void inError(toolbox::fsm::FiniteStateMachine& fsm) override;
137 
138  void transitionConfiguring(toolbox::Event::Reference e) override;
139  void transitionHalting(toolbox::Event::Reference e) override;
140  void transitionInitializing(toolbox::Event::Reference e) override;
141  void transitionPausing(toolbox::Event::Reference e) override;
142  void transitionResuming(toolbox::Event::Reference e) override;
143  void transitionStarting(toolbox::Event::Reference e) override;
144  void transitionStopping(toolbox::Event::Reference e) override;
145  void transitionShuttingDown(toolbox::Event::Reference e) override;
146  void transitionStartingUp(toolbox::Event::Reference e) override;
147  void enteringError(toolbox::Event::Reference e) override;
148 
149  void makeSystemLogEntry(const std::string& entryText, const std::string& subjectText = "");
150  static void addSystemMessage(std::string toUserCSV, std::string message);
151 
152  void checkForAsyncError(void);
153 
154  // CorePropertySupervisorBase override functions
155  virtual void setSupervisorPropertyDefaults (void) override;
156  virtual void forceSupervisorPropertyValues (void) override;
157 
158 
159  private:
160  unsigned int getNextRunNumber (const std::string& fsmName = "");
161  void setNextRunNumber (unsigned int runNumber, const std::string& fsmName = "");
162  std::string getLastLogEntry (const std::string& logType, const std::string& fsmName = "");
163  void setLastLogEntry (const std::string& logType, const std::string& logEntry, const std::string& fsmName = "");
164 
165 
166  static xoap::MessageReference lastTableGroupRequestHandler (const SOAPParameters& parameters);
167  static void launchStartOTSCommand (const std::string& command, ConfigurationManager* cfgMgr);
168  static void launchStartOneServerCommand (const std::string& command, ConfigurationManager* cfgMgr, const std::string& contextName);
169 
170  static void indicateOtsAlive (const CorePropertySupervisorBase* properties = 0);
171  xoap::MessageReference TRACESupervisorRequest (xoap::MessageReference message);
172 
173  static void StateChangerWorkLoop (GatewaySupervisor* supervisorPtr);
174  static void AppStatusWorkLoop (GatewaySupervisor* supervisorPtr, const bool doDisconnected = false);
175 
176  std::string attemptStateMachineTransition (HttpXmlDocument* xmldoc,
177  std::ostringstream* out,
178  const std::string& command,
179  const std::string& fsmName,
180  const std::string& fsmWindowName,
181  const std::string& username,
182  const std::vector<std::string>& parameters,
183  std::string logEntry = "");
184  void broadcastMessage (xoap::MessageReference msg);
185  void broadcastMessageToRemoteGateways (const xoap::MessageReference msg, unsigned int iteration = 0);
186  void broadcastMessageToRemoteGatewaysComplete (const xoap::MessageReference msg, unsigned int iterationIndex = 0);
187  void signalAndWaitForBroadcastThreads (unsigned int numberOfThreads);
188 
189  struct BroadcastMessageIterationsDoneStruct
190  {
191  // Creating std::vector<std::vector<bool>>
192  // because of problems with the standard library
193  // not allowing passing by reference of bool types.
194  // Broadcast thread implementation requires passing by reference.
195  ~BroadcastMessageIterationsDoneStruct()
196  {
197  for (auto& arr : iterationsDone_)
198  delete[] arr;
199  iterationsDone_.clear();
200  arraySizes_.clear();
201  } // end destructor
202 
203  void push(const unsigned int& size)
204  {
205  iterationsDone_.push_back(new bool[size]);
206  arraySizes_.push_back(size);
207 
208  // initialize to false
209  for (unsigned int i = 0; i < size; ++i)
210  iterationsDone_[iterationsDone_.size() - 1][i] = false;
211  } // end push()
212 
213  bool* operator[](unsigned int i) { return iterationsDone_[i]; }
214  const bool* operator[](unsigned int i) const { return iterationsDone_[i]; }
215  unsigned int size(unsigned int i = -1)
216  {
217  if (i == (unsigned int)-1)
218  return iterationsDone_.size();
219  return arraySizes_[i];
220  }
221 
222  private:
223  std::vector<bool*> iterationsDone_;
224  std::vector<unsigned int> arraySizes_;
225  }; // end BroadcastMessageIterationsDoneStruct definition
226 
227  struct BroadcastThreadStruct
228  {
229  //===================
230  BroadcastThreadStruct()
231  : threadIndex_(-1)
232  , exitThread_(false)
233  , working_(true)
234  , workToDo_(false)
235  , error_(false)
236  {
237  } // end BroadcastThreadStruct constructor()
238 
239  //===================
240  BroadcastThreadStruct(BroadcastThreadStruct &&b)
241  : threadIndex_(b.threadIndex_)
242  , exitThread_(b.exitThread_.load())
243  , working_(b.working_.load())
244  , workToDo_(b.workToDo_.load())
245  , error_(b.error_.load())
246  {
247  } // end BroadcastThreadStruct move constructor()
248 
249 
251  {
252  //===================
253  BroadcastMessageStruct(const SupervisorInfo& appInfo,
254  xoap::MessageReference message,
255  const std::string& command,
256  const unsigned int& iteration,
257  bool& iterationsDone,
258  std::shared_ptr<BroadcastMessageIterationsDoneStruct> iterationsDoneOwner)
259  : appInfo_(appInfo)
260  , message_(message)
261  , command_(command)
262  , iteration_(iteration)
263  , iterationsDone_(iterationsDone)
264  , iterationsDoneOwner_(iterationsDoneOwner)
265  {
266  }
267 
268  const SupervisorInfo& appInfo_;
269  xoap::MessageReference message_;
270  const std::string command_;
271  const unsigned int iteration_;
272  bool& iterationsDone_;
273  // Keep the BroadcastMessageIterationsDoneStruct alive while this message
274  // is in use by a thread, preventing UAF even if broadcastMessage() returns
275  // early (e.g. on timeout or exception) before the thread finishes.
276  std::shared_ptr<BroadcastMessageIterationsDoneStruct> iterationsDoneOwner_;
277 
278  std::string reply_;
279  }; // end BroadcastMessageStruct definition
280 
281  //===================
282  void setMessage(const SupervisorInfo& appInfo,
283  xoap::MessageReference message,
284  const std::string& command,
285  const unsigned int& iteration,
286  bool& iterationsDone,
287  std::shared_ptr<BroadcastMessageIterationsDoneStruct> iterationsDoneOwner)
288  {
289  messages_.clear();
291  appInfo, message, command, iteration, iterationsDone, iterationsDoneOwner));
292  workToDo_ = true;
293  } // end setMessage()
294 
295  const SupervisorInfo& getAppInfo() { return messages_[0].appInfo_; }
296  xoap::MessageReference getMessage() { return messages_[0].message_; }
297  const std::string& getCommand() { return messages_[0].command_; }
298  const unsigned int& getIteration() { return messages_[0].iteration_; }
299  std::string& getReply() { return messages_[0].reply_; }
300  bool& getIterationsDone() { return messages_[0].iterationsDone_; }
301 
302  // each thread accesses these members
303  std::mutex threadMutex_;
304  unsigned int threadIndex_;
305  std::atomic<bool> exitThread_, working_, workToDo_, error_;
306  // always just 1 message (for now)
307  std::vector<BroadcastThreadStruct::BroadcastMessageStruct> messages_;
308 
309  }; // end BroadcastThreadStruct declaration
310  static void broadcastMessageThread(
311  GatewaySupervisor* supervisorPtr,
312  std::shared_ptr<GatewaySupervisor::BroadcastThreadStruct> threadStruct);
313  bool handleBroadcastMessageTarget(const SupervisorInfo& appInfo,
314  xoap::MessageReference message,
315  const std::string& command,
316  const unsigned int& iteration,
317  std::string& reply,
318  unsigned int threadIndex = 0,
319  const std::atomic<bool>* exitFlag = nullptr);
320 
321 
322  // Member Variables -----------------------
323 
324  bool supervisorGuiHasBeenLoaded_;
325  static WebUsers theWebUsers_;
326  std::map<std::string /* requestOrigin */, std::map<std::string /* requestUrlHostPort */,
327  std::string /* translatedHostPort */>>
328  portTranslationMap_;
329 
330  WorkLoopManager stateMachineWorkLoopManager_;
331  toolbox::BSem stateMachineSemaphore_;
332 
333  std::string activeStateMachineName_;
334  std::string activeStateMachineWindowName_;
335  std::string activeStateMachineDumpFormatOnRun_, activeStateMachineDumpFormatOnConfigure_;
336  std::string activeStateMachineSystemDumpOnRun_, activeStateMachineSystemDumpOnConfigure_;
337  bool activeStateMachineSystemDumpOnRunEnable_, activeStateMachineSystemDumpOnConfigureEnable_;
338  std::string activeStateMachineSystemDumpOnRunFilename_, activeStateMachineSystemDumpOnConfigureFilename_;
339  bool activeStateMachineRequireUserLogOnRun_, activeStateMachineRequireUserLogOnConfigure_;
340  std::string activeStateMachineRunInfoPluginType_;
341  std::map<std::string /* fsmName */, std::string /* logEntry */>
342  stateMachineConfigureLogEntry_, stateMachineStartLogEntry_, stateMachineStopLogEntry_;
343  std::string activeStateMachineRunNumber_, activeStateMachineRunAlias_, activeStateMachineConfigurationAlias_;
344  bool activeStateMachineRollOverLogOnConfigure_, activeStateMachineRollOverLogOnStart_;
345  std::chrono::steady_clock::time_point
346  activeStateMachineRunStartTime;
347  int activeStateMachineRunDuration_ms;
348  unsigned int activeStateMachineConfigureConditionID_, activeStateMachineRunConditionID_;
349  std::string activeStateMachineSubsystemCommonList_, activeStateMachineSubsystemCommonOverrideList_;
350 
351  std::mutex systemStatusMutex_;
352  std::string lastLogbookEntry_;
353  time_t lastLogbookEntryTime_ = 0;
354 
355  std::string lastConsoleErr_, lastConsoleWarn_, lastConsoleInfo_, lastConsoleErrTime_, lastConsoleWarnTime_, lastConsoleInfoTime_;
356  std::string firstConsoleErr_, firstConsoleWarn_, firstConsoleInfo_, firstConsoleErrTime_, firstConsoleWarnTime_, firstConsoleInfoTime_;
357  size_t systemConsoleErrCount_ = 0, systemConsoleWarnCount_ = 0, systemConsoleInfoCount_ = 0;
358 
359  std::pair<std::string /*group name*/, TableGroupKey>
360  theConfigurationTableGroup_;
361  std::string stateMachineTransitionUsername_;
362 
363  Iterator theIterator_;
364  std::mutex stateMachineAccessMutex_;
366  std::string stateMachineLastCommandInput_;
367  enum
368  {
369  VERBOSE_MUTEX = 0
370  };
371 
372  CodeEditor codeEditor_;
373 
374  std::mutex broadcastCommandMessageIndexMutex_;
375  unsigned int broadcastCommandMessageIndex_;
376  std::atomic<bool> broadcastIterationsDone_{true};
377  std::mutex broadcastIterationBreakpointMutex_;
378  unsigned int broadcastIterationBreakpoint_;
380  std::mutex broadcastCommandStatusUpdateMutex_;
381  std::string broadcastCommandStatus_;
382 
383  std::mutex remoteIterationMutex_;
384  std::condition_variable remoteIterationCV_;
385  unsigned int remoteIterationIndex_ = 0;
386  std::atomic<bool> isRemoteSubsystemIteration_{false};
387 
388  static std::vector<std::shared_ptr<GatewaySupervisor::BroadcastThreadStruct>> broadcastThreadStructs_;
389 
390  std::string securityType_;
391  PixelHistoPicGen picGen_;
392 
393  //Variable used by the RunInfo plugin
394  unsigned int conditionID_;
395 
396 public: //used by remote subsystem control and status
397 
400 
401  enum class ConfigDumpTypes
402  {
403  Text,
404  JSON_all,
405  Unknown
406  };
407 
408  std::string command, fsmName;
409  private: //make error private to connect to set timestamp
410  std::string error;
411  time_t errorTimestamp = 0;
412  public:
413  void setError(const std::string& err) { error = err; errorTimestamp = time(0); }
414  void clearError() { error = ""; errorTimestamp = 0; }
415  void copyError(const RemoteGatewayInfo& r) { error = r.error; errorTimestamp = r.errorTimestamp; }
416  const std::string& getError() const { return error; }
417  const std::string getErrorTimestamp() const { return StringMacros::getTimestampString(errorTimestamp); }
418 
419  std::string config_dump;
420  ConfigDumpTypes config_dump_type = ConfigDumpTypes::Unknown;
421 
422  size_t ignoreStatusCount = 0;
423 
424  size_t consoleErrCount = 0, consoleWarnCount = 0;
425 
426  std::string fullName;
427  std::string user_data_path_record;
428  std::string setupType, instancePath, instanceHost, instanceUser;
429 
430  std::string selected_config_alias;
431  std::set<std::string> config_aliases;
432  std::string iconString, parentIconFolderPath, landingPage, permissionThresholdString;
433 
434  std::string usernameWithLock;
435 
436  enum class FSM_ModeTypes
437  {
438  Follow_FSM,
439  DoNotHalt,
440  OnlyConfigure,
441  };
442  FSM_ModeTypes fsm_mode = FSM_ModeTypes::Follow_FSM;
443  bool fsm_included = true;
444 
445  std::string getFsmMode() const {
446  switch(fsm_mode)
447  {
448  case FSM_ModeTypes::Follow_FSM: return "Follow FSM";
449  case FSM_ModeTypes::DoNotHalt: return "Do Not Halt";
450  case FSM_ModeTypes::OnlyConfigure: return "Only Configure";
451  default: return "Impossible";
452  }
453  } //end getFsmMode()
454 
455  std::string getConfigDumpType() const {
456  switch(config_dump_type)
457  {
458  case ConfigDumpTypes::Text: return "Text";
459  case ConfigDumpTypes::JSON_all: return "JSON all";
460  default: return "Unknown";
461  }
462  } //end getFsmMode()
463 
464  std::map<std::string, SupervisorInfo::SubappInfo> subapps;
465  bool iterationsDone = false;
466  }; //end GatewaySupervisor::RemoteGatewayInfo struct
467 
468  std::vector<GatewaySupervisor::RemoteGatewayInfo> remoteGatewayApps_;
469  std::mutex remoteGatewayAppsMutex_;
470  std::map<std::string /* appName */,
471  bool /* lastStatusGood */> appLastStatusGood_;
472  std::mutex dualStatusThreadMutex_;
473 
476 
477  std::map<unsigned int /* lid */, SupervisorInfo> localAllSupervisorInfo_;
478 
479 
480  std::mutex latestGatewayIconsMutex_;
481  std::vector<DesktopIconTable::DesktopIcon> latestGatewayIcons_;
482  std::pair<std::string /* latestIconContext group */, TableGroupKey>
484 
486  std::pair<std::string /* latestIconContext group */, TableGroupKey>
488 
489  static void CheckRemoteGatewayStatus (GatewaySupervisor::RemoteGatewayInfo& remoteGatewayApp, const std::unique_ptr<TransceiverSocket>& remoteGatewaySocket, const std::string& ipForReverseLoginOverUDP, int portForReverseLoginOverUDP);
490  static void SendRemoteGatewayCommand (GatewaySupervisor::RemoteGatewayInfo& remoteGatewayApp, const std::unique_ptr<TransceiverSocket>& remoteGatewaySocket);
491  static void GetRemoteGatewayIcons (GatewaySupervisor::RemoteGatewayInfo& remoteGatewayApp, const std::unique_ptr<TransceiverSocket>& remoteGatewaySocket);
492  void loadRemoteGatewaySettings (std::vector<GatewaySupervisor::RemoteGatewayInfo>& remoteGateways, bool onlyNotFound = false) const;
493  void saveRemoteGatewaySettings (void) const;
494  static std::string translateURLForRequestOrigin (const std::string& url, const std::string& requestOrigin, std::map<std::string /* requestOrigin */, std::map<std::string /* requestUrlHostPort */, std::string /* translatedHostPort */>>& portTranslationMap);
495  static std::string translateRemoteIconStringForRequestOrigin (const std::string& iconString, const std::string& requestOrigin, std::map<std::string /* requestOrigin */, std::map<std::string /* requestUrlHostPort */, std::string /* translatedHostPort */>>& portTranslationMap);
496 
497  };
498 // clang-format on
499 
500 } // namespace ots
501 
502 #endif
friend class GatewaySupervisor
for access to indicateOtsAlive()
std::string latestGatewayRemoteIconsString_
cached string of remote gateway icons for quick access
virtual void setSupervisorPropertyDefaults(void) override
override to control supervisor specific defaults
void stateHalted(toolbox::fsm::FiniteStateMachine &fsm) override
virtual void forceSupervisorPropertyValues(void) override
override to force supervisor property values (and ignore user settings)
std::vector< DesktopIconTable::DesktopIcon > latestGatewayIcons_
used to track the latest desktop icons (which are defined by the active context but allowed to change...
void statePaused(toolbox::fsm::FiniteStateMachine &fsm) override
std::string ipAddressForStateChangesOverUDP_
IP used for UDP reverse-login propagation to remote gateways.
void stateRunning(toolbox::fsm::FiniteStateMachine &fsm) override
int portForReverseLoginOverUDP_
UDP port for reverse-login; 0 = disabled.
std::map< unsigned int, SupervisorInfo > localAllSupervisorInfo_
only use in main thread, stable copy of app status
std::pair< std::string, TableGroupKey > latestGatewayIconsContextGroup_
used to track the table group key for the latest desktop icons
void stateConfigured(toolbox::fsm::FiniteStateMachine &fsm) override
void stateInitial(toolbox::fsm::FiniteStateMachine &fsm) override
std::pair< std::string, TableGroupKey > latestGatewayRemoteIconsContextGroup_
used to track the table group key for the latest remote desktop icons
defines used also by OtsConfigurationWizardSupervisor
ConfigDumpTypes
<FSM Modes: 'Follow FSM,' 'Do not Halt' (artdaq), or 'Only Configure' (DCS/DQM)
FSM_ModeTypes
<FSM Modes: 'Follow FSM,' 'Do not Halt' (artdaq), or 'Only Configure' (DCS/DQM)
std::string permissionThresholdString
used for desktop icons
std::set< std::string > config_aliases
used for remote gateway subapp control
std::string selected_config_alias
used for remote gateway subapp control
FSM_ModeTypes fsm_mode
used for remote gateway subapp control
std::string fsmName
when not "", need to send
bool iterationsDone
tracks per-gateway iteration completion during FSM transitions
std::map< std::string, SupervisorInfo::SubappInfo > subapps
remote gateways can have subapps
size_t ignoreStatusCount
if non-zero, do not ask for status
std::string instanceUser
used for remote ots instance ssh launch
std::string user_data_path_record
used for remote gateway subapp control
static std::string getTimestampString(const std::string &linuxTimeInSeconds)