AlarmNotifications
PANDA Slow Control Alarm Daemon
alarmconfiguration.h
Go to the documentation of this file.
1 
34 #ifndef ALARMCONFIGURATION_H
35 #define ALARMCONFIGURATION_H
36 
37 #include "oldgcccompat.h" // Compatibilty macros for GCC < 4.7
38 
39 #include <deque>
40 #include <vector>
41 #include <QtCore/QString>
42 #include <KDE/KSharedConfig>
43 #include <KDE/KConfigGroup>
44 #include <KDE/KConfigSkeleton>
45 
47 {
48 
59 {
60 private:
66  const std::string _configfilelocation;
72  KSharedConfigPtr _backend;
78  KConfigSkeleton _skeleton;
86  QString _activemquri;
162  KConfigSkeleton::ItemString* _activemquriitem;
168  KConfigSkeleton::ItemString* _activemqusernameitem;
174  KConfigSkeleton::ItemString* _activemqpassworditem;
180  KConfigSkeleton::ItemString* _activemqtopicnameitem;
186  KConfigSkeleton::ItemUInt* _laboratorynotificationtimeoutitem;
192  KConfigSkeleton::ItemUInt* _desktopnotificationtimeoutitem;
198  KConfigSkeleton::ItemUInt* _emailnotificationtimeoutitem;
204  KConfigSkeleton::ItemString* _emailnotificationfromitem;
210  KConfigSkeleton::ItemString* _emailnotificationtoitem;
216  KConfigSkeleton::ItemString* _emailnotificationservernameitem;
222  KConfigSkeleton::ItemUInt* _emailnotificationserverportitem;
228  KConfigSkeleton::ItemString* _flashlightrelaisdevicenodeitem;
238  static std::string CreateConfigFileLocation();
253 public:
267  AlarmConfiguration ( const AlarmConfiguration& other ) = delete;
274  AlarmConfiguration ( AlarmConfiguration&& other ) = delete;
288  AlarmConfiguration& operator= ( const AlarmConfiguration& other ) = delete;
296  AlarmConfiguration& operator= ( AlarmConfiguration&& other ) = delete;
303  const std::string& getConfigFileLocation() const noexcept;
310  void ReReadConfiguration();
317  void WriteConfiguration();
326  std::string getActiveMQURI() const noexcept;
334  void setActiveMQURI ( const std::string& newSetting );
343  std::string getActiveMQUsername() const noexcept;
351  void setActiveMQUsername ( const std::string& newSetting );
360  std::string getActiveMQPassword() const noexcept;
368  void setActiveMQPassword ( const std::string& newSetting );
377  std::string getActiveMQTopicName() const noexcept;
385  void setActiveMQTopicName ( const std::string& newSetting );
394  unsigned int getLaboratoryNotificationTimeout() const noexcept;
402  void setLaboratoryNotificationTimeout ( const unsigned int newSetting );
411  unsigned int getDesktopNotificationTimeout() const noexcept;
419  void setDesktopNotificationTimeout ( const unsigned int newSetting );
428  unsigned int getEMailNotificationTimeout() const noexcept;
436  void setEMailNotificationTimeout ( const unsigned int newSetting );
445  std::string getEMailNotificationFrom() const noexcept;
453  void setEMailNotificationFrom ( const std::string& newSetting );
462  std::string getEMailNotificationTo() const noexcept;
470  void setEMailNotificationTo ( const std::string& newSetting );
479  std::string getEMailNotificationServerName() const noexcept;
487  void setEMailNotificationServerName ( const std::string& newSetting );
496  unsigned int getEMailNotificationServerPort() const noexcept;
504  void setEMailNotificationServerPort ( const unsigned int newSetting );
513  std::string getFlashLightRelaisDeviceNode() const noexcept;
521  void setFlashLightRelaisDevideNode ( const std::string& newSetting );
530  KSharedConfigPtr internal();
539  KConfigSkeleton* internal_skel();
540 };
541 
542 }
543 
544 #endif // ALARMCONFIGURATION_H
KConfigSkeleton _skeleton
KConfig skeleton.
unsigned int _desktopnotificationtimeout
Timeout for sending a desktop notification.
KConfigSkeleton * internal_skel()
INTERNAL METHOD: Skeleton of the configuration.
QString _emailnotificationservername
Name of the SMTP server.
QString _activemqpassword
ActiveMQ password.
void ReReadConfiguration()
Read configuration again from disk.
Compatibility macros for older versions of the GCC.
KConfigSkeleton::ItemUInt * _emailnotificationserverportitem
KConfig item for _emailnotificationserverport setting.
STL namespace.
void setActiveMQTopicName(const std::string &newSetting)
Change JMS topic used by the CSS Alarm Server.
std::string getActiveMQTopicName() const noexcept
JMS topic used by the CSS Alarm Server.
void setEMailNotificationTo(const std::string &newSetting)
Change the recipient address for alarm e-mail notifications.
void setFlashLightRelaisDevideNode(const std::string &newSetting)
Change the device node of the USB relais for the alarm flash light.
KConfigSkeleton::ItemString * _activemquriitem
KConfig item for _activemquri setting.
QString _emailnotificationto
Recipient address for alarm e-mail notifications.
std::string getEMailNotificationTo() const noexcept
Recipient address for alarm e-mail notifications.
QString _flashlightrelaisdevicenode
Device node of the USB relais for the alarm flash light.
KConfigSkeleton::ItemUInt * _emailnotificationtimeoutitem
KConfig item for _emailnotificationtimeout setting.
QString _activemqtopicname
JMS topic name used by CSS Alarm Server.
KConfigSkeleton::ItemString * _activemqpassworditem
KConfig item for _activemqpassword setting.
void setEMailNotificationServerName(const std::string &newSetting)
Change the name of the STMP server.
void WriteConfiguration()
Write configuration to disk.
void setEMailNotificationFrom(const std::string &newSetting)
Change the Sender address for alarm e-mail notifications.
void CreateActiveMQConnectivitySettings()
Create ActiveMQ connectivity settings.
unsigned int getEMailNotificationServerPort() const noexcept
Port of SMTP server.
KConfigSkeleton::ItemString * _activemqtopicnameitem
KConfig item for _activemqtopicname setting.
void setEMailNotificationTimeout(const unsigned int newSetting)
Change the timeout for sending an e-mail notification.
void setEMailNotificationServerPort(const unsigned int newSetting)
Change the port of SMTP server.
unsigned int _emailnotificationserverport
Port of SMTP server.
std::string getFlashLightRelaisDeviceNode() const noexcept
Device node of the USB relais for the alarm flash light.
void setLaboratoryNotificationTimeout(const unsigned int newSetting)
Change the timeout for starting alarm notification in the laboratory.
Namespace for Alarm Notifications application.
std::string getEMailNotificationFrom() const noexcept
Sender address for alarm e-mail notifications.
KSharedConfigPtr internal()
INTERNAL METHOD: Shared pointer to KConfig instance.
unsigned int getDesktopNotificationTimeout() const noexcept
Timeout for sending a desktop notification.
const std::string _configfilelocation
Path to the configuration file.
unsigned int _emailnotificationtimeout
Timeout for sending an e-mail notification.
QString _activemqusername
ActiveMQ username.
KConfigSkeleton::ItemString * _activemqusernameitem
KConfig item for _activemqusername setting.
static std::string CreateConfigFileLocation()
Establish location of the configuration file.
void setActiveMQUsername(const std::string &newSetting)
Change ActiveMQ connection username.
KConfigSkeleton::ItemString * _emailnotificationservernameitem
KConfig item for _emailnotificationservername setting.
unsigned int getLaboratoryNotificationTimeout() const noexcept
Timeout for starting alarm notification in the laboratory.
void setActiveMQURI(const std::string &newSetting)
Change ActiveMQ connection URI.
#define noexcept
Allow using the noexcept keyword with GCC < 4.6.
Definition: oldgcccompat.h:52
std::string getEMailNotificationServerName() const noexcept
Name of the SMTP server.
std::string getActiveMQPassword() const noexcept
ActiveMQ connection password.
KSharedConfigPtr _backend
KConfig backend.
void setActiveMQPassword(const std::string &newSetting)
Change ActiveMQ connection password.
KConfigSkeleton::ItemUInt * _laboratorynotificationtimeoutitem
KConfig item for _laboratorynotificationtimeout setting.
const std::string & getConfigFileLocation() const noexcept
Query config file location.
void setDesktopNotificationTimeout(const unsigned int newSetting)
Change the timeout for sending a desktop notification.
KConfigSkeleton::ItemUInt * _desktopnotificationtimeoutitem
KConfig item for _desktopnotificationtimeout setting.
KConfigSkeleton::ItemString * _emailnotificationfromitem
KConfig item for _emailnotificationfrom setting.
KConfigSkeleton::ItemString * _flashlightrelaisdevicenodeitem
KConfig item for _flashlightrelaisdevicenode setting.
std::string getActiveMQUsername() const noexcept
ActiveMQ connection username.
QString _emailnotificationfrom
Sender address for alarm e-mail notifications.
static AlarmConfiguration & instance() noexcept
Get singleton instance.
KConfigSkeleton::ItemString * _emailnotificationtoitem
KConfig item for _emailnotificationto setting.
std::string getActiveMQURI() const noexcept
ActiveMQ connection URI.
Configuration of the AlarmNotifications application.
unsigned int getEMailNotificationTimeout() const noexcept
Timeout for sending an e-mail notification.
unsigned int _laboratorynotificationtimeout
Timeout for starting alarm notification in the laboratory.