|
ifw-sup
1.0.0
|
#include <dataContext.hpp>
Public Member Functions | |
| DataContext (IConfig &config, rad::DbAdapter &db_adapter, boost::asio::io_service &ios) | |
| virtual | ~DataContext () |
| void | ReloadConfig () |
| void | UpdateDb () |
| DbInterface & | GetDbInterface () |
| IConfig & | GetConfig () |
| State::StateEnum | GetState () |
| Get server actual state. More... | |
| void | SetState (const State::StateEnum state) |
| Set server actual state. More... | |
| void | SetState (const std::string &state) |
| Set server actual state. More... | |
| State::SubstateEnum | GetSubstate () |
| Get server actual substate. More... | |
| void | SetSubstate (const State::SubstateEnum state) |
| Set server actual substate. More... | |
| void | SetSubstate (const std::string &state) |
| Set server actual substate. More... | |
| State::StateEnum | GetEstimatedState () |
| Get actual estimated state. More... | |
| std::string | GetEstimatedStateStr () |
| Set actual estimated state as string. More... | |
| void | SetEstimatedState (const State::StateEnum state) |
| Set actual estimated state. More... | |
| std::string | GetEstimatedSubstateStr () |
| Get actual estimated substate as string. More... | |
| State::SubstateEnum | GetEstimatedSubstate () |
| Get actual estimated substate. More... | |
| void | SetEstimatedSubstate (const State::SubstateEnum state) |
| Set actual estimated substate. More... | |
| void | PublishStates () |
| Publish actual states. More... | |
This class provide access to the application run-time data including the in-memory DB.
| sup::syssup::common::DataContext::DataContext | ( | IConfig & | config, |
| rad::DbAdapter & | db_adapter, | ||
| boost::asio::io_service & | ios | ||
| ) |
This constructor uses the application configuration to initialize the adapter object to the in-memory DB. The DB adapter is then used to initialize the DB interface object that can be used to access the DB key-value pairs.
| [in] | config | Reference to the application configuration. |
| [in] | db_adapter | DB adapter object |
| [in] | ios | ASIO IO service reference |
|
virtual |
Destructor
| DbInterface & sup::syssup::common::DataContext::GetDbInterface | ( | ) |
| State::StateEnum sup::syssup::common::DataContext::GetEstimatedState | ( | ) |
Get actual estimated state.
| std::string sup::syssup::common::DataContext::GetEstimatedStateStr | ( | ) |
Set actual estimated state as string.
| State::SubstateEnum sup::syssup::common::DataContext::GetEstimatedSubstate | ( | ) |
Get actual estimated substate.
| std::string sup::syssup::common::DataContext::GetEstimatedSubstateStr | ( | ) |
Get actual estimated substate as string.
| State::StateEnum sup::syssup::common::DataContext::GetState | ( | ) |
Get server actual state.
| State::SubstateEnum sup::syssup::common::DataContext::GetSubstate | ( | ) |
Get server actual substate.
| void sup::syssup::common::DataContext::PublishStates | ( | ) |
Publish actual states.
It updates the OLDB and publish status via CII pub/sub.
| void sup::syssup::common::DataContext::ReloadConfig | ( | ) |
Reload the configuration from file and reconnect to the in-memory DB.
| void sup::syssup::common::DataContext::SetEstimatedState | ( | const State::StateEnum | state | ) |
Set actual estimated state.
| state | new state as string |
| void sup::syssup::common::DataContext::SetEstimatedSubstate | ( | const State::SubstateEnum | state | ) |
Set actual estimated substate.
| state | new substate as string |
| void sup::syssup::common::DataContext::SetState | ( | const State::StateEnum | state | ) |
Set server actual state.
| state | new state as enumeration |
| void sup::syssup::common::DataContext::SetState | ( | const std::string & | state | ) |
Set server actual state.
| state | new state as string |
| void sup::syssup::common::DataContext::SetSubstate | ( | const State::SubstateEnum | state | ) |
Set server actual substate.
| state | new substate as enumeration |
| void sup::syssup::common::DataContext::SetSubstate | ( | const std::string & | state | ) |
Set server actual substate.
| state | new substate as string |
| void sup::syssup::common::DataContext::UpdateDb | ( | ) |
Try to connect to the DB and update the application configuration.