tdaq-develop-2025-02-12
RemoteWebUsers.h
1 #ifndef _ots_Utilities_RemoteWebUsers_h
2 #define _ots_Utilities_RemoteWebUsers_h
3 
4 #include "otsdaq/SOAPUtilities/SOAPMessenger.h" //for xdaq::ApplicationDescriptor
5 #include "otsdaq/WebUsersUtilities/WebUsers.h"
6 
7 #include <iostream>
8 #include <string>
9 
10 #include "otsdaq/TableCore/TableGroupKey.h" //for TableGroupKey
11 
12 // clang-format off
13 namespace ots
14 {
15 class AllSupervisorInfo;
16 class HttpXmlDocument;
17 
23 {
24  public:
25  RemoteWebUsers(xdaq::Application* application, XDAQ_CONST_CALL xdaq::ApplicationDescriptor* gatewaySupervisorDescriptor);
26 
27 
28 
34  XDAQ_CONST_CALL xdaq::ApplicationDescriptor* gatewaySupervisorDescriptor_;
35 
39  bool xmlRequestToGateway(cgicc::Cgicc& cgi, std::ostringstream* out, HttpXmlDocument* xmldoc, const AllSupervisorInfo& allSupervisorInfo, WebUsers::RequestUserInfo& userInfo);
40 
41  std::string getActiveUserList (void);
42  void sendSystemMessage (const std::string& toUser, const std::string& message, bool doEmail = false);
43  void sendSystemMessage (const std::string& toUser, const std::string& subject, const std::string& message, bool doEmail = false);
44  void makeSystemLogEntry (const std::string& entryText);
45  std::pair<std::string /*group name*/, TableGroupKey>
46  getLastTableGroup (const std::string& actionOfLastGroup, std::string& returnedActionTimeString);
47  void getLastTableGroups (std::map< std::string /* group type */,
48  std::tuple<std::string /*group name*/, TableGroupKey,
49  std::string /* time string*/>>& theGroups);
50 
51  private:
52 
54  std::string ActiveUserList_;
55  time_t ActiveUserLastUpdateTime_;
56  enum
57  {
58  ACTIVE_USERS_UPDATE_THRESHOLD = 2,
59  };
60 
61 };
62 // clang-format on
63 } // namespace ots
64 
65 #endif
XDAQ_CONST_CALL xdaq::ApplicationDescriptor * gatewaySupervisorDescriptor_
void getLastTableGroups(std::map< std::string, std::tuple< std::string, TableGroupKey, std::string >> &theGroups)
RemoteWebUsers(xdaq::Application *application, XDAQ_CONST_CALL xdaq::ApplicationDescriptor *gatewaySupervisorDescriptor)
std::pair< std::string, TableGroupKey > getLastTableGroup(const std::string &actionOfLastGroup, std::string &returnedActionTimeString)
actionOfLastGroup = "Configured" or "Started", for example
std::string getActiveUserList(void)
void sendSystemMessage(const std::string &toUser, const std::string &message, bool doEmail=false)
void makeSystemLogEntry(const std::string &entryText)
bool xmlRequestToGateway(cgicc::Cgicc &cgi, std::ostringstream *out, HttpXmlDocument *xmldoc, const AllSupervisorInfo &allSupervisorInfo, WebUsers::RequestUserInfo &userInfo)