This class contains information about available Switches.
More...
#include <SwitchRegistryModule.hpp>
This class contains information about available Switches.
This class gathers Information about Switches in the ZMQ-network. If there is a new Switch(SwitchAdapter), requests will be sent to that Switch to gather the necassary Information. If all Information is gathered the Switch will be set to active and an ADDED-Message, a message to other modules will be sent, so they can react to it. If the Information of an active Switch changes or the Switch is deleted, CHANGED- or DELETED-Messages will be sent. Ther is an option for other modules to request the information one specific or all available Switches per Request-Reply.
- Author
- Sebastian Vogel
| SwitchRegistryModule::SwitchRegistryModule |
( |
uint64_t |
instanceId | ) |
|
| SwitchRegistryModule::~SwitchRegistryModule |
( |
| ) |
|
| common::topology::Switch * SwitchRegistryModule::convertToProto |
( |
uint64_t |
switchID | ) |
|
converts a Switch from the map into a common::topology::Switch. This method assumes the Switch with switchID is actually in the map.
- Parameters
-
| the | ID of the Switch, which is to converted into the ZMF-Format |
| void SwitchRegistryModule::disable |
( |
| ) |
|
|
virtual |
Called when the module should disable itself. Must stop the module (threads etc.).
| bool SwitchRegistryModule::enable |
( |
| ) |
|
|
protectedvirtual |
Called when the module should enable itself. Must initialize and start the module.
- Returns
- True if enable successful, False if enable failed or rejected
| void SwitchRegistryModule::handleModuleStateChange |
( |
std::shared_ptr< zmf::data::ModuleHandle > |
changedModule, |
|
|
zmf::data::ModuleState |
newState, |
|
|
zmf::data::ModuleState |
lastState |
|
) |
| |
|
overridevirtual |
Looks for Statechange of SwitchAdapterInstances. If one becomes "alive" it will add it to the map and send OF-requests. If one becomes "dead" it will delete it from the map and send a "Switch died"-message in the ZMF.
| zmf::data::ZmfOutReply SwitchRegistryModule::handleRequest |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
sender |
|
) |
| |
|
overridevirtual |
Handle incoming ZMQ requests from other modules 1.) AllSwitches-Request This will answer with a List of all existing Switches, whose Information is completly known 2.) SwitchByID-Request This will answer with the Switch, that has the same ID as the one in the Request, if it is available.
- Returns
- True if we want to respond on the request, false otherwise
| void SwitchRegistryModule::UTAccessor_addSwitch |
( |
Switch & |
aSwitch | ) |
|
|
inline |
| SwitchMap& SwitchRegistryModule::UTAccessor_getAllSwitchesMap |
( |
| ) |
|
|
inline |
| zmf::data::ZmfOutReply SwitchRegistryModule::UTAccessor_handleRequest |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
sender |
|
) |
| |
|
inline |
| void SwitchRegistryModule::UTAccessor_processEcho |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
id |
|
) |
| |
|
inline |
| void SwitchRegistryModule::UTAccessor_processFeatureReply |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
id |
|
) |
| |
|
inline |
| void SwitchRegistryModule::UTAccessor_processMultipartReply |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
id |
|
) |
| |
|
inline |
| void SwitchRegistryModule::UTAccessor_processPortStatus |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
id |
|
) |
| |
|
inline |
The documentation for this class was generated from the following files: