tdaq-develop-2025-02-12
ots::CorePropertySupervisorBase Class Reference

#include <otsdaq/CoreSupervisors/CorePropertySupervisorBase.h>

Inheritance diagram for ots::CorePropertySupervisorBase:
ots::CoreSupervisorBase ots::GatewaySupervisor ots::ARTDAQDataManagerSupervisor ots::ARTDAQOnlineMonitorSupervisor ots::ARTDAQSupervisor ots::CodeEditorSupervisor ots::DataManagerSupervisor ots::FESupervisor ots::FEDataManagerSupervisor ots::ARTDAQFEDataManagerSupervisor

Classes

struct  SupervisorProperties
 

Public Member Functions

 CorePropertySupervisorBase (xdaq::Application *application)
 
XDAQ_CONST_CALL xdaq::ApplicationDescriptor * getGatewaySupervisorDescriptor (void)
 will be wizard supervisor in wiz mode More...
 
virtual void setSupervisorPropertyDefaults (void)
 override to control supervisor specific defaults More...
 
virtual void forceSupervisorPropertyValues (void)
 override to force supervisor property values (and ignore user settings)
 
void getRequestUserInfo (WebUsers::RequestUserInfo &requestUserInfo)
 
ConfigurationTree getContextTreeNode (void) const
 
ConfigurationTree getSupervisorTableNode (void) const
 
const std::string & getContextUID (void) const
 
const std::string & getSupervisorUID (void) const
 
const std::string & getSupervisorConfigurationPath (void) const
 
void resetPropertiesAreSetup (void)
 
ConfigurationTree getSupervisorTreeNode (void)
 
void loadUserSupervisorProperties (void)
 
template<class T >
void setSupervisorProperty (const std::string &propertyName, const T &propertyValue)
 
void setSupervisorProperty (const std::string &propertyName, const std::string &propertyValue)
 
template<class T >
void addSupervisorProperty (const std::string &propertyName, const T &propertyValue)
 
void addSupervisorProperty (const std::string &propertyName, const std::string &propertyValue)
 
template<class T >
getSupervisorProperty (const std::string &propertyName)
 
template<class T >
getSupervisorProperty (const std::string &propertyName, const T &defaultValue)
 
std::string getSupervisorProperty (const std::string &propertyName)
 
std::string getSupervisorProperty (const std::string &propertyName, const std::string &defaultValue)
 getSupervisorProperty
 
WebUsers::permissionLevel_t getSupervisorPropertyUserPermissionsThreshold (const std::string &requestType)
 
time_t getSupervisorUptime (void) const
 

Static Public Member Functions

static void extractPermissionsMapFromString (const std::string &permissionsString, std::map< std::string, WebUsers::permissionLevel_t > &permissionsMap)
 
static bool doPermissionsGrantAccess (std::map< std::string, WebUsers::permissionLevel_t > &permissionLevelsMap, std::map< std::string, WebUsers::permissionLevel_t > &permissionThresholdsMap)
 

Public Attributes

AllSupervisorInfo allSupervisorInfo_
 
ConfigurationManagertheConfigurationManager_
 

Protected Member Functions

xoap::MessageReference TRACESupervisorRequest (xoap::MessageReference message)
 
const std::string & getTraceLevels (void)
 
const std::string & setTraceLevels (std::string const &host, std::string const &mode, std::string const &labelsStr, uint32_t setValueMSB, uint32_t setValueLSB)
 
const std::string & setIndividualTraceLevels (std::string const &host, std::string const &mode, std::string const &labelValuesStr)
 
const std::string & getTraceTriggerStatus (void)
 
const std::string & setTraceTriggerEnable (std::string const &host, size_t entriesAfterTrigger)
 
const std::string & resetTRACE (std::string const &host)
 
const std::string & enableTRACE (std::string const &host, bool enable)
 
const std::string & getTraceSnapshot (std::string const &host, std::string const &filterFor, std::string const &filterOut)
 

Static Protected Member Functions

static void indicateOtsAlive (const CorePropertySupervisorBase *properties=0)
 
static void indicateOtsDead (const CorePropertySupervisorBase *properties=0)
 

Protected Attributes

const std::string supervisorClass_
 
const std::string supervisorClassNoNamespace_
 
ITRACEControllertheTRACEController_
 only define for an app that receives a command
 

Static Protected Attributes

static const struct ots::CorePropertySupervisorBase::SupervisorProperties SUPERVISOR_PROPERTIES
 

Friends

class GatewaySupervisor
 for access to indicateOtsAlive()
 

Detailed Description

CorePropertySupervisorBase This class provides supervisor property get and set functionality. It has member variables generally useful to the configuration of client supervisors.

Definition at line 54 of file CorePropertySupervisorBase.h.

