![]() |
AlarmNotifications
PANDA Slow Control Alarm Daemon
|
C++ Messaging Service client. More...
#include <cmsclient.h>
Public Member Functions | |
CMSClient (AlarmServerConnector &asc) | |
Constructor. More... | |
~CMSClient () | |
Destructor. More... | |
CMSClient (const CMSClient &other)=delete | |
Copy constructor (deleted) More... | |
CMSClient (CMSClient &&other)=delete | |
Move constructor (deleted) More... | |
CMSClient & | operator= (const CMSClient &other)=delete |
Copy assignment (deleted) More... | |
CMSClient & | operator= (CMSClient &&other)=delete |
Move assignment (deleted) More... | |
Private Member Functions | |
virtual void | onMessage (const cms::Message *message) noexcept |
Message listener. More... | |
virtual void | onException (const cms::CMSException &ex) noexcept |
Exception listener. More... | |
Private Attributes | |
AlarmServerConnector & | _asc |
AlarmServerConnector instance. More... | |
cms::Connection * | _connection |
CMS connection. More... | |
cms::Session * | _session |
CMS session. More... | |
cms::Destination * | _topicServer |
CMS topic. More... | |
cms::MessageConsumer * | _consumerServer |
CMS receiver. More... | |
C++ Messaging Service client.
This class encapsulates the C++ API of the Apache ActiveMQ library. Apache ActiceMQ is an implementation of the Java Messaging Service standard used by the CSS (Control System Studio) Alarm Server. The activemq-cpp library's API is therefore called C++ Messaging Service (CMS).
This class connects to the Apache ActiveMQ message broker, subscribes to the topic of the CSS alarm server and receives all the messages there. The messages are then parsed, filtered and the relevant ones forwarded to AlarmServerConnector.
Definition at line 70 of file cmsclient.h.
CMSClient::CMSClient | ( | AlarmServerConnector & | asc | ) |
Constructor.
Creates the necessary objects and connects to the Apache ActiveMQ message broker.
asc | Reference to the AlarmServerConnector instance that should be notified when a relevant message arrives. |
cms::CMSException | Something went wrong within Apache ActiveMQ |
std::runtime_error | Initialization error |
Definition at line 52 of file cmsclient.cpp.
CMSClient::~CMSClient | ( | ) |
Destructor.
Closes the connection to the message broker and cleans everything up.
Definition at line 115 of file cmsclient.cpp.
|
delete |
Copy constructor (deleted)
This class cannot be copied.
other | Another instance of CMSClient |
|
delete |
Move constructor (deleted)
This class cannot be moved.
other | Another instance of CMSClient |
|
privatevirtualnoexcept |
Exception listener.
This method will be called by the ActiveMQ library if an exception occurs in the messaging system
ex | The CMS exception |
Definition at line 187 of file cmsclient.cpp.
|
privatevirtualnoexcept |
Message listener.
This method will be called by the ActiveMQ library if a message is received from the message broker.
message | CMS message object |
Definition at line 163 of file cmsclient.cpp.
Copy assignment (deleted)
This class cannot be copied.
other | Another instance of CMSClient |
Move assignment (deleted)
This class cannot be moved.
other | Another instance of CMSClient |
|
private |
|
private |
|
private |
CMS receiver.
Class to receive and parse the messages received from the ActiveMQ message broker
Definition at line 102 of file cmsclient.h.
|
private |
|
private |
CMS topic.
Topic on the message broker, i.e. "name" of the "chatroom" where the CSS Alarm Server publishes its messages.
Definition at line 96 of file cmsclient.h.