Apama  10.5.4.1
engine_client_cpp.hpp
Go to the documentation of this file.
1 /*
2  * engine_client_cpp.hpp
3  *
4  * $Copyright(c) 2002-2012 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.$
5  * $Copyright (c) 2013-2019 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.$
6  * Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG
7  *
8  * $Id: engine_client_cpp.hpp 349681 2019-04-08 16:03:47Z matj $
9  */
10 
15 #ifndef ENGINE_CLIENT_CPP_HPP
16 #define ENGINE_CLIENT_CPP_HPP
17 
18 #include <AP_Types.h>
19 #include <AP_Platform.h>
20 #include <iostream>
21 #include <sstream>
22 #include <exception>
23 #include <iterator>
24 #include <algorithm>
25 #include <utility>
26 #include <string>
27 #include <assert.h>
28 #include <sag_internal/engine_client_c.h>
29 #include <client_status_names.hpp>
30 #include <iomanip>
31 #include <vector>
32 
33 
34 using std::pair;
35 
36 #undef ERROR
37 
38 namespace com {
39 
41 namespace apama {
42 
47  class AP_ENGINE_CLIENT_API EngineException : public std::exception
48  {
49  public:
51  EngineException(const char *message);
54 
56  EngineException& operator= (const EngineException& ce) {
57  EngineException(ce).swap(*this);
58  return *this;
59  }
60 
62  virtual ~EngineException() throw();
63 
70  virtual const char* what() const throw() { return m_message; }
71 
79  virtual const char* const* getWarnings() const { return m_warnings; }
80 
81  protected:
83  void swap(EngineException &);
85  const char* const* m_warnings;
86 
87  private:
89  char *m_message;
90  };
91 
92 
94  typedef enum {
113  } LogLevel;
114 
115 
121  AP_ENGINE_CLIENT_API void setLogLevel(LogLevel level);
122 
133  AP_ENGINE_CLIENT_API void setLogFile(const AP_char8* filename, bool truncate, bool utf8 = false);
134 
139  AP_ENGINE_CLIENT_API int getLogFD();
140 
145  AP_ENGINE_CLIENT_API void setLogMutex(void *mutex);
146 
151  AP_ENGINE_CLIENT_API void reOpenLog();
152 
153 
155  AP_ENGINE_CLIENT_API AP_char8* convertToUTF8(const AP_char8* s);
156 
158  AP_ENGINE_CLIENT_API AP_char8* convertFromUTF8(const AP_char8* s);
159 
163  AP_ENGINE_CLIENT_API void char8free(char *string);
164 
168  namespace event {
169 
178  class AP_ENGINE_CLIENT_API Event
179  {
180  friend AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
181  friend AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
182 
183  public:
190  virtual const char* getText() const = 0;
191 
200  virtual const char* getChannel() const = 0;
201 
212  virtual double getTime() const = 0;
213 
215  inline friend std::ostream& operator << (std::ostream& stream, const Event& obj) {
216  stream << obj.getText();
217  return stream;
218  }
220  inline friend std::ostream& operator << (std::ostream& stream, const Event* obj) {
221  stream << obj->getText();
222  return stream;
223  }
224 
225  private:
227  Event(const Event&);
229  Event& operator= (const Event&);
230 
231  protected:
233  Event();
235  virtual ~Event();
236  };
237 
238 
250  class AP_ENGINE_CLIENT_API EventSupplier
251  {
252  friend AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
253 
254  public:
264  virtual void disconnect() = 0;
265 
266  protected:
268  EventSupplier();
270  virtual ~EventSupplier();
271 
272  private:
276  EventSupplier& operator= (const EventSupplier&);
277  };
278 
279 
290  class AP_ENGINE_CLIENT_API EventConsumer
291  {
292  public:
305  virtual void sendEvents(const Event* const* events) = 0;
306 
307  protected:
309  EventConsumer();
311  virtual ~EventConsumer();
312 
313  private:
317  EventConsumer& operator= (const EventConsumer&);
318  };
319 
323  class AP_ENGINE_CLIENT_API DisconnectableEventConsumer : public EventConsumer
324  {
325  public:
333  virtual void disconnect(const char* reason) = 0;
334 
335  protected:
339  virtual ~DisconnectableEventConsumer();
340 
341  private:
346  };
347 
348 
359  AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
360 
366  AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
367 
368 
377  AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
378 
379  } // namespace event
380 
382  namespace engine {
383 
392  class AP_ENGINE_CLIENT_API MonitorScript
393  {
394  friend AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
395  friend AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
396 
397  public:
405  virtual const char* getText() const = 0;
406 
408  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript& obj) {
409  stream << obj.getText();
410  return stream;
411  }
413  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript* obj) {
414  stream << obj->getText();
415  return stream;
416  }
417 
418  private:
422  MonitorScript& operator= (const MonitorScript&);
423 
424  protected:
426  MonitorScript();
428  virtual ~MonitorScript();
429  };
430 
431  class EngineStatus;
432  std::ostream& operator << (std::ostream& stream, const EngineStatus& obj);
433  std::ostream& operator << (std::ostream& stream, const EngineStatus* obj);
434 
435 
441  class AP_ENGINE_CLIENT_API EngineStatus
442  {
443  friend class EngineManagement; /* getStatus */
444 
445  public:
446 
452 #ifdef _MSC_VER
453 // needed or MSVC complains about the use of pair<string> here, even though it's all inlined
454 #pragma warning (disable : 4251)
455 #endif
456  class AP_ENGINE_CLIENT_API StatusIterator : public std::iterator<std::forward_iterator_tag, int>
457  {
458  public:
460  typedef pair<std::string, std::string> pair_t;
461 
463  explicit StatusIterator(const EngineStatus &es, bool end=false);
466  m_status(0),
467  m_opaqueState(0),
468  iterPair()
469  {}
472  {
473  if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
474  }
476  StatusIterator operator++(int dummy/*@unused@*/)
477  {
478  StatusIterator current(*this);
479  ++(*this); //this->operator++() // prefix ++
480  return current;
481  }
483  StatusIterator& operator++();
485  bool operator==(const StatusIterator& ref) const
486  {
487  return (m_status == ref.m_status) &&
488  (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
489  (iterPair.first == ref.iterPair.first));
490  }
492  bool operator!=(const StatusIterator& ref) const { return !((*this)==ref); }
494  pair_t &operator*() { return iterPair; }
496  pair_t *operator->() { return &iterPair; }
498  bool valid() { return 0 != m_opaqueState; }
499 
502  : m_status(ref.m_status),
503  m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
504  iterPair(ref.iterPair)
505  {}
508  {
509  StatusIterator(other).swap(*this);
510  return *this;
511  }
512 
513  private:
515  void step();
517  void swap(StatusIterator &other)
518  {
519  std::swap(m_status, other.m_status);
520  std::swap(m_opaqueState, other.m_opaqueState);
521  std::swap(iterPair, other.iterPair);
522  }
523 
525  const EngineStatus *m_status;
527  void *m_opaqueState;
529  pair_t iterPair;
530  };
531 
536 
540  AP_uint64 getUptime() const {
541  return getStatusIntValue(client_status::UPTIME_SECONDS);
542  }
543 
547  AP_uint32 getNumContexts() const {
548  return (AP_uint32) getStatusIntValue(client_status::CONTEXTS_TOTAL);
549  }
550 
554  AP_uint32 getNumMonitors() const {
555  return (AP_uint32) getStatusIntValue(client_status::MONITORS_TOTAL);
556  }
557 
561  AP_uint32 getNumProcesses() const {
562  return (AP_uint32) getStatusIntValue(client_status::MONITOR_INSTANCES_TOTAL);
563  }
564 
568  AP_uint32 getNumJavaApplications() const {
569  return (AP_uint32) getStatusIntValue(client_status::JAVA_APPLICATIONS_TOTAL);
570  }
571 
575  AP_uint32 getNumListeners() const {
576  return (AP_uint32) getStatusIntValue(client_status::LISTENERS_TOTAL);
577  }
578 
582  AP_uint32 getNumEventTypes() const {
583  return (AP_uint32) getStatusIntValue(client_status::EVENT_TYPES_TOTAL);
584  }
585 
589  AP_uint32 getNumQueuedFastTrack() const {
590  return (AP_uint32) getStatusIntValue(client_status::QUEUED_ROUTE_TOTAL);
591  }
592 
597  AP_uint32 getNumQueuedInput() const {
598  return (AP_uint32) getStatusIntValue(client_status::QUEUED_INPUT_TOTAL);
599  }
600 
604  AP_uint64 getNumReceived() const {
605  return getStatusIntValue(client_status::INPUT_TOTAL);
606  }
607 
611  AP_uint64 getNumFastTracked() const {
612  return getStatusIntValue(client_status::ROUTE_TOTAL);
613  }
614 
618  AP_uint32 getNumConsumers() const {
619  return (AP_uint32) getStatusIntValue(client_status::CONSUMERS_TOTAL);
620  }
621 
625  AP_uint32 getNumOutEventsQueued() const {
626  return (AP_uint32) getStatusIntValue(client_status::QUEUED_OUTPUT_TOTAL);
627  }
628 
633  AP_uint64 getNumOutEventsCreated() const {
634  return getStatusIntValue(client_status::CREATED_OUTPUT_TOTAL);
635  }
636 
641  AP_uint64 getNumOutEventsSent() const {
642  return getStatusIntValue(client_status::OUTPUT_TOTAL);
643  }
644 
648  AP_uint32 getNumInputQueuedInput() const {
649  return (AP_uint32) getStatusIntValue(client_status::QUEUED_INPUT_PUBLIC_TOTAL);
650  }
651 
655  const AP_char8* getMostBackedUpInput() const {
657  }
658 
662  const AP_char8 *getSlowestReceiver() const {
664  }
665 
669  AP_uint32 getSlowestReceiverQueueSize() const {
670  return (AP_uint32) getStatusIntValue(client_status::SLOWEST_OUTPUT_QUEUE_SIZE_TOTAL);
671  }
672 
676  AP_uint32 getMostBackedUpQueueSize() const {
677  return (AP_uint32) getStatusIntValue(client_status::SLOWEST_INPUT_QUEUE_SIZE_TOTAL);
678  }
679 
683  AP_uint32 getNumSubListeners() const {
684  return (AP_uint32) getStatusIntValue(client_status::SUB_LISTENERS_TOTAL);
685  }
686 
690  AP_uint64 getNumProcessed() const {
691  return getStatusIntValue(client_status::PROCESSED_TOTAL);
692  }
700  return StatusIterator(*this);
701  }
702 
709  const_iterator end() const {
710  return StatusIterator(*this, true);
711  }
712 
716  const AP_char8* operator[] (const char *ref) const {
717  return getStatusValue(ref);
718  }
719 
723  const AP_char8* operator[] (std::string &ref) const {
724  return this->operator[](ref.c_str());
725  }
726 
733  AP_int64 getUserInt(const char* key) {
734  return userInt(key);
735  }
736 
743  AP_int64 getUserIntOr(const char* key, int alt) {
744  return userIntOr(key, alt);
745  }
746 
753  AP_float64 getUserFloat(const char* key) {
754  return userFloat(key);
755  }
756 
763  AP_float64 getUserFloatOr(const char* key, float alt) {
764  return userFloatOr(key, alt);
765  }
766 
773  AP_bool getUserBool(const char* key) {
774  return userBool(key);
775  }
776 
783  AP_bool getUserBoolOr(const char* key, bool alt) {
784  return userBoolOr(key, alt);
785  }
786 
793  const AP_char8* getUserString(const char* key) {
794  return userString(key);
795  }
796 
803  const AP_char8* getUserStringOr(const char* key, const char* alt) {
804  return userStringOr(key, alt);
805  }
806 
812  std::string getAllStatusValues() {
813  std::ostringstream ost;
814  ost << getStandardStatusValues();
815  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
816  if (it->first.find("user-") != std::string::npos)
817  ost << std::setw(32) << setiosflags(std::ios_base::left) << it->first.append(":") << it->second << std::endl;
818  }
819  return ost.str();
820  }
821 
827  std::string getStandardStatusValues() {
828  std::ostringstream ost;
829  ost << *this;
830  return ost.str();
831  }
832 
838  static std::string getRawHeader() {
839  std::ostringstream ost;
840  ost << "Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
841  ost << "# Sub-listeners,# Event types,Input queue,# Received events,";
842  ost << "Route queue,# Routed events,# Consumers,Output queue,";
843  ost << "# Created output events,# Sent output events,# Processed events,";
844  ost << "Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
845  return ost.str();
846  }
847 
853  std::string getRawHeaderAll() {
854  std::ostringstream ost;
855  ost << getRawHeader();
856  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
857  if (it->first.find("user-") != std::string::npos)
858  ost << "," << it->first;
859  }
860  return ost.str();
861  }
862 
869  std::ostringstream ost;
870  ost << getUptime()
871  << "," << getNumContexts()
872  << "," << getNumMonitors()
873  << "," << getNumProcesses()
874  << "," << getNumJavaApplications()
875  << "," << getNumListeners()
876  << "," << getNumSubListeners()
877  << "," << getNumEventTypes()
878  << "," << getNumQueuedInput()
879  << "," << getNumReceived()
880  << "," << getNumQueuedFastTrack()
881  << "," << getNumFastTracked()
882  << "," << getNumConsumers()
883  << "," << getNumOutEventsQueued()
884  << "," << getNumOutEventsCreated()
885  << "," << getNumOutEventsSent()
886  << "," << getStatusValue(client_status::PERSISTENCE_SNAPSHOTS_TOTAL)
891  << "," << getNumProcessed()
892  << "," << getMostBackedUpInput()
893  << "," << getMostBackedUpQueueSize()
894  << "," << getSlowestReceiver()
895  << "," << getSlowestReceiverQueueSize();
896  return ost.str();
897  }
898 
904  std::string getAllStatusValuesRaw() {
905  std::ostringstream ost;
906  ost << getStandardStatusValuesRaw();
907  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
908  if (it->first.find("user-") != std::string::npos)
909  ost << "," << it->second;
910  }
911  return ost.str();
912  }
913 
918  {
919  if (c_status) {
920  c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
921  }
922  }
925  : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
926  {}
929  {
930  EngineStatus(other).swap(*this);
931  return *this;
932  }
936  EngineStatus(): c_status(0) {}
937  private:
939  EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
941  void swap(EngineStatus &other) {
942  std::swap(c_status, other.c_status);
943  }
945  void getNext(const char *&name, const char *&value, void *&opaqueState) const {
946  if (c_status)
947  c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
948  }
950  const AP_char8* getStatusValue(const char *name) const {
951  return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
952  }
954  AP_uint64 getStatusIntValue(const char *name) const {
955  return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
956  }
958  void disposeIterator(void *opaqueState) const {
959  c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
960  }
962  void *copyIterator(void *opaqueState) const {
963  return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
964  }
965 
967  AP_int64 userIntOr(const char* key, AP_int64 alt) {
968  return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
969  }
971  AP_float64 userFloatOr(const char* key, AP_float64 alt) {
972  return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
973  }
975  AP_bool userBoolOr(const char* key, AP_bool alt) {
976  return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
977  }
979  const AP_char8* userStringOr(const char* key, const AP_char8* alt) {
980  return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
981  }
983  AP_int64 userInt(const char* key) {
984  return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
985  }
987  AP_float64 userFloat(const char* key) {
988  return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
989  }
991  AP_bool userBool(const char* key) {
992  return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
993  }
995  const AP_char8* userString(const char* key) {
996  return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
997  }
999  AP_EngineStatus_API *c_status;
1000  };
1001 
1002 
1006  inline std::ostream& operator << (std::ostream& stream, const EngineStatus& obj) {
1007  std::ostringstream ost;
1008  ost
1009  << "Uptime(ms): " << obj.getUptime() << std::endl
1010  << "Number of contexts: " << obj.getNumContexts() << std::endl
1011  << "Number of monitors: " << obj.getNumMonitors() << std::endl
1012  << "Number of sub-monitors: " << obj.getNumProcesses() << std::endl
1013  << "Number of Java applications: " << obj.getNumJavaApplications() << std::endl
1014  << "Number of listeners: " << obj.getNumListeners() << std::endl
1015  << "Number of sub-listeners: " << obj.getNumSubListeners() << std::endl
1016  << "Number of event types: " << obj.getNumEventTypes() << std::endl
1017  << "Events on input queue: " << obj.getNumQueuedInput() << std::endl
1018  << "Events received: " << obj.getNumReceived() << std::endl
1019  << "Events processed: " << obj.getNumProcessed() << std::endl
1020  << "Events on internal queue: " << obj.getNumQueuedFastTrack() << std::endl
1021  << "Events routed internally: " << obj.getNumFastTracked() << std::endl
1022  << "Number of consumers: " << obj.getNumConsumers() << std::endl
1023  << "Events on output queue: " << obj.getNumOutEventsQueued() << std::endl
1024  << "Output events created: " << obj.getNumOutEventsCreated() << std::endl
1025  << "Output events sent: " << obj.getNumOutEventsSent() << std::endl
1026  << "Events on input context queues: " << obj.getNumInputQueuedInput() << std::endl
1027  << "Number of persistent snapshots: " << obj[client_status::PERSISTENCE_SNAPSHOTS_TOTAL] << std::endl
1028  << "Last persistent snapshot time: " << obj[client_status::PERSISTENCE_LAST_SNAPSHOT_TIMESTAMP] << std::endl
1029  << "Persistent snapshot wait time Millis (EWMA): " << obj[client_status::PERSISTENCE_SNAPSHOT_WAIT_EWMA_SECONDS] << std::endl
1030  << "Persistent commit time Millis (EWMA): " << obj[client_status::PERSISTENCE_COMMIT_TIME_EWMA_SECONDS] << std::endl
1031  << "Last persistent snapshot rows changed (EWMA): " << obj[client_status::PERSISTENCE_SNAPSHOT_ROWS_CHANGED_EWMA_TOTAL] << std::endl
1032  << "Slowest context name: " << obj.getMostBackedUpInput() << std::endl
1033  << "Slowest context queue size: " << obj.getMostBackedUpQueueSize() << std::endl
1034  << "Slowest receiver name: " << obj.getSlowestReceiver() << std::endl
1035  << "Slowest receiver queue size: " << obj.getSlowestReceiverQueueSize() << std::endl;
1036  stream << ost.str();
1037  return stream;
1038  }
1039 
1043  inline std::ostream& operator << (std::ostream& stream, const EngineStatus* obj) {
1044  stream << *obj;
1045  return stream;
1046  }
1047 
1048  inline EngineStatus::StatusIterator::StatusIterator(const EngineStatus &es, bool end):
1049  m_status(&es),
1050  m_opaqueState(0),
1051  iterPair()
1052  {
1053  if (!end) step(); // get the first item in the map
1054  }
1055 
1057  inline EngineStatus::StatusIterator& EngineStatus::StatusIterator::operator++()
1058  {
1059  if (m_opaqueState) step();// don't step past the end
1060  return *this;
1061  }
1062 
1063  inline void EngineStatus::StatusIterator::step()
1064  {
1065  const char *name = nullptr;
1066  const char *value = nullptr;
1067 
1068  /* get the next item from the library map */
1069  m_status->getNext(name, value, m_opaqueState );
1070  if(!name || !value) {
1071  assert(!m_opaqueState);
1072  } else {
1073  iterPair = pair_t(name, value);
1074  }
1075  }
1076 
1087  class AP_ENGINE_CLIENT_API NameInfo
1088  {
1089  public:
1093  virtual const char* getName() const = 0;
1094 
1099  virtual const char* getPackage() const = 0;
1100 
1104  virtual const char* getFullyQualifiedName() const = 0;
1105 
1106  private:
1108  NameInfo(const NameInfo&);
1110  NameInfo& operator= (const NameInfo&);
1111 
1112  protected:
1114  NameInfo();
1116  virtual ~NameInfo();
1117  };
1118 
1123  class AP_ENGINE_CLIENT_API NamedMonitorInfo : public NameInfo
1124  {
1125  public:
1129  virtual unsigned int getNumSubMonitors() const = 0;
1130 
1131  private:
1135  NamedMonitorInfo& operator= (const NamedMonitorInfo&);
1136 
1137  protected:
1139  NamedMonitorInfo();
1141  virtual ~NamedMonitorInfo();
1142  };
1143 
1148  class AP_ENGINE_CLIENT_API NamedJavaApplicationInfo : public NameInfo {
1149 
1150  public:
1154  virtual unsigned int getNumListeners() const = 0;
1155 
1156  private:
1161 
1162  protected:
1166  virtual ~NamedJavaApplicationInfo();
1167  };
1168 
1173  class AP_ENGINE_CLIENT_API NamedContextInfo : public NameInfo {
1174 
1175  public:
1179  virtual unsigned int getNumSubMonitors() const = 0;
1180 
1184  virtual unsigned int getQueueSize() const = 0;
1185 
1189  virtual char const *const *getChannels() const = 0;
1190 
1191  private:
1195  NamedContextInfo& operator= (const NamedContextInfo&);
1196 
1197  protected:
1199  NamedContextInfo();
1201  virtual ~NamedContextInfo();
1202  };
1203 
1204 
1209  class AP_ENGINE_CLIENT_API NamedReceiverInfo : public NameInfo {
1210 
1211  public:
1215  virtual unsigned int getQueueSize() const = 0;
1216 
1220  virtual char const *const *getChannels() const = 0;
1221 
1225  virtual const AP_char8 *getAddress() const = 0;
1226 
1227  private:
1231  NamedReceiverInfo& operator= (const NamedReceiverInfo&);
1232 
1233  protected:
1237  virtual ~NamedReceiverInfo();
1238  };
1239 
1240 
1245  class AP_ENGINE_CLIENT_API NamedPluginReceiverInfo : public NameInfo {
1246 
1247  public:
1251  virtual unsigned int getQueueSize() const = 0;
1252 
1256  virtual char const *const *getChannels() const = 0;
1257 
1258  private:
1263 
1264  protected:
1268  virtual ~NamedPluginReceiverInfo();
1269  };
1270 
1275  class AP_ENGINE_CLIENT_API NamedEventTypeInfo : public NameInfo {
1276 
1277  public:
1281  virtual unsigned int getNumEventTemplates() const = 0;
1282 
1283  private:
1287  NamedEventTypeInfo& operator= (const NamedEventTypeInfo&);
1288 
1289  protected:
1293  virtual ~NamedEventTypeInfo();
1294  };
1295 
1300  class AP_ENGINE_CLIENT_API NamedTimerInfo : public NameInfo {
1301 
1302  public:
1306  virtual unsigned int getNumTimers() const = 0;
1307 
1308  private:
1312  NamedTimerInfo& operator= (const NamedTimerInfo&);
1313 
1314  protected:
1316  NamedTimerInfo();
1318  virtual ~NamedTimerInfo();
1319  };
1320 
1326  class AP_ENGINE_CLIENT_API NamedAggregateInfo : public NameInfo {
1327 
1328  private:
1332  NamedAggregateInfo& operator= (const NamedAggregateInfo&);
1333 
1334  protected:
1338  virtual ~NamedAggregateInfo();
1339  };
1340 
1353  class AP_ENGINE_CLIENT_API EngineInfo
1354  {
1355  friend AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
1356 
1357  public:
1361  virtual unsigned int getNumMonitors() const = 0;
1362 
1366  virtual unsigned int getNumJavaApplications() const = 0;
1367 
1371  virtual unsigned int getNumEventTypes() const = 0;
1372 
1376  virtual unsigned int getNumTimers() const = 0;
1377 
1381  virtual unsigned int getNumAggregates() const = 0;
1382 
1390  virtual NamedMonitorInfo** getMonitors() const = 0;
1391 
1399  virtual NamedJavaApplicationInfo** getJavaApplications() const = 0;
1400 
1408  virtual NamedEventTypeInfo** getEventTypes() const = 0;
1409 
1417  virtual NamedTimerInfo** getTimers() const = 0;
1418 
1426  virtual NamedAggregateInfo** getAggregates() const = 0;
1427 
1431  virtual unsigned int getNumContexts() const = 0;
1432 
1440  virtual NamedContextInfo** getContexts() const = 0;
1441 
1445  virtual unsigned int getNumReceivers() const = 0;
1446 
1454  virtual NamedReceiverInfo **getReceivers() const = 0;
1455 
1459  virtual unsigned int getNumPluginReceivers() const = 0;
1460 
1468  virtual NamedPluginReceiverInfo **getPluginReceivers() const = 0;
1469 
1470  private:
1472  EngineInfo(const EngineInfo&);
1474  EngineInfo& operator= (const EngineInfo&);
1475 
1476  protected:
1478  EngineInfo();
1480  virtual ~EngineInfo();
1481  };
1482 
1483  class AP_ENGINE_CLIENT_API EngineConnection;
1484 
1501  class AP_ENGINE_CLIENT_API EngineManagement : public com::apama::event::EventConsumer
1502  {
1503  public:
1509  CONNECT_PARALLEL
1510  };
1517  virtual void injectMonitorScript(MonitorScript& script) = 0;
1518 
1534  virtual const char* const* injectMonitorScriptWithWarnings(MonitorScript& script) = 0;
1535 
1552  virtual const char* const* injectMonitorScriptWithWarningsFilename(MonitorScript& script, const char *filename) = 0;
1553 
1560  virtual void deleteName(const char * name) = 0;
1561 
1568  virtual void forceDeleteName(const char * name) = 0;
1569 
1576  virtual void killName(const char * name) = 0;
1577 
1581  virtual void deleteAll() = 0;
1582 
1591  virtual void injectJava(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1592 
1609  virtual const char* const* injectJavaWithWarnings(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1610 
1625  virtual const char* const* injectJavaWithWarningsFilename(const AP_uint8* jarbytes, AP_uint32 size, const char *filename) = 0;
1626 
1627 
1637  virtual void injectCDP(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename=NULL) = 0;
1638 
1655  virtual const char* const* injectCDPWithWarnings(const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1656 
1671  virtual const char* const* injectCDPWithWarningsFilename(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename) = 0;
1672 
1678  {
1679  char *errmsg = nullptr;
1680  AP_EngineStatus *es_api = engineManagement_getStatusOpaque(this, &errmsg);
1681  if (errmsg) {
1682  com::apama::EngineException e(errmsg);
1683  free(errmsg);
1684  throw e;
1685  }
1686 
1687  return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1688  }
1689 
1713  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels, bool disconnectSlow) = 0;
1714 
1731  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels) = 0;
1732 
1755  virtual bool attachAsEventConsumerTo(EngineManagement* target, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1756 
1757 
1780  virtual bool attachAsEventConsumerTo(const char* host, int port, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1781 
1782 
1799  virtual void detachAsEventConsumerFrom(EngineManagement* target, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1800 
1818  virtual void detachAsEventConsumerFrom(const char* host, int port, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1819 
1830  virtual void sendEvents(const com::apama::event::Event* const* events) = 0;
1831 
1839  virtual void sendEventsNoBatching(const com::apama::event::Event* const* events) = 0;
1840 
1844  virtual void flushEvents() = 0;
1845 
1854  virtual EngineInfo* inspectEngine() = 0;
1855 
1872  virtual void ping() = 0;
1873 
1879  virtual bool isConnected() = 0;
1880 
1896  virtual void setReceiverConnections(const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1897 
1902  virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1903 
1904  protected:
1906  EngineManagement();
1908  virtual ~EngineManagement();
1909 
1910  private:
1914  EngineManagement& operator= (const EngineManagement&);
1915  };
1916 
1921  class AP_ENGINE_CLIENT_API EngineConnection {
1922  private:
1923  std::string host;
1924  int port;
1925  std::vector<std::string> channels;
1926  bool disconnectSlow;
1927  EngineManagement::ConnectMode connectMode;
1928 
1929  void init(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char * const * channels) {
1930  if (host == NULL || channels == NULL) {
1931  throw EngineException("EngineConnection cannot be created with null host or channels");
1932  }
1933  if (port < 0 || port > 65535) {
1934  throw EngineException("EngineConnection cannot be created with invalid port value");
1935  }
1936 
1937  this->host = std::string(host);
1938  this->port = port;
1939  this->disconnectSlow = disconnectSlow;
1940  this->connectMode = connectMode;
1941 
1942  for (const char* const* c = channels; *c != NULL; c++) {
1943  this->channels.push_back(std::string(*c));
1944  }
1945  }
1946 
1947  public:
1958  EngineConnection(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode,
1959  const char * const * channels) {
1960  init(host, port, disconnectSlow, connectMode, channels);
1961  }
1962 
1970  EngineConnection(const char * host, int port, const char * const * channels) {
1971  init(host, port, false, EngineManagement::CONNECT_LEGACY, channels);
1972  }
1973 
1979  virtual const std::vector<std::string>& getChannels() const {
1980  return channels;
1981  }
1982 
1987  virtual const std::string& getHost() const {
1988  return host;
1989  }
1990 
1995  virtual int getPort() const {
1996  return port;
1997  }
1998 
2003  virtual bool getDisconnectSlow() const{
2004  return disconnectSlow;
2005  }
2006 
2012  return connectMode;
2013  }
2014 
2016  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection& obj) {
2017  std::ostringstream ost;
2018  ost << "EngineConnection to " << obj.host << ":" << obj.port << (obj.disconnectSlow == true ? " diconnectSlow" : "") << " on" <<
2019  (obj.connectMode == EngineManagement::CONNECT_PARALLEL ? " parallel" : "") << " channels [";
2020 
2021  if (!obj.channels.empty()) {
2022  std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost, ", "));
2023  ost << obj.channels.back();
2024  }
2025  ost << "]";
2026  stream << ost.str();
2027  return stream;
2028  }
2029 
2031  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection* obj) {
2032  stream << *obj;
2033  return stream;
2034  }
2035 
2037  virtual ~EngineConnection() {
2038  }
2039  };
2040 
2047  AP_ENGINE_CLIENT_API void engineInit(const char* processName = "C++ Client");
2048 
2049 
2056  AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true);
2057 
2063  AP_ENGINE_CLIENT_API void engineShutdown();
2064 
2065 
2080  AP_ENGINE_CLIENT_API EngineManagement* connectToEngine(const char* host, unsigned short port, bool disconnectSlowReceiver = false, const char *processName = nullptr);
2081 
2095  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineReceiveOnly(const char* host, unsigned short port, const char *processName = nullptr);
2096 
2109  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineMonitorOnly(const char* host, unsigned short port, const char *processName = nullptr);
2110 
2120  AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement* corr);
2121 
2128  AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
2129 
2135  AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
2136 
2146  AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
2147 
2148 
2156  AP_ENGINE_CLIENT_API void deleteWarnings(const char* const* warnings);
2157 
2170  AP_ENGINE_CLIENT_API void setEngineParams(const char* params);
2171 
2172  } // namespace engine
2173 
2174 } // namespace apama
2175 
2176 } // namespace com
2177 
2178 
2179 #endif // ENGINE_CLIENT_CPP_HPP
static char const *const PERSISTENCE_SNAPSHOT_WAIT_EWMA_SECONDS
The EWMA of time taken to wait for a snapshot, in milliseconds.
Definition: client_status_names.hpp:63
AP_uint64 getNumFastTracked() const
The number of events that have been routed across all contexts since the correlator was started.
Definition: engine_client_cpp.hpp:611
AP_uint32 getNumListeners() const
The number of listeners in all contexts.
Definition: engine_client_cpp.hpp:575
AP_uint64 getUptime() const
The time in milliseconds since the correlator was started.
Definition: engine_client_cpp.hpp:540
AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo *info)
This function allows deletion of an EngineInfo object.
static char const *const PERSISTENCE_SNAPSHOTS_TOTAL
Number of snapshots since startup.
Definition: client_status_names.hpp:59
AP_ENGINE_CLIENT_API void setLogLevel(LogLevel level)
Sets the level at which the client library will log information.
virtual const char *const * getWarnings() const
Retrieve the set of warnings associated with the exception.
Definition: engine_client_cpp.hpp:79
AP_ENGINE_CLIENT_API void setEngineParams(const char *params)
Set custom parameters for this instance of the client library.
Derived class from EventConsumer which implements the disconnect API.
Definition: engine_client_cpp.hpp:323
AP_uint32 getNumJavaApplications() const
The number of Java applications and Java EPL plug-ins loaded in the correlator.
Definition: engine_client_cpp.hpp:568
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1087
AP_uint32 getNumQueuedFastTrack() const
The sum of routed events on the route queues of all contexts.
Definition: engine_client_cpp.hpp:589
AP_uint32 getNumSubListeners() const
The number of sub-event-listeners that are active across all contexts.
Definition: engine_client_cpp.hpp:683
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events.
Definition: engine_client_cpp.hpp:290
AP_float64 getUserFloatOr(const char *key, float alt)
Get a user value of type AP_float64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:763
virtual const char * getText() const =0
Retrieve the event's type and its contents as a string.
AP_ENGINE_CLIENT_API void engineInit(const char *processName="C++ Client")
This function must be called once per process first before any other Engine operations are carried ou...
static char const *const QUEUED_INPUT_PUBLIC_TOTAL
Total number of events on input contexts' queues.
Definition: client_status_names.hpp:35
virtual EngineManagement::ConnectMode getConnectMode() const
Get the connection mode associated with this connection.
Definition: engine_client_cpp.hpp:2011
const AP_char8 * getMostBackedUpInput() const
The name of the slowest context.
Definition: engine_client_cpp.hpp:655
AP_uint32 getNumConsumers() const
The number of external consumers/receivers connected to receive emitted events.
Definition: engine_client_cpp.hpp:618
virtual const char * getText() const =0
Retrieve the text of a MonitorScript fragment as a string.
AP_uint64 getNumOutEventsCreated() const
The number of events that have been sent or emitted to channels which have at least one external cons...
Definition: engine_client_cpp.hpp:633
~EngineStatus()
Destroy the underlying status data.
Definition: engine_client_cpp.hpp:917
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1677
static char const *const ROUTE_TOTAL
Number of events fast tracked.
Definition: client_status_names.hpp:33
static char const *const SUB_LISTENERS_TOTAL
Number of active sub-listeners.
Definition: client_status_names.hpp:69
AP_int64 getUserIntOr(const char *key, int alt)
Get a user value of type AP_int64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:743
static char const *const INPUT_TOTAL
Number of events received (includes those that failed to be parsed)
Definition: client_status_names.hpp:57
AP_uint32 getNumMonitors() const
The number of EPL monitor definitions injected into the correlator.
Definition: engine_client_cpp.hpp:554
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1501
static char const *const PERSISTENCE_SNAPSHOT_ROWS_CHANGED_EWMA_TOTAL
The EWMA of number of rows changed.
Definition: client_status_names.hpp:67
pair< std::string, std::string > pair_t
element type
Definition: engine_client_cpp.hpp:460
Fatal messages.
Definition: engine_client_cpp.hpp:102
AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript *mon)
This function allows deletion of MonitorScript objects.
AP_int64 getUserInt(const char *key)
Get a user value of type AP_int64.
Definition: engine_client_cpp.hpp:733
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1921
Nothing logged.
Definition: engine_client_cpp.hpp:96
static char const *const CONSUMERS_TOTAL
Number of consumers attached to the correlator.
Definition: client_status_names.hpp:25
AP_bool getUserBool(const char *key)
Get a user value of type AP_bool.
Definition: engine_client_cpp.hpp:773
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:507
AP_uint32 getNumQueuedInput() const
The number of executors on the input queues of all contexts.
Definition: engine_client_cpp.hpp:597
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1300
AP_ENGINE_CLIENT_API AP_char8 * convertFromUTF8(const AP_char8 *s)
Convert a string in UTF-8 to the local encoding, since most of the Apama API returns UTF-8.
Information about a context returned by an engine inspection.
Definition: engine_client_cpp.hpp:1173
static char const *const MONITORS_TOTAL
Number of monitors.
Definition: client_status_names.hpp:41
StatusIterator operator++(int dummy)
(postfix) increment this iterator
Definition: engine_client_cpp.hpp:476
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:827
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:1958
AP_uint32 getNumOutEventsQueued() const
The number of events waiting on output queues to be dispatched to any connected external consumers/re...
Definition: engine_client_cpp.hpp:625
static char const *const CREATED_OUTPUT_TOTAL
Number of events emitted from correlator.
Definition: client_status_names.hpp:29
AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true)
This function (or engineInit) must be called once per process first before any other Engine operation...
Startup and other important messages.
Definition: engine_client_cpp.hpp:98
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:928
AP_ENGINE_CLIENT_API MonitorScript * createMonitorScript(const char *monitorString)
This function allows creation of MonitorScript objects.
StatusIterator const_iterator
Iterator type for const EngineStatus.
Definition: engine_client_cpp.hpp:535
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:1995
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:250
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:838
AP_uint32 getNumContexts() const
The number of contexts in the correlator, including the main context.
Definition: engine_client_cpp.hpp:547
static char const *const PROCESSED_TOTAL
Number of events taken of output queue.
Definition: client_status_names.hpp:49
For backwards compatibility, single serial connection.
Definition: engine_client_cpp.hpp:1507
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1123
static char const *const LISTENERS_TOTAL
Number of active listeners.
Definition: client_status_names.hpp:39
static char const *const SLOWEST_INPUT_QUEUE_SIZE_TOTAL
Number of executors waiting on that context's queue.
Definition: client_status_names.hpp:77
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1209
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:853
AP_ENGINE_CLIENT_API void setLogFile(const AP_char8 *filename, bool truncate, bool utf8=false)
Sets the file to which the client library should log information.
ConnectMode
The mode that attachAsEventConsumerTo and detachAsEventConsumerFrom operate in.
Definition: engine_client_cpp.hpp:1505
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:936
Information messages (default)
Definition: engine_client_cpp.hpp:108
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1326
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1353
Contains the key names for all standard status values within the correlator.
virtual const std::vector< std::string > & getChannels() const
Get the channels associated with this connection.
Definition: engine_client_cpp.hpp:1979
static char const *const EVENT_TYPES_TOTAL
Number of event types defined.
Definition: client_status_names.hpp:31
std::ostream & operator<<(std::ostream &stream, const EngineStatus &obj)
Stream output operator for a reference.
Definition: engine_client_cpp.hpp:1006
AP_ENGINE_CLIENT_API void engineShutdown()
This function must be called once per process before the application closes down.
virtual const std::string & getHost() const
Get the host associated with this connection.
Definition: engine_client_cpp.hpp:1987
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1148
AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement *corr)
This function allows disconnection from an Engine.
const AP_char8 * getUserString(const char *key)
Get a user value of type AP_char8*.
Definition: engine_client_cpp.hpp:793
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:178
AP_uint32 getNumProcesses() const
The number of monitor instances, also known as sub-monitors.
Definition: engine_client_cpp.hpp:561
const_iterator end() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:709
Critical messages.
Definition: engine_client_cpp.hpp:100
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:496
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2037
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineMonitorOnly(const char *host, unsigned short port, const char *processName=nullptr)
Attempt to establish a monitor-only connection to an Engine listening on the named host and port.
static char const *const QUEUED_INPUT_TOTAL
Number of events on the input queue.
Definition: client_status_names.hpp:55
static char const *const SLOWEST_INPUT_QUEUE_CONTEXT_NAME
Name of the most backlogged input context.
Definition: client_status_names.hpp:79
std::string getAllStatusValuesRaw()
Get all the status values available, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:904
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:699
AP_ENGINE_CLIENT_API void reOpenLog()
Re-opens the log file.
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:94
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1245
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:812
const AP_char8 * getSlowestReceiver() const
The name of the consumer/receiver with the largest number of incoming events waiting to be processed.
Definition: engine_client_cpp.hpp:662
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineReceiveOnly(const char *host, unsigned short port, const char *processName=nullptr)
Attempt to establish a receive-only connection to an Engine listening on the named host and port.
EngineStatus(const EngineStatus &other)
Copy constructor.
Definition: engine_client_cpp.hpp:924
AP_ENGINE_CLIENT_API void deleteWarnings(const char *const *warnings)
This function allows deletion of the lists of warnings returned by injectMonitorScriptWithWarnings(),...
static char const *const OUTPUT_TOTAL
Number of events sent.
Definition: client_status_names.hpp:45
EngineConnection(const char *host, int port, const char *const *channels)
Definition: engine_client_cpp.hpp:1970
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:441
AP_uint32 getMostBackedUpQueueSize() const
The number of events on the slowest context's queue, as identified by the name of the slowest context...
Definition: engine_client_cpp.hpp:676
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:485
AP_ENGINE_CLIENT_API int getLogFD()
Get the file descriptor of this logger.
Warning messages.
Definition: engine_client_cpp.hpp:106
AP_uint32 getNumInputQueuedInput() const
The number of events on the input queues of all public contexts.
Definition: engine_client_cpp.hpp:648
AP_ENGINE_CLIENT_API AP_char8 * convertToUTF8(const AP_char8 *s)
Convert a string in local encoding to UTF-8, as required by most of the Apama API.
static char const *const QUEUED_ROUTE_TOTAL
Number of events on the fast track queue.
Definition: client_status_names.hpp:53
bool valid()
Returns true if this is a valid iterator over status data.
Definition: engine_client_cpp.hpp:498
const AP_char8 * getUserStringOr(const char *key, const char *alt)
Get a user value of type AP_char8* or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:803
AP_ENGINE_CLIENT_API Event * createEvent(const char *eventString, const char *channelString)
This function allows creation of an Event object.
static char const *const SLOWEST_OUTPUT_QUEUE_NAME
Name of the slowest receiver.
Definition: client_status_names.hpp:71
static char const *const QUEUED_OUTPUT_TOTAL
Number of events on the output queue.
Definition: client_status_names.hpp:43
std::ostream & operator<<(std::ostream &stream, const EngineStatus *obj)
Stream output operator for a pointer.
Definition: engine_client_cpp.hpp:1043
Debugging messages.
Definition: engine_client_cpp.hpp:110
AP_float64 getUserFloat(const char *key)
Get a user value of type AP_float64.
Definition: engine_client_cpp.hpp:753
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1275
AP_ENGINE_CLIENT_API EngineManagement * connectToEngine(const char *host, unsigned short port, bool disconnectSlowReceiver=false, const char *processName=nullptr)
This function attempts to establish a connection to an Engine.
std::string getStandardStatusValuesRaw()
Get the standard status values, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:868
AP_uint64 getNumProcessed() const
The number of events processed by the correlator in all contexts.
Definition: engine_client_cpp.hpp:690
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:465
AP_uint64 getNumReceived() const
The number of events that the correlator has received from external sources since the correlator star...
Definition: engine_client_cpp.hpp:604
An EngineException is thrown by methods in this library if any problems are encountered.
Definition: engine_client_cpp.hpp:47
static char const *const PERSISTENCE_LAST_SNAPSHOT_TIMESTAMP
The clock time of the last complete snapshot.
Definition: client_status_names.hpp:61
More-verbose debug messages.
Definition: engine_client_cpp.hpp:112
A MonitorScript object encapsulates an EPL code fragment, containing package, event and monitor defin...
Definition: engine_client_cpp.hpp:392
static char const *const UPTIME_SECONDS
Uptime in ms.
Definition: client_status_names.hpp:23
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
A class used for the iterating through all status items.
Definition: engine_client_cpp.hpp:456
AP_ENGINE_CLIENT_API void deleteEvent(Event *ev)
This function allows deletion of an Event object.
StatusIterator iterator
Iterator type.
Definition: engine_client_cpp.hpp:533
static char const *const CONTEXTS_TOTAL
Number of contexts in the correlator.
Definition: client_status_names.hpp:27
AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier *evsup)
This function disconnects and deletes an EventSupplier object.
static char const *const SLOWEST_OUTPUT_QUEUE_SIZE_TOTAL
Number of events waiting on that receiver's queue.
Definition: client_status_names.hpp:73
AP_uint32 getNumEventTypes() const
The number of event types defined within the correlator.
Definition: engine_client_cpp.hpp:582
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:492
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:471
static char const *const MONITOR_INSTANCES_TOTAL
Number of monitor processes.
Definition: client_status_names.hpp:51
virtual bool getDisconnectSlow() const
Get the value of disconnectSlow flag associated with this connection.
Definition: engine_client_cpp.hpp:2003
Error messages.
Definition: engine_client_cpp.hpp:104
static char const *const PERSISTENCE_COMMIT_TIME_EWMA_SECONDS
The EWMA of time taken to commit, in milliseconds.
Definition: client_status_names.hpp:65
StatusIterator(const StatusIterator &ref)
Copy constructor.
Definition: engine_client_cpp.hpp:501
AP_uint64 getNumOutEventsSent() const
The number of events that have been delivered to external consumers/receivers.
Definition: engine_client_cpp.hpp:641
AP_uint32 getSlowestReceiverQueueSize() const
The number of events on the slowest consumer's/receiver's queue, as identified by the name of the slo...
Definition: engine_client_cpp.hpp:669
AP_bool getUserBoolOr(const char *key, bool alt)
Get a user value of type AP_bool or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:783
static char const *const JAVA_APPLICATIONS_TOTAL
Number of java applications.
Definition: client_status_names.hpp:37