ZeroSDN Controller  1.0
A modular distributed Software-Defined Network Controller
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros
LoggingModule Class Reference

This is the Logging Module. More...

#include <LoggingModule.hpp>

Inheritance diagram for LoggingModule:

Public Member Functions

 LoggingModule (uint64_t instanceId)
 
 ~LoggingModule ()
 
virtual void handleModuleStateChange (std::shared_ptr< zmf::data::ModuleHandle > changedModule, zmf::data::ModuleState newState, zmf::data::ModuleState lastState) override
 
virtual void handleEvent (const zmf::data::ZmfMessage &message, const zmf::data::ModuleUniqueId &sender)
 
virtual void disable ()
 

Protected Member Functions

virtual bool enable ()
 

Detailed Description

This is the Logging Module.

All ZMF Events (only the pub/sub ones) will be stored in a database. The Logging Module will subscribe to all Events and write them to the database.

See Also
CassandraClient
Author
Rainer Erban

Constructor & Destructor Documentation

LoggingModule::LoggingModule ( uint64_t  instanceId)

Constructor with instance id

Parameters
instanceIdthe id of the instance
LoggingModule::~LoggingModule ( )

Default Constructor

Member Function Documentation

void LoggingModule::disable ( )
virtual

Called when the module should disable itself. Must stop the module (threads etc.).

bool LoggingModule::enable ( )
protectedvirtual

Called when the module should enable itself. Must initialize and start the module. First, there will be a connection to the database initialized. Second, there will be a subscription to all kinds of events.

Returns
True if enable is successful, False if enable is failed or rejected
void LoggingModule::handleEvent ( const zmf::data::ZmfMessage &  message,
const zmf::data::ModuleUniqueId &  sender 
)
virtual

Handler for new events which are received via ZMF Bus. Forwards the event to the CassandraClient.

See Also
CassandraClient.insertLogMsg()
Parameters
messagethe received event
senderthe sender of the event
void LoggingModule::handleModuleStateChange ( std::shared_ptr< zmf::data::ModuleHandle >  changedModule,
zmf::data::ModuleState  newState,
zmf::data::ModuleState  lastState 
)
overridevirtual

Optional: Handle state changes of other modules

Parameters
changedModulethe module which change his state
newStatethe new state of the module
lastStatethe old state of the module

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