summaryrefslogtreecommitdiffstats
path: root/nsframework/notification_persistent_service/server/src/ns_npp_notification.cpp
blob: 8e2bb2d6b339ada00cc088e5fd73581ebb93deb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

////////////////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup  tag_NS_NPPService
/// \brief    This file contains implementation of CNotification class.
///       It define functionalities common to all types of notification.
///
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
// Include Files
////////////////////////////////////////////////////////////////////////////////////////////////////

#include <native_service/frameworkunified_framework_if.h>
#include <native_service/ns_message_center_if.h>
#include <native_service/ns_np_service_protocol.h>
#include <utility>
#include <iostream>
#include <string>
#include <native_service/ns_mc_system_info.h>
#include "ns_npp_notificationpersistentservicelog.h"
#include "ns_npp_handlelist.h"
#include "ns_npp_notification.h"


////////////////////////////////////////////////////////////////////////////////////////////////////
/// CNotification
/// Constructor of CNotification class
////////////////////////////////////////////////////////////////////////////////////////////////////
CNotification::CNotification() {  // LCOV_EXCL_START 8: dead code
  AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  m_cNotificationName = "";
  m_uiMaxMsgSize = 0;
  m_ePersistentType = eFrameworkunifiedUnknown;

  m_cServiceName = "";

  m_pmSubscribersList = NULL;

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
}
// LCOV_EXCL_STOP

