AlarmNotifications::CMSClient Class Reference

C++ Messaging Service client. More...

#include <cmsclient.h>

Collaboration diagram for AlarmNotifications::CMSClient:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CMSClient (AlarmServerConnector &asc)
 Constructor.
 ~CMSClient ()
 Destructor.
 CMSClient (const CMSClient &other)
 Copy constructor (deleted).
 CMSClient (CMSClient &&other)
 Move constructor (deleted).
CMSClientoperator= (const CMSClient &other)
 Copy assignment (deleted).
CMSClientoperator= (CMSClient &&other)
 Move assignment (deleted).

Private Member Functions

virtual void onMessage (const cms::Message *message) noexcept
 Message listener.
virtual void onException (const cms::CMSException &ex) noexcept
 Exception listener.

Private Attributes

AlarmServerConnector_asc
 AlarmServerConnector instance.
cms::Connection * _connection
 CMS connection.
cms::Session * _session
 CMS session.
cms::Destination * _topicServer
 CMS topic.
cms::MessageConsumer * _consumerServer
 CMS receiver.

Detailed Description

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.


Constructor & Destructor Documentation

CMSClient::CMSClient ( AlarmServerConnector asc  ) 

Constructor.

Creates the necessary objects and connects to the Apache ActiveMQ message broker.

Parameters:
asc Reference to the AlarmServerConnector instance that should be notified when a relevant message arrives.
Exceptions:
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.

AlarmNotifications::CMSClient::CMSClient ( const CMSClient other  ) 

Copy constructor (deleted).

This class cannot be copied.

Parameters:
other Another instance of CMSClient
AlarmNotifications::CMSClient::CMSClient ( CMSClient &&  other  ) 

Move constructor (deleted).

This class cannot be moved.

Parameters:
other Another instance of CMSClient

Member Function Documentation

void CMSClient::onException ( const cms::CMSException &  ex  )  [private, virtual]

Exception listener.

This method will be called by the ActiveMQ library if an exception occurs in the messaging system

Parameters:
ex The CMS exception
Returns:
Nothing

Definition at line 187 of file cmsclient.cpp.

void CMSClient::onMessage ( const cms::Message *  message  )  [private, virtual]

Message listener.

This method will be called by the ActiveMQ library if a message is received from the message broker.

Parameters:
message CMS message object
Returns:
Nothing

Definition at line 163 of file cmsclient.cpp.

CMSClient& AlarmNotifications::CMSClient::operator= ( CMSClient &&  other  ) 

Move assignment (deleted).

This class cannot be moved.

Parameters:
other Another instance of CMSClient
Returns:
Nothing (deleted)
CMSClient& AlarmNotifications::CMSClient::operator= ( const CMSClient other  ) 

Copy assignment (deleted).

This class cannot be copied.

Parameters:
other Another instance of CMSClient
Returns:
Nothing (deleted)

Member Data Documentation

AlarmServerConnector instance.

Set by the constructor.

Definition at line 78 of file cmsclient.h.

cms::Connection* AlarmNotifications::CMSClient::_connection [private]

CMS connection.

Connection to the C++ Messaging Service

Definition at line 84 of file cmsclient.h.

cms::MessageConsumer* AlarmNotifications::CMSClient::_consumerServer [private]

CMS receiver.

Class to receive and parse the messages received from the ActiveMQ message broker

Definition at line 102 of file cmsclient.h.

cms::Session* AlarmNotifications::CMSClient::_session [private]

CMS session.

Session on the C++ Messaging Service

Definition at line 90 of file cmsclient.h.

cms::Destination* AlarmNotifications::CMSClient::_topicServer [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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 2 Dec 2014 for AlarmNotifications by  doxygen 1.6.1