OpenSDN source code
OVSDB::OvsdbSandeshTask Class Referenceabstract

#include <ovsdb_sandesh.h>

Inheritance diagram for OVSDB::OvsdbSandeshTask:
Collaboration diagram for OVSDB::OvsdbSandeshTask:

Public Types

enum  TableType {
  PHYSICAL_SWITCH_TABLE = 1 , PHYSICAL_PORT_TABLE , LOGICAL_SWITCH_TABLE , VLAN_PORT_TABLE ,
  VRF_TABLE , UNICAST_REMOTE_TABLE , UNICAST_LOCAL_TABLE , MULTICAST_LOCAL_TABLE ,
  HA_STALE_DEV_VN_TABLE , HA_STALE_L2_ROUTE_TABLE , TABLE_MAX
}
 
enum  FilterResp { FilterAllow = 1 , FilterDeny }
 
- Public Types inherited from Task
enum  State { INIT , WAIT , RUN }
 Task states. More...
 
enum  TbbState { TBB_INIT , TBB_ENQUEUED , TBB_EXEC , TBB_DONE }
 

Public Member Functions

 OvsdbSandeshTask (std::string resp_ctx, AgentSandeshArguments &args)
 
 OvsdbSandeshTask (std::string resp_ctx, const std::string &ip, uint32_t port)
 
virtual ~OvsdbSandeshTask ()
 
bool Run ()
 Code to execute. Returns true if task is completed. Return false to reschedule the task. More...
 
std::string Description () const
 
std::string EncodeFirstPage ()
 
- Public Member Functions inherited from Task
 Task (int task_id, int task_instance)
 
 Task (int task_id)
 
virtual ~Task ()
 
virtual void OnTaskCancel ()
 Called on task exit, if it is marked for cancellation. If the user wants to do any cleanup on task cancellation, then he/she can overload this function. More...
 
State GetState () const
 
int GetTaskId () const
 
int GetTaskInstance () const
 
uint64_t GetSeqno () const
 
bool task_cancelled () const
 
uint64_t enqueue_time () const
 
uint64_t schedule_time () const
 
uint32_t execute_delay () const
 
uint32_t schedule_delay () const
 

Static Public Attributes

static const uint8_t kEntriesPerSandesh = 100
 
static const uint8_t kEntriesPerPage = 100
 
- Static Public Attributes inherited from Task
static const int kTaskInstanceAny = -1
 

Protected Attributes

std::string ip_
 
uint32_t port_
 

Private Member Functions

virtual void EncodeArgs (AgentSandeshArguments &args)
 
virtual FilterResp Filter (KSyncEntry *entry)
 
virtual void UpdateResp (KSyncEntry *entry, SandeshResponse *resp)=0
 
virtual SandeshResponseAlloc ()=0
 
virtual KSyncObjectGetObject (OvsdbClientSession *session)=0
 
virtual TableType GetTableType ()=0
 
virtual bool NoSessionObject ()
 
void EncodeSendPageReq (uint32_t display_count, uint32_t table_size)
 
void SendResponse (bool more)
 
 DISALLOW_COPY_AND_ASSIGN (OvsdbSandeshTask)
 

Private Attributes

SandeshResponseresp_
 
std::string resp_data_
 
uint32_t first_
 
uint32_t last_
 
uint32_t total_count_
 
bool needs_next_
 
bool error_
 
std::string error_msg_
 

Additional Inherited Members

- Static Public Member Functions inherited from Task
static TaskRunning ()
 Returns a pointer to the current task the code is executing under. More...
 

Detailed Description

Definition at line 12 of file ovsdb_sandesh.h.

Member Enumeration Documentation

◆ FilterResp

Enumerator
FilterAllow 
FilterDeny 

Definition at line 28 of file ovsdb_sandesh.h.

◆ TableType

Enumerator
PHYSICAL_SWITCH_TABLE 
PHYSICAL_PORT_TABLE 
LOGICAL_SWITCH_TABLE 
VLAN_PORT_TABLE 
VRF_TABLE 
UNICAST_REMOTE_TABLE 
UNICAST_LOCAL_TABLE 
MULTICAST_LOCAL_TABLE 
HA_STALE_DEV_VN_TABLE 
HA_STALE_L2_ROUTE_TABLE 
TABLE_MAX 

Definition at line 14 of file ovsdb_sandesh.h.

Constructor & Destructor Documentation

◆ OvsdbSandeshTask() [1/2]