////////////////////////////////////////////////////////////////////////////////////////////////////
/// CNotification
/// Constructor of CNotification class
////////////////////////////////////////////////////////////////////////////////////////////////////
CNotification::CNotification(const std::string &f_cnotificationname,
                             const UI_32 f_uimaxmsgsize) {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  m_cNotificationName = "";
  m_uiMaxMsgSize = 0;
  m_ePersistentType = eFrameworkunifiedUnknown;
  m_pmSubscribersList = NULL;

  if (!f_cnotificationname.empty()) {  // LCOV_EXCL_BR_LINE 200: f_cnotificationname can't be empty
    m_cNotificationName = f_cnotificationname;
    m_uiMaxMsgSize = f_uimaxmsgsize;
//    m_ePersistentType = eFrameworkunifiedUnknown;

    m_cServiceName = "";

    m_pmSubscribersList = new(std::nothrow) NotifReceiver_Type();  // LCOV_EXCL_BR_LINE 11:unexpected branch
  } else {
    // LCOV_EXCL_START 200: f_cnotificationname can't be empty
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    FRAMEWORKUNIFIEDLOG(ZONE_NPP_INFO, __FUNCTION__, "Notification String is Empty");

    CNotification();
    // LCOV_EXCL_STOP
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
}


////////////////////////////////////////////////////////////////////////////////////////////////////
/// ~CNotification
/// Destructor of CNotification class
////////////////////////////////////////////////////////////////////////////////////////////////////
CNotification::~CNotification() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  // iterator of CNotificationReceiver map
  NotifReceiver_Iterator_Type l_itNotifReceiver;

  CNotificationReceiver *l_pNotificationReceiver = NULL;

  if (NULL != m_pmSubscribersList) {  // LCOV_EXCL_BR_LINE 6: m_pmSubscribersList can't be NULL
    if (!m_pmSubscribersList->empty()) {
      for (l_itNotifReceiver = m_pmSubscribersList->begin();
           l_itNotifReceiver != m_pmSubscribersList->end();
           l_itNotifReceiver++) {
        l_pNotificationReceiver = (*l_itNotifReceiver).second;

        if (NULL != l_pNotificationReceiver) {  // LCOV_EXCL_BR_LINE 6: l_pNotificationReceiver can't be NULL
          // NOTE: Uncomment following code when implementation of the function RemoveHandleFromList
          // is available. To find the reason why it is not implemented, see the function definition.
          // CHandleList *l_hHandleList = CHandleList::GetHandleList();
          // l_hHandleList->RemoveHandleFromList((*l_itNotifReceiver).first);

          delete l_pNotificationReceiver;    // LCOV_EXCL_BR_LINE 11: unexpected branch
          l_pNotificationReceiver = NULL;
        }
      }

      // clear the map
      m_pmSubscribersList->clear();
    }

    delete m_pmSubscribersList;    // LCOV_EXCL_BR_LINE 11: unexpected branch
    m_pmSubscribersList = NULL;
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// AddEventReciever
/// This function adds the name of the application to receiver list of particular notification.
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::AddEventReciever(const std::string &f_csubscribername) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  if (!f_csubscribername.empty()) {  // LCOV_EXCL_BR_LINE 6: f_csubscribername can't be empty
    l_estatus = AddReceiverInMap(f_csubscribername);
  } else {
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    l_estatus = eFrameworkunifiedStatusInvldParam;  // LCOV_EXCL_LINE 6: f_csubscribername can't be empty
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// Publish
/// This function publishes the notification to subscribed clients.
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::Publish(const std::string &f_cservicename,
                                  PVOID f_pmessage,
                                  const UI_32 f_uimsgsize) {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return eFrameworkunifiedStatusFail;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// DeleteEventReciever
/// This function deletes the name of application from receivers list.
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::DeleteEventReciever(const std::string &f_csubscribername) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  // iterator of CNotificationReceiver map
  NotifReceiver_Iterator_Type l_iterator;

  CNotificationReceiver *l_pNotificationReceiver = NULL;

  if (!f_csubscribername.empty()) {  // LCOV_EXCL_BR_LINE 6: double check, f_csubscribername can't be empty
    l_iterator = m_pmSubscribersList->find(f_csubscribername);


    if (l_iterator != m_pmSubscribersList->end()) {
      l_pNotificationReceiver = (*l_iterator).second;

      if (NULL != l_pNotificationReceiver) {  // LCOV_EXCL_BR_LINE 6: l_pNotificationReceiver can't be NULL
        // NOTE: Uncomment following code when implementation of the function RemoveHandleFromList
        // is available. To find the reason why it is not implemented, see the function definition.
        // CHandleList *l_hHandleList = CHandleList::GetHandleList();
        // l_hHandleList->RemoveHandleFromList((*l_iterator).first);

        delete l_pNotificationReceiver;  // LCOV_EXCL_BR_LINE 11: unexpected branch
        l_pNotificationReceiver = NULL;
      }

      m_pmSubscribersList->erase(l_iterator);
      FRAMEWORKUNIFIEDLOG(ZONE_NPP_INFO, __FUNCTION__, "Subscriber successfully deleted");  // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h"  // NOLINT[whitespace/line_length]
    } else {
      FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Invalid Iterator");
    }
  } else {
    // LCOV_EXCL_START 6: double check, f_csubscribername can't be empty
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Subscriber Name String is Empty");
    l_estatus = eFrameworkunifiedStatusFail;
    // LCOV_EXCL_STOP
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetNewSubscribersList
/// This function sets the subscribers list of notification
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::SetNewSubscribersList(CNotification *f_pnotification) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  // iterator of CNotificationReceiver map
  NotifReceiver_Iterator_Type l_itNotifReceiver;

  std::string l_cSubscriberName;

  if (NULL != f_pnotification && NULL != f_pnotification->m_pmSubscribersList) {  // LCOV_EXCL_BR_LINE 6: f_pnotification and f_pnotification->m_pmSubscribersList can't be empty  // NOLINT[whitespace/line_length]
    if (!f_pnotification->m_pmSubscribersList->empty()) {
      for (l_itNotifReceiver = f_pnotification->m_pmSubscribersList->begin();
           l_itNotifReceiver != f_pnotification->m_pmSubscribersList->end();
           l_itNotifReceiver++) {
        l_cSubscriberName = (*l_itNotifReceiver).first;
        AddReceiverInMap(l_cSubscriberName);  // LCOV_EXCL_BR_LINE 11: unexpected branch
      }
    } else {
      FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Subscriber List Empty");
    }
  } else {
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    l_estatus = eFrameworkunifiedStatusNullPointer;  // LCOV_EXCL_LINE 6: f_pnotification and f_pnotification->m_pmSubscribersList can't be empty  // NOLINT[whitespace/line_length]
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetEventPublisher
/// This function set the publisher name to current received service name
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::SetEventPublisher(const std::string &f_cservicename) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  if (!f_cservicename.empty()) {
    m_cServiceName = f_cservicename;
    FRAMEWORKUNIFIEDLOG(ZONE_NPP_INFO, __FUNCTION__, "Service successfully set");  // LCOV_EXCL_BR_LINE 15: marco defined in "native_service/ns_logger_if.h"  // NOLINT[whitespace/line_length]
  } else {
    FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Service Name String is Empty");
    l_estatus = eFrameworkunifiedStatusFail;
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}


////////////////////////////////////////////////////////////////////////////////////////////////////
/// ResetEventPublisher
/// This function resets the publisher name
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::ResetEventPublisher(const std::string &f_cservicename) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  if (f_cservicename.empty()) {  // LCOV_EXCL_BR_LINE 6: f_cservicename can't be empty
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    l_estatus = eFrameworkunifiedStatusInvldParam;  // LCOV_EXCL_LINE 6: f_cservicename can't be empty
  } else {
    if (0 == m_cServiceName.compare(f_cservicename)) {
      m_cServiceName = "";
      FRAMEWORKUNIFIEDLOG(ZONE_NPP_INFO, __FUNCTION__, "Service successfully reset");  // LCOV_EXCL_BR_LINE 15: marco defined in "native_service/ns_logger_if.h"  // NOLINT[whitespace/line_length]
    } else {
      FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Service  Name Not Registered");  // LCOV_EXCL_BR_LINE 15: marco defined in "native_service/ns_logger_if.h"  // NOLINT[whitespace/line_length]
      l_estatus = eFrameworkunifiedStatusFail;
    }
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

EFrameworkunifiedStatus CNotification::AddReceiverInMap(const std::string &f_csubscribername) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  // Message Queue Handle for passsing messages
  HANDLE l_hMsgSenQueHandle = NULL;

  // Pointer to class CNotificationReceiver
  CNotificationReceiver *l_pCNotificationReceiver = NULL;

  // Iterator for Notification Receiver map
  NotifReceiver_Iterator_Type l_itrNotifReceiver;

  if (!f_csubscribername.empty()) {  // LCOV_EXCL_BR_LINE 6: f_csubscribername can't be empty
    FRAMEWORKUNIFIEDLOG(ZONE_NPP_INFO, __FUNCTION__, "Message Queue Handle Set");  // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h"  // NOLINT[whitespace/line_length]

    CHandleList *l_hHandleList = CHandleList::GetHandleList();

    l_hMsgSenQueHandle = l_hHandleList->GetSubscriberMqHandle(f_csubscribername);  // LCOV_EXCL_BR_LINE 11: unexpected branch  // NOLINT[whitespace/line_length]

    // If handle not found
    if (NULL == l_hMsgSenQueHandle) {
      // Open a handle for sending messages to another message queue
      l_hMsgSenQueHandle = McOpenSender(f_csubscribername.c_str());
      l_hHandleList->AddHandleInList(f_csubscribername, l_hMsgSenQueHandle);  // LCOV_EXCL_BR_LINE 11: unexpected branch  // NOLINT[whitespace/line_length]
    }

    if (NULL !=  m_pmSubscribersList) {  // LCOV_EXCL_BR_LINE 6: m_pmSubscribersList can't be NULL
      l_pCNotificationReceiver = new(std::nothrow) CNotificationReceiver();  // LCOV_EXCL_BR_LINE 11: unexpected branch

      if (NULL != l_pCNotificationReceiver) {  // LCOV_EXCL_BR_LINE 5: l_pCNotificationReceiver can't be NULL
        l_pCNotificationReceiver->m_MsgQHandle = l_hMsgSenQueHandle;

        // Insert Subscriber name and associated message queue handle in the map
        m_pmSubscribersList->insert(make_pair(f_csubscribername, l_pCNotificationReceiver));
      } else {
        // LCOV_EXCL_START 5: l_pCNotificationReceiver can't be NULL
        AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
        FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "l_pCNotificationReceiver is NULL");
        l_estatus = eFrameworkunifiedStatusNullPointer;
        // LCOV_EXCL_STOP
      }
    } else {
      // LCOV_EXCL_START 6: m_pmSubscribersList can't be NULL
      AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
      FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "m_pmSubscribersList is NULL");
      l_estatus = eFrameworkunifiedStatusNullPointer;
      // LCOV_EXCL_STOP
    }

    if (eFrameworkunifiedStatusNullPointer == l_estatus) {
      // close the queue handle
      // NOTE: Uncomment following code when implementation of the function RemoveHandleFromList
      // is available. To find the reason why it is not implemented, see the function definition.
      // CHandleList *l_hHandleList = CHandleList::GetHandleList();
      // l_hHandleList->RemoveHandleFromList(f_csubscribername);
    }
  } else {
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    l_estatus = eFrameworkunifiedStatusInvldParam;  // LCOV_EXCL_LINE 6: f_csubscribername can't be empty
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// PublishData
/// This function publishes the notification to client.
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::PublishData(HANDLE f_hmsgqhandle,
                                      const PVOID f_pmessage,
                                      const UI_32 f_uimsgsize) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  if (NULL != f_hmsgqhandle) {  // LCOV_EXCL_BR_LINE 6: f_hmsgqhandle can't be NULL
    // Notification Name
    PSTR l_cNotificationName = const_cast<PSTR>(m_cNotificationName.c_str());

    if (eFrameworkunifiedStatusOK != (l_estatus = McSendWithSysInfo(f_hmsgqhandle, AppName, NPS_NOTIFY_EV_REQ, l_cNotificationName, f_uimsgsize, f_pmessage, 0))) {  // LCOV_EXCL_BR_LINE 4: NSFW error case  // NOLINT[whitespace/line_length]
      // LCOV_EXCL_START 4: NSFW error case.
      AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
      FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "PublishData failed while McSend for Notification %s, Error Status: 0x%x",
             l_cNotificationName, l_estatus);
      // LCOV_EXCL_STOP
    }
  } else {
    // LCOV_EXCL_START 6: f_hmsgqhandle can't be NULL
    AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
    FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "MsgQ Handle NULL");
    l_estatus = eFrameworkunifiedStatusNullPointer;
    // LCOV_EXCL_STOP
  }

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// IsServiceRegistered
/// This function checks whether the notification is registered with any service or not.
////////////////////////////////////////////////////////////////////////////////////////////////////
BOOL CNotification::IsServiceRegistered() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  if (!m_cServiceName.empty()) {
    return TRUE;
  } else {
    return FALSE;
  }
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// IsSubscribersListEmpty
/// This function is used to check whether any service is subscribed to notification
////////////////////////////////////////////////////////////////////////////////////////////////////
BOOL CNotification::IsSubscribersListEmpty() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  if (NULL != m_pmSubscribersList) {  // LCOV_EXCL_BR_LINE 6: m_pmSubscribersList can't be NULL
    if (m_pmSubscribersList->empty()) {
      return TRUE;
    }
  }

  return FALSE;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetNotificationName
/// This function is used to get the notification name.
////////////////////////////////////////////////////////////////////////////////////////////////////
std::string CNotification::GetNotificationName() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  return m_cNotificationName;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetPublisherName
/// This function is used to get the publisher name of notification.
////////////////////////////////////////////////////////////////////////////////////////////////////
std::string CNotification::GetPublisherName() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  return m_cServiceName;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetPersistenceType
/// This function is used to get the type of notification.
////////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedNotificationType CNotification::GetNotificationType() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  return m_ePersistentType;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetMaxMessageSize
/// This function is used to get the max size of data of notification message.
////////////////////////////////////////////////////////////////////////////////////////////////////
UI_32 CNotification::GetMaxMessageSize() {
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  return m_uiMaxMsgSize;
}

////////////////////////////////////////////////////////////////////////////////////////////////
/// ResetMaxMessageSize
/// This function reset the max size of data that can be published with notification.
////////////////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus CNotification::ResetMaxMessageSize(const UI_32 f_uilength) {
  EFrameworkunifiedStatus l_estatus = eFrameworkunifiedStatusOK;
  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");

  m_uiMaxMsgSize = f_uilength;

  FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
  return l_estatus;
}

#ifdef NPP_PROFILEINFO_ENABLE

////////////////////////////////////////////////////////////////////////////////////////////////
/// GetSubscriberList
/// Returns the list of subscribers subscribed to notification
////////////////////////////////////////////////////////////////////////////////////////////////
NotifReceiver_Type *CNotification::GetSubscriberList() {
  return m_pmSubscribersList;
}

#endif