Line data Source code
1 : /* 2 : * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : 5 : #ifndef ksync_agent_sandesh_h_ 6 : #define ksync_agent_sandesh_h_ 7 : 8 : #include <oper/agent_sandesh.h> 9 : #include "interface_ksync.h" 10 : #include <cmn/agent_cmn.h> 11 : 12 : class AgentKsyncSandesh; 13 : typedef class boost::shared_ptr<AgentKsyncSandesh> AgentKsyncSandeshPtr; 14 : class AgentKsyncSandesh { 15 : public: 16 : AgentKsyncSandesh(const std::string &context); 17 0 : virtual ~AgentKsyncSandesh() { } 18 : void DoKsyncSandesh(AgentKsyncSandeshPtr sandesh); 19 : void DoKsyncSandeshInternal(AgentKsyncSandeshPtr sandesh); 20 : void SetResp(); 21 : virtual bool UpdateResp(KSyncEntry *entry) = 0; 22 : virtual KSyncDBObject *AgentGetKsyncObject() = 0; 23 : virtual void Alloc() = 0; 24 : 25 : protected: 26 : SandeshResponse *resp_; 27 : std::string context_; 28 : const std::string name_; 29 : Agent *agent_; 30 : }; 31 : 32 : //////////////////////////// 33 : //// ksync interface ////// 34 : /////////////////////////// 35 : class AgentKsyncIntfSandesh : public AgentKsyncSandesh { 36 : public: 37 : AgentKsyncIntfSandesh(const std::string &context); 38 0 : ~AgentKsyncIntfSandesh() { } 39 : bool UpdateResp(KSyncEntry *entry) ; 40 : KSyncDBObject *AgentGetKsyncObject() ; 41 : void Alloc() ; 42 : 43 : private: 44 : friend class KSyncItfReq; 45 : }; 46 : 47 : //////////////////////////// 48 : //// ksync NextHopList ////// 49 : /////////////////////////// 50 : class AgentKsyncNhListSandesh : public AgentKsyncSandesh { 51 : public: 52 : AgentKsyncNhListSandesh(const std::string &context) ; 53 0 : ~AgentKsyncNhListSandesh() { } 54 : bool UpdateResp(KSyncEntry *entry) ; 55 : KSyncDBObject *AgentGetKsyncObject() ; 56 : void Alloc() ; 57 : 58 : private: 59 : friend class KSyncNhListReq; 60 : }; 61 : #endif /*ksync_agent_sandesh_h_*/