1 #ifndef _ots_CoreSupervisorBase_h_
2 #define _ots_CoreSupervisorBase_h_
4 #include "otsdaq-core/SupervisorInfo/AllSupervisorInfo.h"
5 #include "otsdaq-core/WorkLoopManager/WorkLoopManager.h"
6 #include "otsdaq-core/FiniteStateMachine/RunControlStateMachine.h"
7 #include "otsdaq-core/SupervisorInfo/AllSupervisorInfo.h"
8 #include "otsdaq-core/SOAPUtilities/SOAPMessenger.h"
10 #include "otsdaq-core/XmlUtilities/HttpXmlDocument.h"
11 #include "otsdaq-core/SOAPUtilities/SOAPUtilities.h"
12 #include "otsdaq-core/SOAPUtilities/SOAPCommand.h"
13 #include "otsdaq-core/CgiDataUtilities/CgiDataUtilities.h"
15 #include "otsdaq-core/ConfigurationDataFormats/ConfigurationGroupKey.h"
16 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h"
17 #include "otsdaq-core/ConfigurationInterface/ConfigurationTree.h"
18 #include "otsdaq-core/ConfigurationPluginDataFormats/XDAQContextConfiguration.h"
19 #include "otsdaq-core/MessageFacility/MessageFacility.h"
20 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
21 #include "otsdaq-core/FiniteStateMachine/VStateMachine.h"
23 #include "otsdaq-core/WebUsersUtilities/RemoteWebUsers.h"
25 #pragma GCC diagnostic push
26 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
27 #include <xdaq/Application.h>
28 #pragma GCC diagnostic pop
29 #include "xgi/Method.h"
31 #include <toolbox/fsm/FailedEvent.h>
33 #include <xdaq/NamespaceURI.h>
34 #include <xoap/Method.h>
54 virtual void setSupervisorPropertyDefaults (
void);
58 xoap::MessageReference workLoopStatusRequestWrapper (xoap::MessageReference message )
throw (xoap::exception::Exception);
59 void DefaultWrapper (xgi::Input* in, xgi::Output* out)
throw (xgi::exception::Exception);
60 void requestWrapper (xgi::Input* in, xgi::Output* out)
throw (xgi::exception::Exception);
64 virtual void Default (xgi::Input* in, xgi::Output* out)
throw (xgi::exception::Exception);
65 virtual void request (xgi::Input* in, xgi::Output* out)
throw (xgi::exception::Exception);
70 void stateMachineXgiHandler (xgi::Input* in, xgi::Output* out )
throw (xgi::exception::Exception);
71 void stateMachineResultXgiHandler (xgi::Input* in, xgi::Output* out )
throw (xgi::exception::Exception);
72 xoap::MessageReference stateMachineXoapHandler (xoap::MessageReference message )
throw (xoap::exception::Exception);
73 xoap::MessageReference stateMachineResultXoapHandler (xoap::MessageReference message )
throw (xoap::exception::Exception);
75 xoap::MessageReference stateMachineStateRequest (xoap::MessageReference message )
throw (xoap::exception::Exception);
76 xoap::MessageReference stateMachineErrorMessageRequest (xoap::MessageReference message )
throw (xoap::exception::Exception);
78 virtual xoap::MessageReference workLoopStatusRequest (xoap::MessageReference message )
throw (xoap::exception::Exception);
80 bool stateMachineThread (toolbox::task::WorkLoop* workLoop);
82 virtual void stateInitial (toolbox::fsm::FiniteStateMachine& fsm)
throw (toolbox::fsm::exception::Exception);
83 virtual void statePaused (toolbox::fsm::FiniteStateMachine& fsm)
throw (toolbox::fsm::exception::Exception);
84 virtual void stateRunning (toolbox::fsm::FiniteStateMachine& fsm)
throw (toolbox::fsm::exception::Exception);
85 virtual void stateHalted (toolbox::fsm::FiniteStateMachine& fsm)
throw (toolbox::fsm::exception::Exception);
86 virtual void stateConfigured (toolbox::fsm::FiniteStateMachine& fsm)
throw (toolbox::fsm::exception::Exception);
87 virtual void inError (toolbox::fsm::FiniteStateMachine& fsm)
throw (toolbox::fsm::exception::Exception);
89 virtual void transitionConfiguring (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
90 virtual void transitionHalting (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
91 virtual void transitionInitializing (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
92 virtual void transitionPausing (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
93 virtual void transitionResuming (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
94 virtual void transitionStarting (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
95 virtual void transitionStopping (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
96 virtual void enteringError (toolbox::Event::Reference e)
throw (toolbox::fsm::exception::Exception);
99 static const std::string WORK_LOOP_DONE, WORK_LOOP_WORKING;
104 toolbox::BSem stateMachineSemaphore_;
108 std::string XDAQContextConfigurationName_;
109 std::string supervisorConfigurationPath_;
111 std::string supervisorContextUID_;
112 std::string supervisorApplicationUID_;
113 std::string supervisorClass_;
114 std::string supervisorClassNoNamespace_;
118 std::vector<VStateMachine*> theStateMachineImplementation_;
121 uint8_t USER_PERMISSIONS_THRESHOLD_;
122 std::string USER_GROUPS_ALLOWED_;
123 std::string USER_GROUPS_DISALLOWED_;
128 std::string
const fieldRequireLock =
"RequireUserHasLock";
129 std::string
const fieldUserPermissionsThreshold =
"UserPermissionsThreshold";
130 std::string
const fieldUserGroupsAllowed =
"UserGroupsAllowed";
131 std::string
const fieldUserGroupsDisallowed =
"UserGroupsDisallowed";
132 } supervisorProperties_;