OpenSDN source code
resource_backup.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef vnsw_agent_resource_backup_hpp
7 #define vnsw_agent_resource_backup_hpp
8 
9 
12 
13 class Timer;
15 class ResourceManager;
16 class ResourceTable;
17 class ResourceData;
18 
20 public:
21  enum Op {
22  ADD = 1,
23  DEL,
24  };
25 
28  Op op);
29  virtual ~ResourceBackupReq();
30  void Process();
33 
34 
35 private:
40 };
41 //Backup manager is to Process the Resource data and store
42 //it in to a file using Sandesh encoding.
44 public:
45  typedef boost::shared_ptr<ResourceBackupReq> ResourceBackupReqPtr;
47  virtual ~ResourceBackupManager();
48 
49  void Init();
51  static uint32_t ReadResourceDataFromFile(const std::string &file_name,
52  std::unique_ptr<uint8_t> *buf);
53 
54  Agent *agent() {return agent_;}
60  void AuditDone();
61 
62 private:
66  // Work queue to backup the data.
70 };
71 
72 #endif
Definition: agent.h:361
static uint32_t ReadResourceDataFromFile(const std::string &file_name, std::unique_ptr< uint8_t > *buf)
ResourceBackupManager(ResourceManager *mgr)
WorkQueue< ResourceBackupReqPtr > backup_work_queue_
boost::shared_ptr< ResourceBackupReq > ResourceBackupReqPtr
ResourceSandeshMaps sandesh_maps_
void BackupResource(ResourceManager::KeyPtr key, ResourceManager::DataPtr data, ResourceBackupReq::Op op)
DISALLOW_COPY_AND_ASSIGN(ResourceBackupManager)
ResourceSandeshMaps & sandesh_maps()
bool WorkQueueBackUpProcess(ResourceBackupReqPtr backup_data)
ResourceManager * resource_manager()
EventNotifyHandle::Ptr audit_handle_
virtual ~ResourceBackupManager()
ResourceManager * resource_manager_
ResourceManager::DataPtr data()
ResourceManager::KeyPtr key_
ResourceManager::KeyPtr key()
ResourceBackupReq(ResourceManager::KeyPtr key, ResourceManager::DataPtr data, Op op)
DISALLOW_COPY_AND_ASSIGN(ResourceBackupReq)
virtual ~ResourceBackupReq()
ResourceManager::DataPtr data_
boost::shared_ptr< ResourceKey > KeyPtr
boost::shared_ptr< ResourceData > DataPtr
Definition: timer.h:58
boost::shared_ptr< EventNotifyHandle > Ptr