11 #ifndef __SANDESH_CLIENT_SM_H__
12 #define __SANDESH_CLIENT_SM_H__
15 #include <boost/function.hpp>
16 #include <tbb/mutex.h>
18 #include <sandesh/sandesh_session.h>
37 virtual bool ReceiveMsg(
const std::string& msg,
38 const SandeshHeader &header,
const std::string &sandesh_name,
39 const uint32_t header_offset) = 0;
41 const std::string & stateName,
const std::string &
server,
43 const std::vector<TcpServer::Endpoint> & collectors) = 0;
65 int sm_task_instance,
int sm_task_id,
bool periodicuve);
67 virtual const std::string &
StateName()
const = 0;
79 virtual void SetCollectors(
const std::vector<TcpServer::Endpoint> &collectors) = 0;
virtual void InitializeSMSession(int connects)=0
virtual void SetAdminState(bool down)=0
SandeshClientSM(Mgr *mgr)
void set_server(TcpServer::Endpoint e)
virtual bool SendSandeshUVE(Sandesh *snh)=0
TcpServer::Endpoint server_
static const int kTickInterval
SandeshSession * session()
tbb::atomic< SandeshSession * > session_
virtual void SendUVE(int count, const std::string &stateName, const std::string &server, const TcpServer::Endpoint &server_ip, const std::vector< TcpServer::Endpoint > &collectors)=0
bool send_session(Sandesh *snh)
static SandeshClientSM * CreateClientSM(EventManager *evm, Mgr *mgr, int sm_task_instance, int sm_task_id, bool periodicuve)
tbb::atomic< State > state_
void set_session(SandeshSession *session, bool enq)
virtual void DeleteSMSession(SandeshSession *session)=0
TcpServer::Endpoint server()
virtual StatsClient * stats_client() const =0
virtual void SetCollectors(const std::vector< TcpServer::Endpoint > &collectors)=0
virtual bool ReceiveMsg(const std::string &msg, const SandeshHeader &header, const std::string &sandesh_name, const uint32_t header_offset)=0
virtual ~SandeshClientSM()
virtual bool SendSandesh(Sandesh *snh)=0
virtual SandeshSession * CreateSMSession(TcpSession::EventObserver eocb, SandeshReceiveMsgCb rmcb, TcpServer::Endpoint ep)=0
friend class SandeshClientStateMachineTest
virtual void EnqueDelSession(SandeshSession *session)=0
boost::function< bool(const std::string &, SandeshSession *)> SandeshReceiveMsgCb
boost::function< void(TcpSession *, Event)> EventObserver
boost::asio::ip::tcp::endpoint Endpoint
virtual const std::string & StateName() const =0
bool Enqueue(SandeshQueue *queue)