OvsdbSandeshTask::OvsdbSandeshTask ( std::string  resp_ctx,
AgentSandeshArguments args 
)

Definition at line 32 of file ovsdb_sandesh.cc.

Here is the call graph for this function:

◆ OvsdbSandeshTask() [2/2]

OvsdbSandeshTask::OvsdbSandeshTask ( std::string  resp_ctx,
const std::string &  ip,
uint32_t  port 
)

Definition at line 62 of file ovsdb_sandesh.cc.

◆ ~OvsdbSandeshTask()

OvsdbSandeshTask::~OvsdbSandeshTask ( )
virtual

Definition at line 70 of file ovsdb_sandesh.cc.

Member Function Documentation

◆ Alloc()

◆ Description()

std::string OVSDB::OvsdbSandeshTask::Description ( ) const
inlinevirtual

Implements Task.

Definition at line 42 of file ovsdb_sandesh.h.

◆ DISALLOW_COPY_AND_ASSIGN()

OVSDB::OvsdbSandeshTask::DISALLOW_COPY_AND_ASSIGN ( OvsdbSandeshTask  )
private

◆ EncodeArgs()

◆ EncodeFirstPage()

std::string OvsdbSandeshTask::EncodeFirstPage ( )

Definition at line 144 of file ovsdb_sandesh.cc.

Here is the call graph for this function:

◆ EncodeSendPageReq()

void OvsdbSandeshTask::EncodeSendPageReq ( uint32_t  display_count,
uint32_t  table_size 
)
private

Definition at line 158 of file ovsdb_sandesh.cc.

Here is the call graph for this function:

◆ Filter()

◆ GetObject()

◆ GetTableType()

◆ NoSessionObject()

virtual bool OVSDB::OvsdbSandeshTask::NoSessionObject ( )
inlineprivatevirtual

Reimplemented in OVSDB::HaStaleL2RouteSandeshTask, and OVSDB::HaStaleDevVnSandeshTask.

Definition at line 58 of file ovsdb_sandesh.h.

◆ Run()

bool OvsdbSandeshTask::Run ( )
virtual

Code to execute. Returns true if task is completed. Return false to reschedule the task.

Implements Task.

Definition at line 73 of file ovsdb_sandesh.cc.

Here is the call graph for this function:

◆ SendResponse()

void OvsdbSandeshTask::SendResponse ( bool  more)
private

Definition at line 229 of file ovsdb_sandesh.cc.

Here is the call graph for this function:

◆ UpdateResp()

Member Data Documentation

◆ error_

bool OVSDB::OvsdbSandeshTask::error_
private

Definition at line 70 of file ovsdb_sandesh.h.

◆ error_msg_

std::string OVSDB::OvsdbSandeshTask::error_msg_
private

Definition at line 71 of file ovsdb_sandesh.h.

◆ first_

uint32_t OVSDB::OvsdbSandeshTask::first_
private

Definition at line 66 of file ovsdb_sandesh.h.

◆ ip_

std::string OVSDB::OvsdbSandeshTask::ip_
protected

Definition at line 47 of file ovsdb_sandesh.h.

◆ kEntriesPerPage

const uint8_t OVSDB::OvsdbSandeshTask::kEntriesPerPage = 100
static

Definition at line 34 of file ovsdb_sandesh.h.

◆ kEntriesPerSandesh

const uint8_t OVSDB::OvsdbSandeshTask::kEntriesPerSandesh = 100
static

Definition at line 33 of file ovsdb_sandesh.h.

◆ last_

uint32_t OVSDB::OvsdbSandeshTask::last_
private

Definition at line 67 of file ovsdb_sandesh.h.

◆ needs_next_

bool OVSDB::OvsdbSandeshTask::needs_next_
private

Definition at line 69 of file ovsdb_sandesh.h.

◆ port_

uint32_t OVSDB::OvsdbSandeshTask::port_
protected

Definition at line 48 of file ovsdb_sandesh.h.

◆ resp_

SandeshResponse* OVSDB::OvsdbSandeshTask::resp_
private

Definition at line 64 of file ovsdb_sandesh.h.

◆ resp_data_

std::string OVSDB::OvsdbSandeshTask::resp_data_
private

Definition at line 65 of file ovsdb_sandesh.h.

◆ total_count_

uint32_t OVSDB::OvsdbSandeshTask::total_count_
private

Definition at line 68 of file ovsdb_sandesh.h.


The documentation for this class was generated from the following files: