66#ifndef SMARTSTART_MANAGEMENT_HPP
67#define SMARTSTART_MANAGEMENT_HPP
69#include <unordered_map>
186 const std::string &protocol_controller_unid,
219 const std::string &device_unid);
238 bool manual_intervention_required);
240 const std::unordered_map<std::string, Entry> &
get_cache()
const;
The unit data type stored in SmartStart List as value.
Definition: smartstart_management.hpp:117
Entry()=default
smartstart::Entry constructor.
std::string protocol_controller_unid
Definition: smartstart_management.hpp:121
std::vector< std::string > preferred_protocols
Definition: smartstart_management.hpp:123
std::string dsk
Definition: smartstart_management.hpp:119
bool include
Definition: smartstart_management.hpp:120
Entry(const std::string &dsk, bool include, const std::string &protocol_controller_unid, const std::string &device_unid)
Definition: smartstart_management.hpp:133
std::string device_unid
Definition: smartstart_management.hpp:122
bool manual_intervention_required
Definition: smartstart_management.hpp:124
Class that provides APIs to add, update, and access SmartStart List. Also it offers callback for noti...
Definition: smartstart_management.hpp:150
Management(Management &other)=delete
Disable assign and constructor.
bool has_entries_awaiting_inclusion()
Polling function which returns True if there is any entries with Include == true. This could be usefu...
static Management * get_instance()
Get the singleton instance.
notification_function_t _notify_has_entries_awaiting_inclusion
Function called when there are entries waiting for inclusion in the SmartStart list.
Definition: smartstart_management.hpp:162
sl_status_t update_smartstart_cache(const std::string &smartstart_list)
Update the internal cache of SmartStartList.
sl_status_t init(const std::string &protocol_controller_unid, notification_function_t const &has_entries_awaiting_inclusion_callback)
Initialize function that takes protocol controller unid and a callback function signaling when entrie...
std::string _protocol_controller_unid
Definition: smartstart_management.hpp:157
sl_status_t notify_node_removed(const std::string &unid)
Called when a node has been removed and SSM will then update the cache map.
sl_status_t notify_node_added(const std::string &dsk, const std::string &device_unid)
Called when a node has been added and SSM will then update the cache map.
std::vector< Entry > get_cache_entries(const Query &query)
Get the cache entries with given query conditions.
sl_status_t set_manual_intervention_required(const std::string &dsk, bool manual_intervention_required)
Call this function to change the value of the "ManualInterventionRequired" field.
std::unordered_map< std::string, Entry > _smartstart_cache
SmartStart List cache map, key is DSK as a string.
Definition: smartstart_management.hpp:155
const std::unordered_map< std::string, Entry > & get_cache() const
static Management * _instance
Definition: smartstart_management.hpp:164
void operator=(const Management &)=delete
Class that contains key, type, an value for querying SmartStart List.
Definition: smartstart_management.hpp:96
QueryType query_type
Definition: smartstart_management.hpp:98
QueryKey query_key
Definition: smartstart_management.hpp:99
QueryValue query_value
Definition: smartstart_management.hpp:100
Query(QueryType type, QueryKey key, const QueryValue &value)
smartstart::Query constructor.
Definition: smartstart_management.hpp:107
uint32_t sl_status_t
Definition: sl_status.h:139
Definition: smartstart_management.hpp:79
QueryType
Enum class representing types for querying SmartStart List.
Definition: smartstart_management.hpp:87
QueryKey
Enum class representing keys for querying SmartStart List.
Definition: smartstart_management.hpp:83
std::function< void(bool)> notification_function_t
Definition: smartstart_management.hpp:90
std::variant< bool, std::string > QueryValue
Definition: smartstart_management.hpp:89