Member Function Documentation

◆ doPermissionsGrantAccess()

bool CorePropertySupervisorBase::doPermissionsGrantAccess ( std::map< std::string, WebUsers::permissionLevel_t > &  permissionLevelsMap,
std::map< std::string, WebUsers::permissionLevel_t > &  permissionThresholdsMap 
)
static

doPermissionsGrantAccess Static function that checks permissionLevelsMap against permissionThresholdsMap and returns true if access requirements are met.

This is useful in standardizing approach for supervisors in case of of special permissions handling. For example, used to serve Desktop Icons.

permissionLevelsString format is as follows: <groupName>:<permissionsLevel> pairs separated by ',' '&' or '|' for example, to be a standard user and an admin on the pixel team and no access to calorimeter team: allUsers:1 | pixelTeam:255 | calorimeterTeam:0

permissionThresoldsString format is as follows: <groupName>:<permissionsThreshold> pairs separated by ',' '&' or '|' for example, to give access admins and pixel team but not calorimeter team: allUsers:255 | pixelTeam:1 | calorimeterTeam:0

Definition at line 378 of file CorePropertySupervisorBase.cc.

◆ extractPermissionsMapFromString()

void CorePropertySupervisorBase::extractPermissionsMapFromString ( const std::string &  permissionsString,
std::map< std::string, WebUsers::permissionLevel_t > &  permissionsMap 
)
static

supervisors should use these two static functions to standardize permissions access:

extractPermissionsMapFromString Static function that extract map function to standardize approach in case needed by supervisors for special permissions handling. For example, used to serve Desktop Icons.

permissionsString format is as follows: <groupName>:<permissionsThreshold> pairs separated by ',' '&' or '|' for example, to give access admins and pixel team but not calorimeter team: allUsers:255 | pixelTeam:1 | calorimeterTeam:0

Note: WebUsers::DEFAULT_USER_GROUP = allUsers

Use with CorePropertySupervisorBase::doPermissionsGrantAccess to determine if access is allowed.

Definition at line 347 of file CorePropertySupervisorBase.cc.

◆ getGatewaySupervisorDescriptor()

XDAQ_CONST_CALL xdaq::ApplicationDescriptor * CorePropertySupervisorBase::getGatewaySupervisorDescriptor ( void  )

will be wizard supervisor in wiz mode

will be wizard supervisor in wiz mode, otherwise Gateway Supervisor descriptor

Definition at line 277 of file CorePropertySupervisorBase.cc.

◆ getRequestUserInfo()

void CorePropertySupervisorBase::getRequestUserInfo ( WebUsers::RequestUserInfo userInfo)

getRequestUserInfo ~ extract user info for request based on property configuration

Definition at line 629 of file CorePropertySupervisorBase.cc.

◆ getSupervisorProperty()

std::string CorePropertySupervisorBase::getSupervisorProperty ( const std::string &  propertyName)

getSupervisorProperty string version of template function

Definition at line 580 of file CorePropertySupervisorBase.cc.

◆ getSupervisorPropertyUserPermissionsThreshold()

WebUsers::permissionLevel_t CorePropertySupervisorBase::getSupervisorPropertyUserPermissionsThreshold ( const std::string &  requestType)

getSupervisorPropertyUserPermissionsThreshold returns the threshold based on the requestType

Definition at line 616 of file CorePropertySupervisorBase.cc.

◆ getSupervisorTreeNode()

ConfigurationTree CorePropertySupervisorBase::getSupervisorTreeNode ( void  )

getSupervisorTreeNode ~ try to get this Supervisors configuration tree node

Definition at line 495 of file CorePropertySupervisorBase.cc.

◆ loadUserSupervisorProperties()

void CorePropertySupervisorBase::loadUserSupervisorProperties ( void  )

loadUserSupervisorProperties ~ try to get user supervisor properties

Definition at line 521 of file CorePropertySupervisorBase.cc.

◆ setSupervisorPropertyDefaults()

void CorePropertySupervisorBase::setSupervisorPropertyDefaults ( void  )
virtual

override to control supervisor specific defaults

When overriding, setup default property values here called by CorePropertySupervisorBase constructor before loading user defined property values

Reimplemented in ots::GatewaySupervisor, and ots::CodeEditorSupervisor.

Definition at line 290 of file CorePropertySupervisorBase.cc.

Member Data Documentation

◆ SUPERVISOR_PROPERTIES

const CorePropertySupervisorBase::SupervisorProperties CorePropertySupervisorBase::SUPERVISOR_PROPERTIES
staticprotected
Initial value:
=
CorePropertySupervisorBase::SupervisorProperties()

Definition at line 8 of file CorePropertySupervisorBase.cc.


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