rad 6.2.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rad::DataContext Class Referenceabstract

#include <dataContext.hpp>

Inheritance diagram for rad::DataContext:
AppDataContext exciiserver::DataContext rad::utest::DataContext

Public Types

enum class  TrsHealthState { UNKNOWN , DISABLED , GOOD , BAD }
 

Public Member Functions

 DataContext ()
 
virtual ~DataContext ()=default
 
virtual void Initialize ()
 
virtual void ReloadConfig ()=0
 
virtual ConfigGetConfig ()=0
 
virtual void UpdateDb ()=0
 
virtual OldbInterfaceGetOldbInterface ()=0
 
virtual void SetTrsHealth (TrsHealthState health)
 
virtual TrsHealthState GetTrsHealth ()
 

Detailed Description

This interface contains mandatory methods used by the rad::Application class to retrieve application specific configuration and access/update CII OLDB.

Member Enumeration Documentation

◆ TrsHealthState

Enum gets used for methods SetTrsHealth, GetTrsHealth.

Enumerator
UNKNOWN 

Either we don´t know yet if health checks are enabled or disabled, or they are enabled but we don´t know yet if health is GOOD or BAD.

DISABLED 

TRS health checks are disabled. We do not expect to receive any TrsEvents.HealthGood or TrsEvents.HealthBad events.

GOOD 

TRS health checks are enabled. Last event received was TrsEvents.HealthGood.

BAD 

TRS health checks are enabled. Last event received was TrsEvents.HealthBad.

Constructor & Destructor Documentation

◆ DataContext()

rad::DataContext::DataContext ( )

◆ ~DataContext()

virtual rad::DataContext::~DataContext ( )
virtualdefault

Member Function Documentation

◆ GetConfig()

virtual Config & rad::DataContext::GetConfig ( )
pure virtual
Returns
reference to the Config object.

Implemented in exciiserver::DataContext, AppDataContext, and rad::utest::DataContext.

◆ GetOldbInterface()

virtual OldbInterface & rad::DataContext::GetOldbInterface ( )
pure virtual
Returns
A reference to the OLDB interface object.

Implemented in exciiserver::DataContext, AppDataContext, and rad::utest::DataContext.

◆ GetTrsHealth()

DataContext::TrsHealthState rad::DataContext::GetTrsHealth ( )
virtual

Gets the TRS health state.

◆ Initialize()

void rad::DataContext::Initialize ( )
virtual

This method allows to re-initialize the application data context after the configuration has been loaded at startup.

For example the OLDB prefix used by the OldbAsyncWriter may need to be reset after the configuration has been loaded (i.e. after the DataContext and its attributes have been instantiated).

Reimplemented in exciiserver::DataContext.

◆ ReloadConfig()

virtual void rad::DataContext::ReloadConfig ( )
pure virtual

Reload the configuration from file.

Implemented in exciiserver::DataContext, AppDataContext, and rad::utest::DataContext.

◆ SetTrsHealth()

void rad::DataContext::SetTrsHealth ( TrsHealthState health)
virtual

Stores the TRS health state.

◆ UpdateDb()

virtual void rad::DataContext::UpdateDb ( )
pure virtual

Try to connect to the DB and write the application configuration to the OLDB. This method can also be used to create and initialize the monitoring branch of the OLDB.

Implemented in exciiserver::DataContext, AppDataContext, and rad::utest::DataContext.


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