NCBI C++ ToolKit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CPSGAlerts Class Reference

Search Toolkit Book for CPSGAlerts

#include "alerts.hpp"
(Private to src/app/pubseq_gateway/server.)

+ Collaboration diagram for CPSGAlerts:

Public Member Functions

void Register (EPSGS_AlertType alert_type, const string &message)
 
EPSGS_AlertAckResult Acknowledge (const string &alert_id, const string &user)
 
EPSGS_AlertAckResult Acknowledge (EPSGS_AlertType alert_type, const string &user)
 
CJsonNode Serialize (void) const
 
CJsonNode SerializeActive (void) const
 

Private Member Functions

EPSGS_AlertType x_IdToType (const string &alert_id) const
 
string x_TypeToId (EPSGS_AlertType type) const
 

Private Attributes

mutex m_Lock
 
map< EPSGS_AlertType, SPSGAlertAttributesm_Alerts
 

Detailed Description

Definition at line 100 of file alerts.hpp.

Member Function Documentation

◆ Acknowledge() [1/2]

EPSGS_AlertAckResult CPSGAlerts::Acknowledge ( const string alert_id,
const string user 
)

Definition at line 118 of file alerts.cpp.

References ePSGS_AlertNotFound, ePSGS_Unknown, and x_IdToType().

Referenced by CPubseqGatewayApp::OnAckAlert().

◆ Acknowledge() [2/2]

EPSGS_AlertAckResult CPSGAlerts::Acknowledge ( EPSGS_AlertType  alert_type,
const string user 
)

◆ Register()

void CPSGAlerts::Register ( EPSGS_AlertType  alert_type,
const string message 
)

◆ Serialize()

CJsonNode CPSGAlerts::Serialize ( void  ) const

Definition at line 172 of file alerts.cpp.

References m_Alerts, m_Lock, CJsonNode::NewObjectNode(), result, and x_TypeToId().

Referenced by CPubseqGatewayApp::OnGetAlerts().

◆ SerializeActive()

CJsonNode CPSGAlerts::SerializeActive ( void  ) const

Definition at line 187 of file alerts.cpp.

References m_Alerts, m_Lock, CJsonNode::NewObjectNode(), result, and x_TypeToId().

Referenced by CPubseqGatewayApp::OnHealth().

◆ x_IdToType()

EPSGS_AlertType CPSGAlerts::x_IdToType ( const string alert_id) const
private

Definition at line 151 of file alerts.cpp.

References NStr::CompareNocase(), ePSGS_Unknown, kAlertToIdMap, kAlertToIdMapSize, and SAlertToId::type.

Referenced by Acknowledge().

◆ x_TypeToId()

string CPSGAlerts::x_TypeToId ( EPSGS_AlertType  type) const
private

Definition at line 161 of file alerts.cpp.

References SAlertToId::id, kAlertToIdMap, and kAlertToIdMapSize.

Referenced by Serialize(), and SerializeActive().

Member Data Documentation

◆ m_Alerts

map<EPSGS_AlertType, SPSGAlertAttributes> CPSGAlerts::m_Alerts
private

Definition at line 113 of file alerts.hpp.

Referenced by Acknowledge(), Register(), Serialize(), and SerializeActive().

◆ m_Lock

mutex CPSGAlerts::m_Lock
mutableprivate

Definition at line 112 of file alerts.hpp.

Referenced by Acknowledge(), Register(), Serialize(), and SerializeActive().


The documentation for this class was generated from the following files:
Modified on Sun May 19 04:46:37 2024 by modify_doxy.py rev. 669887