5 #ifndef vnsw_agent_resource_sandesh_map_hpp
6 #define vnsw_agent_resource_sandesh_map_hpp
7 #include "resource_manager/resource_manager_types.h"
22 const std::string &name,
23 const std::string& file_name);
40 static const std::string
FindFile(
const std::string &root,
41 const std::string & file_ext);
47 template <
typename T1,
typename T2>
69 typedef std::map<uint32_t, VrfMplsResource>
Map;
85 typedef std::map<uint32_t, VlanMplsResource>
Map;
102 typedef std::map<uint32_t, InterfaceIndexResource>
Map;
118 typedef std::map<uint32_t, RouteMplsResource>
Map;
134 typedef std::map<uint32_t, VmInterfaceIndexResource>
Map;
150 typedef std::map<uint32_t, VrfIndexResource>
Map;
166 typedef std::map<uint32_t, QosIndexResource>
Map;
183 typedef std::map<uint32_t, BgpAsServiceIndexResource>
Map;
199 typedef std::map<uint32_t, MirrorIndexResource>
Map;
217 typedef pair<uint32_t, InterfaceIndexResource>
220 typedef pair<uint32_t, VmInterfaceIndexResource>
224 typedef pair<uint32_t, BgpAsServiceIndexResource>
233 InterfaceIndexResource data );
236 VrfMplsResource data);
239 VlanMplsResource data);
242 RouteMplsResource data);
246 VmInterfaceIndexResource data);
250 VrfIndexResource data);
254 QosIndexResource data);
258 BgpAsServiceIndexResource data);
262 MirrorIndexResource data);
VlanMplsBackUpResourceTable & vlan_mpls_index_table()
virtual bool WriteToFile()=0
pair< uint32_t, QosIndexResource > QosIndexResourcePair
VrfMplsBackUpResourceTable(ResourceBackupManager *manager)
void AddVrfResourceEntry(uint32_t index, VrfIndexResource data)
pair< uint32_t, VlanMplsResource > VlanMplsResourcePair
ResourceSandeshMaps(ResourceBackupManager *manager)
RouteMplsBackUpResourceTable & route_mpls_index_table()
std::string file_name_prefix_
void AddRouteMplsResourceEntry(uint32_t index, RouteMplsResource data)
VmInterfaceBackUpResourceTable & vm_interface_index_table()
DISALLOW_COPY_AND_ASSIGN(ResourceSandeshMaps)
std::map< uint32_t, MirrorIndexResource > Map
std::map< uint32_t, VmInterfaceIndexResource > Map
void DeleteInterfaceMplsResourceEntry(uint32_t index)
DISALLOW_COPY_AND_ASSIGN(BackUpResourceTable)
void AddVlanMplsResourceEntry(uint32_t index, VlanMplsResource data)
virtual ~QosBackUpResourceTable()
VrfBackUpResourceTable & vrf_index_table()
QosBackUpResourceTable & qos_index_table()
void DeleteVmInterfaceResourceEntry(uint32_t index)
void AddVrfMplsResourceEntry(uint32_t index, VrfMplsResource data)
virtual ~VmInterfaceBackUpResourceTable()
BgpAsServiceBackUpResourceTable & bgp_as_service_index_table()
boost::shared_ptr< ResourceKey > KeyPtr
virtual ~MirrorBackUpResourceTable()
virtual void RestoreResource()=0
void DeleteVrfResourceEntry(uint32_t index)
BgpAsServiceBackUpResourceTable bgp_as_service_index_table_
boost::shared_ptr< ResourceData > DataPtr
uint32_t backup_idle_timeout_
ResourceBackupManager * backup_manager_
pair< uint32_t, RouteMplsResource > RouteMplsResourcePair
virtual ~RouteMplsBackUpResourceTable()
void AddQosResourceEntry(uint32_t index, QosIndexResource data)
virtual ~VrfMplsBackUpResourceTable()
const std::string & file_name_str()
uint64_t last_modified_time_
static const std::string FindFile(const std::string &root, const std::string &file_ext)
pair< uint32_t, BgpAsServiceIndexResource > BgpAsServiceIndexResourcePair
virtual ~ResourceSandeshMaps()
InterfaceMplsBackUpResourceTable(ResourceBackupManager *manager)
virtual ~VlanMplsBackUpResourceTable()
static const uint8_t kFallBackCount
VrfMplsBackUpResourceTable vrf_mpls_index_table_
BackUpResourceTable(ResourceBackupManager *manager, const std::string &name, const std::string &file_name)
QosBackUpResourceTable(ResourceBackupManager *manager)
pair< uint32_t, VmInterfaceIndexResource > VmInterfaceIndexResourcePair
VlanMplsBackUpResourceTable vlan_mpls_index_table_
std::map< uint32_t, RouteMplsResource > Map
void DeleteVlanMplsResourceEntry(uint32_t index)
pair< uint32_t, MirrorIndexResource > MirrorIndexResourcePair
virtual ~BackUpResourceTable()
std::string file_name_str_
ResourceBackupManager * backup_manager()
VmInterfaceBackUpResourceTable(ResourceBackupManager *manager)
pair< uint32_t, VrfIndexResource > VrfIndexResourcePair
void EnqueueRestore(ResourceManager::KeyPtr key, ResourceManager::DataPtr data)
VrfBackUpResourceTable(ResourceBackupManager *manager)
void DeleteRouteMplsResourceEntry(uint32_t index)
VrfBackUpResourceTable vrf_index_table_
const std::string & backup_dir()
void DeleteQosResourceEntry(uint32_t index)
RouteMplsBackUpResourceTable(ResourceBackupManager *manager)
void DeleteMirrorResourceEntry(uint32_t index)
pair< uint32_t, VrfMplsResource > VrfMplsResourcePair
InterfaceMplsBackUpResourceTable & interface_mpls_index_table()
pair< uint32_t, InterfaceIndexResource > InterfaceMplsResourcePair
std::map< uint32_t, InterfaceIndexResource > Map
void AddBgpAsServiceResourceEntry(uint32_t index, BgpAsServiceIndexResource data)
InterfaceMplsBackUpResourceTable interface_mpls_index_table_
const std::string & file_name_prefix()
MirrorBackUpResourceTable & mirror_index_table()
std::map< uint32_t, VlanMplsResource > Map
MirrorBackUpResourceTable(ResourceBackupManager *manager)
std::map< uint32_t, VrfIndexResource > Map
VmInterfaceBackUpResourceTable vm_interface_index_table_
void AddVmInterfaceResourceEntry(uint32_t index, VmInterfaceIndexResource data)
std::map< uint32_t, BgpAsServiceIndexResource > Map
virtual void ReadFromFile()=0
std::map< uint32_t, VrfMplsResource > Map
void DeleteVrfMplsResourceEntry(uint32_t index)
RouteMplsBackUpResourceTable route_mpls_index_table_
QosBackUpResourceTable qos_index_table_
VlanMplsBackUpResourceTable(ResourceBackupManager *manager)
ResourceBackupManager * backup_manager_
MirrorBackUpResourceTable mirror_index_table_
virtual ~VrfBackUpResourceTable()
void AddInterfaceMplsResourceEntry(uint32_t index, InterfaceIndexResource data)
virtual ~BgpAsServiceBackUpResourceTable()
void AddMirrorResourceEntry(uint32_t index, MirrorIndexResource data)
BgpAsServiceBackUpResourceTable(ResourceBackupManager *manager)
void ReadMapFromFile(T *sandesh_data, const std::string &root)
static bool CalculateHashSum(const std::string &file_name, uint32_t *hashsum)
bool WriteMapToFile(T1 *sandesh_data, const T2 &index_map)
VrfMplsBackUpResourceTable & vrf_mpls_index_table()
void DeleteBgpAsServiceResourceEntry(uint32_t index)
std::map< uint32_t, QosIndexResource > Map
virtual ~InterfaceMplsBackUpResourceTable()