![]() |
Leosac
0.8.0
Open Source Access Control
|
This is an instance of the Notifier. More...
#include <NotifierInstance.hpp>
Collaboration diagram for Leosac::Module::TCPNotifier::NotifierInstance:Classes | |
| struct | TargetInfo |
| Some information for each tcp server target. More... | |
Public Member Functions | |
| NotifierInstance (zmqpp::context &ctx, zmqpp::reactor &reactor, std::vector< std::string > auth_sources, std::vector< std::string > connect_to, std::vector< std::string > bind_to, ProtocolHandlerUPtr protocol_handler) | |
| Create a new notifier instance. More... | |
| ~NotifierInstance ()=default | |
| NotifierInstance (const NotifierInstance &)=delete | |
| NotifierInstance & | operator= (const NotifierInstance &)=delete |
| NotifierInstance (NotifierInstance &&o)=delete | |
| NotifierInstance & | operator= (NotifierInstance &&o)=delete |
Private Member Functions | |
| void | handle_credential (Cred::RFIDCard &card) |
Notify the peers of the card credential. More... | |
| void | handle_one (zmqpp::message &msg) |
| void | handle_msg_bus () |
| void | handle_tcp_msg () |
| Some event on our ZMQ Stream socket. More... | |
| void | configure_tcp_socket (const std::vector< std::string > &endpoints) |
| TargetInfo * | find_target (const std::string &routing_id) |
| Attempt to find a target from its routing_id. More... | |
Private Attributes | |
| zmqpp::socket | bus_sub_ |
| Read internal message bus. More... | |
| zmqpp::socket | tcp_ |
| Stream socket used to connect to remote client we want to notify. More... | |
| std::list< TargetInfo > | targets_ |
| ProtocolHandlerUPtr | protocol_ |
| bool | act_as_server_ |
| Are we a server or a client ? More... | |
This is an instance of the Notifier.
The module can have many NotifierInstance running concurrently.
Multiple instance are useful because they let the module act as server and/or client and talk to various peer using different protocols.
A instance is qualified by its status (server or client) and the protocol it speaks.
Definition at line 58 of file NotifierInstance.hpp.
| NotifierInstance::NotifierInstance | ( | zmqpp::context & | ctx, |
| zmqpp::reactor & | reactor, | ||
| std::vector< std::string > | auth_sources, | ||
| std::vector< std::string > | connect_to, | ||
| std::vector< std::string > | bind_to, | ||
| ProtocolHandlerUPtr | protocol_handler | ||
| ) |
Create a new notifier instance.
The context and the reactor are provided by the TcpNotifier module. The NotifierInstance shall register its socket to the reactor.
| ctx | The ZeroMQ context. |
| reactor | The reactor of the parent module. We use this to register callback on socket. |
| auth_source | The list of authentication source to listen to. |
Definition at line 31 of file NotifierInstance.cpp.
|
default |
|
delete |
|
delete |
|
private |
Definition at line 182 of file NotifierInstance.cpp.
|
private |
Attempt to find a target from its routing_id.
Returns nullptr if the target cannot be found.
Definition at line 144 of file NotifierInstance.cpp.
|
private |
Notify the peers of the card credential.
Definition at line 58 of file NotifierInstance.cpp.
|
private |
Definition at line 155 of file NotifierInstance.cpp.
|
private |
Definition at line 86 of file NotifierInstance.cpp.
|
private |
Some event on our ZMQ Stream socket.
Definition at line 133 of file NotifierInstance.cpp.
|
delete |
|
delete |
|
private |
Are we a server or a client ?
Definition at line 151 of file NotifierInstance.hpp.
|
private |
Read internal message bus.
Definition at line 136 of file NotifierInstance.hpp.
|
private |
Definition at line 146 of file NotifierInstance.hpp.
|
private |
Definition at line 144 of file NotifierInstance.hpp.
|
private |
Stream socket used to connect to remote client we want to notify.
Definition at line 142 of file NotifierInstance.hpp.