Apama  10.15.0.2
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, 2021-2022 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  */
9 
14 #ifndef ENGINE_CLIENT_CPP_HPP
15 #define ENGINE_CLIENT_CPP_HPP
16 
17 #include <AP_Types.h>
18 #include <AP_Platform.h>
19 #include <iostream>
20 #include <sstream>
21 #include <exception>
22 #include <iterator>
23 #include <algorithm>
24 #include <utility>
25 #include <string>
26 #include <assert.h>
27 #include <sag_internal/engine_client_c.h>
28 #include <client_status_names.hpp>
29 #include <iomanip>
30 #include <vector>
31 
32 
33 using std::pair;
34 
35 #undef ERROR
36 
37 namespace com {
38 
40 namespace apama {
41 
46  class AP_ENGINE_CLIENT_API EngineException : public std::exception
47  {
48  public:
50  EngineException(const char *message);
53 
55  EngineException& operator= (const EngineException& ce) {
56  EngineException(ce).swap(*this);
57  return *this;
58  }
59 
61  virtual ~EngineException() throw();
62 
69  virtual const char* what() const throw() { return m_message; }
70 
78  virtual const char* const* getWarnings() const { return m_warnings; }
79 
80  protected:
82  void swap(EngineException &);
84  const char* const* m_warnings;
85 
86  private:
88  char *m_message;
89  };
90 
91 
93  typedef enum {
112  } LogLevel;
113 
114 
120  AP_ENGINE_CLIENT_API void setLogLevel(LogLevel level);
121 
132  AP_ENGINE_CLIENT_API void setLogFile(const AP_char8* filename, bool truncate, bool utf8 = false);
133 
138  AP_ENGINE_CLIENT_API int getLogFD();
139 
144  AP_ENGINE_CLIENT_API void setLogMutex(void *mutex);
145 
150  AP_ENGINE_CLIENT_API void reOpenLog();
151 
152 
154  AP_ENGINE_CLIENT_API AP_char8* convertToUTF8(const AP_char8* s);
155 
157  AP_ENGINE_CLIENT_API AP_char8* convertFromUTF8(const AP_char8* s);
158 
162  AP_ENGINE_CLIENT_API void char8free(char *string);
163 
167  namespace event {
168 
177  class AP_ENGINE_CLIENT_API Event
178  {
179  friend AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
180  friend AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
181 
182  public:
189  virtual const char* getText() const = 0;
190 
199  virtual const char* getChannel() const = 0;
200 
211  virtual double getTime() const = 0;
212 
214  inline friend std::ostream& operator << (std::ostream& stream, const Event& obj) {
215  stream << obj.getText();
216  return stream;
217  }
219  inline friend std::ostream& operator << (std::ostream& stream, const Event* obj) {
220  stream << obj->getText();
221  return stream;
222  }
223 
224  private:
226  Event(const Event&);
228  Event& operator= (const Event&);
229 
230  protected:
232  Event();
234  virtual ~Event();
235  };
236 
237 
249  class AP_ENGINE_CLIENT_API EventSupplier
250  {
251  friend AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
252 
253  public:
263  virtual void disconnect() = 0;
264 
265  protected:
267  EventSupplier();
269  virtual ~EventSupplier();
270 
271  private:
275  EventSupplier& operator= (const EventSupplier&);
276  };
277 
278 
289  class AP_ENGINE_CLIENT_API EventConsumer
290  {
291  public:
304  virtual void sendEvents(const Event* const* events) = 0;
305 
306  protected:
308  EventConsumer();
310  virtual ~EventConsumer();
311 
312  private:
316  EventConsumer& operator= (const EventConsumer&);
317  };
318 
322  class AP_ENGINE_CLIENT_API DisconnectableEventConsumer : public EventConsumer
323  {
324  public:
332  virtual void disconnect(const char* reason) = 0;
333 
334  protected:
338  virtual ~DisconnectableEventConsumer();
339 
340  private:
345  };
346 
347 
358  AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
359 
365  AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
366 
367 
376  AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
377 
378  } // namespace event
379 
381  namespace engine {
382 
391  class AP_ENGINE_CLIENT_API MonitorScript
392  {
393  friend AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
394  friend AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
395 
396  public:
404  virtual const char* getText() const = 0;
405 
407  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript& obj) {
408  stream << obj.getText();
409  return stream;
410  }
412  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript* obj) {
413  stream << obj->getText();
414  return stream;
415  }
416 
417  private:
421  MonitorScript& operator= (const MonitorScript&);
422 
423  protected:
425  MonitorScript();
427  virtual ~MonitorScript();
428  };
429 
430  class EngineStatus;
431  std::ostream& operator << (std::ostream& stream, const EngineStatus& obj);
432  std::ostream& operator << (std::ostream& stream, const EngineStatus* obj);
433 
434 
440  class AP_ENGINE_CLIENT_API EngineStatus
441  {
442  friend class EngineManagement; /* getStatus */
443 
444  public:
445 
451 #ifdef _MSC_VER
452 // needed or MSVC complains about the use of pair<string> here, even though it's all inlined
453 #pragma warning (disable : 4251)
454 #endif
455  class AP_ENGINE_CLIENT_API StatusIterator : public std::iterator<std::forward_iterator_tag, int>
456  {
457  public:
459  typedef pair<std::string, std::string> pair_t;
460 
462  explicit StatusIterator(const EngineStatus &es, bool end=false);
465  m_status(0),
466  m_opaqueState(0),
467  iterPair()
468  {}
471  {
472  if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
473  }
475  StatusIterator operator++(int dummy/*@unused@*/)
476  {
477  StatusIterator current(*this);
478  ++(*this); //this->operator++() // prefix ++
479  return current;
480  }
482  StatusIterator& operator++();
484  bool operator==(const StatusIterator& ref) const
485  {
486  return (m_status == ref.m_status) &&
487  (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
488  (iterPair.first == ref.iterPair.first));
489  }
491  bool operator!=(const StatusIterator& ref) const { return !((*this)==ref); }
493  pair_t &operator*() { return iterPair; }
495  pair_t *operator->() { return &iterPair; }
497  bool valid() { return 0 != m_opaqueState; }
498 
501  : m_status(ref.m_status),
502  m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
503  iterPair(ref.iterPair)
504  {}
507  {
508  StatusIterator(other).swap(*this);
509  return *this;
510  }
511 
512  private:
514  void step();
516  void swap(StatusIterator &other)
517  {
518  std::swap(m_status, other.m_status);
519  std::swap(m_opaqueState, other.m_opaqueState);
520  std::swap(iterPair, other.iterPair);
521  }
522 
524  const EngineStatus *m_status;
526  void *m_opaqueState;
528  pair_t iterPair;
529  };
530 
535 
539  AP_uint64 getUptime() const {
540  return getStatusIntValue(client_status::UPTIME_SECONDS);
541  }
542 
546  AP_uint32 getNumContexts() const {
547  return (AP_uint32) getStatusIntValue(client_status::CONTEXTS_TOTAL);
548  }
549 
553  AP_uint32 getNumMonitors() const {
554  return (AP_uint32) getStatusIntValue(client_status::MONITORS_TOTAL);
555  }
556 
560  AP_uint32 getNumProcesses() const {
561  return (AP_uint32) getStatusIntValue(client_status::MONITOR_INSTANCES_TOTAL);
562  }
563 
567  AP_uint32 getNumJavaApplications() const {
568  return (AP_uint32) getStatusIntValue(client_status::JAVA_APPLICATIONS_TOTAL);
569  }
570 
574  AP_uint32 getNumListeners() const {
575  return (AP_uint32) getStatusIntValue(client_status::LISTENERS_TOTAL);
576  }
577 
581  AP_uint32 getNumEventTypes() const {
582  return (AP_uint32) getStatusIntValue(client_status::EVENT_TYPES_TOTAL);
583  }
584 
588  AP_uint32 getNumQueuedFastTrack() const {
589  return (AP_uint32) getStatusIntValue(client_status::QUEUED_ROUTE_TOTAL);
590  }
591 
596  AP_uint32 getNumQueuedInput() const {
597  return (AP_uint32) getStatusIntValue(client_status::QUEUED_INPUT_TOTAL);
598  }
599 
603  AP_uint64 getNumReceived() const {
604  return getStatusIntValue(client_status::INPUT_TOTAL);
605  }
606 
610  AP_uint64 getNumFastTracked() const {
611  return getStatusIntValue(client_status::ROUTE_TOTAL);
612  }
613 
617  AP_uint32 getNumConsumers() const {
618  return (AP_uint32) getStatusIntValue(client_status::CONSUMERS_TOTAL);
619  }
620 
624  AP_uint32 getNumOutEventsQueued() const {
625  return (AP_uint32) getStatusIntValue(client_status::QUEUED_OUTPUT_TOTAL);
626  }
627 
632  AP_uint64 getNumOutEventsCreated() const {
633  return getStatusIntValue(client_status::CREATED_OUTPUT_TOTAL);
634  }
635 
640  AP_uint64 getNumOutEventsSent() const {
641  return getStatusIntValue(client_status::OUTPUT_TOTAL);
642  }
643 
647  AP_uint32 getNumInputQueuedInput() const {
648  return (AP_uint32) getStatusIntValue(client_status::QUEUED_INPUT_PUBLIC_TOTAL);
649  }
650 
654  const AP_char8* getMostBackedUpInput() const {
656  }
657 
661  const AP_char8 *getSlowestReceiver() const {
663  }
664 
668  AP_uint32 getSlowestReceiverQueueSize() const {
669  return (AP_uint32) getStatusIntValue(client_status::SLOWEST_OUTPUT_QUEUE_SIZE_TOTAL);
670  }
671 
675  AP_uint32 getMostBackedUpQueueSize() const {
676  return (AP_uint32) getStatusIntValue(client_status::SLOWEST_INPUT_QUEUE_SIZE_TOTAL);
677  }
678 
682  AP_uint32 getNumSubListeners() const {
683  return (AP_uint32) getStatusIntValue(client_status::SUB_LISTENERS_TOTAL);
684  }
685 
689  AP_uint64 getNumProcessed() const {
690  return getStatusIntValue(client_status::PROCESSED_TOTAL);
691  }
699  return StatusIterator(*this);
700  }
701 
708  const_iterator end() const {
709  return StatusIterator(*this, true);
710  }
711 
715  const AP_char8* operator[] (const char *ref) const {
716  return getStatusValue(ref);
717  }
718 
722  const AP_char8* operator[] (std::string &ref) const {
723  return this->operator[](ref.c_str());
724  }
725 
732  AP_int64 getUserInt(const char* key) {
733  return userInt(key);
734  }
735 
742  AP_int64 getUserIntOr(const char* key, int alt) {
743  return userIntOr(key, alt);
744  }
745 
752  AP_float64 getUserFloat(const char* key) {
753  return userFloat(key);
754  }
755 
762  AP_float64 getUserFloatOr(const char* key, float alt) {
763  return userFloatOr(key, alt);
764  }
765 
772  AP_bool getUserBool(const char* key) {
773  return userBool(key);
774  }
775 
782  AP_bool getUserBoolOr(const char* key, bool alt) {
783  return userBoolOr(key, alt);
784  }
785 
792  const AP_char8* getUserString(const char* key) {
793  return userString(key);
794  }
795 
802  const AP_char8* getUserStringOr(const char* key, const char* alt) {
803  return userStringOr(key, alt);
804  }
805 
811  std::string getAllStatusValues() {
812  std::ostringstream ost;
813  ost << getStandardStatusValues();
814  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
815  if (it->first.find("user-") != std::string::npos)
816  ost << std::setw(32) << setiosflags(std::ios_base::left) << it->first.append(":") << it->second << std::endl;
817  }
818  return ost.str();
819  }
820 
826  std::string getStandardStatusValues() {
827  std::ostringstream ost;
828  ost << *this;
829  return ost.str();
830  }
831 
837  static std::string getRawHeader() {
838  std::ostringstream ost;
839  ost << "Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
840  ost << "# Sub-listeners,# Event types,Input queue,# Received events,";
841  ost << "Route queue,# Routed events,# Consumers,Output queue,";
842  ost << "# Created output events,# Sent output events,# Processed events,";
843  ost << "Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
844  return ost.str();
845  }
846 
852  std::string getRawHeaderAll() {
853  std::ostringstream ost;
854  ost << getRawHeader();
855  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
856  if (it->first.find("user-") != std::string::npos)
857  ost << "," << it->first;
858  }
859  return ost.str();
860  }
861 
868  std::ostringstream ost;
869  ost << getUptime()
870  << "," << getNumContexts()
871  << "," << getNumMonitors()
872  << "," << getNumProcesses()
873  << "," << getNumJavaApplications()
874  << "," << getNumListeners()
875  << "," << getNumSubListeners()
876  << "," << getNumEventTypes()
877  << "," << getNumQueuedInput()
878  << "," << getNumReceived()
879  << "," << getNumQueuedFastTrack()
880  << "," << getNumFastTracked()
881  << "," << getNumConsumers()
882  << "," << getNumOutEventsQueued()
883  << "," << getNumOutEventsCreated()
884  << "," << getNumOutEventsSent()
885  << "," << getStatusValue(client_status::PERSISTENCE_SNAPSHOTS_TOTAL)
890  << "," << getNumProcessed()
891  << "," << getMostBackedUpInput()
892  << "," << getMostBackedUpQueueSize()
893  << "," << getSlowestReceiver()
894  << "," << getSlowestReceiverQueueSize();
895  return ost.str();
896  }
897 
903  std::string getAllStatusValuesRaw() {
904  std::ostringstream ost;
905  ost << getStandardStatusValuesRaw();
906  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
907  if (it->first.find("user-") != std::string::npos)
908  ost << "," << it->second;
909  }
910  return ost.str();
911  }
912 
917  {
918  if (c_status) {
919  c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
920  }
921  }
924  : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
925  {}
928  {
929  EngineStatus(other).swap(*this);
930  return *this;
931  }
935  EngineStatus(): c_status(0) {}
936  private:
938  EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
940  void swap(EngineStatus &other) {
941  std::swap(c_status, other.c_status);
942  }
944  void getNext(const char *&name, const char *&value, void *&opaqueState) const {
945  if (c_status)
946  c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
947  }
949  const AP_char8* getStatusValue(const char *name) const {
950  return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
951  }
953  AP_uint64 getStatusIntValue(const char *name) const {
954  return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
955  }
957  void disposeIterator(void *opaqueState) const {
958  c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
959  }
961  void *copyIterator(void *opaqueState) const {
962  return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
963  }
964 
966  AP_int64 userIntOr(const char* key, AP_int64 alt) {
967  return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
968  }
970  AP_float64 userFloatOr(const char* key, AP_float64 alt) {
971  return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
972  }
974  AP_bool userBoolOr(const char* key, AP_bool alt) {
975  return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
976  }
978  const AP_char8* userStringOr(const char* key, const AP_char8* alt) {
979  return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
980  }
982  AP_int64 userInt(const char* key) {
983  return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
984  }
986  AP_float64 userFloat(const char* key) {
987  return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
988  }
990  AP_bool userBool(const char* key) {
991  return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
992  }
994  const AP_char8* userString(const char* key) {
995  return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
996  }
998  AP_EngineStatus_API *c_status;
999  };
1000 
1001 
1005  inline std::ostream& operator << (std::ostream& stream, const EngineStatus& obj) {
1006  std::ostringstream ost;
1007  ost
1008  << "Uptime(ms): " << obj.getUptime() << std::endl
1009  << "Number of contexts: " << obj.getNumContexts() << std::endl
1010  << "Number of monitors: " << obj.getNumMonitors() << std::endl
1011  << "Number of sub-monitors: " << obj.getNumProcesses() << std::endl
1012  << "Number of Java applications: " << obj.getNumJavaApplications() << std::endl
1013  << "Number of listeners: " << obj.getNumListeners() << std::endl
1014  << "Number of sub-listeners: " << obj.getNumSubListeners() << std::endl
1015  << "Number of event types: " << obj.getNumEventTypes() << std::endl
1016  << "Events on input queue: " << obj.getNumQueuedInput() << std::endl
1017  << "Events received: " << obj.getNumReceived() << std::endl
1018  << "Events processed: " << obj.getNumProcessed() << std::endl
1019  << "Events on internal queue: " << obj.getNumQueuedFastTrack() << std::endl
1020  << "Events routed internally: " << obj.getNumFastTracked() << std::endl
1021  << "Number of consumers: " << obj.getNumConsumers() << std::endl
1022  << "Events on output queue: " << obj.getNumOutEventsQueued() << std::endl
1023  << "Output events created: " << obj.getNumOutEventsCreated() << std::endl
1024  << "Output events sent: " << obj.getNumOutEventsSent() << std::endl
1025  << "Events on input context queues: " << obj.getNumInputQueuedInput() << std::endl
1026  << "Number of persistent snapshots: " << obj[client_status::PERSISTENCE_SNAPSHOTS_TOTAL] << std::endl
1027  << "Last persistent snapshot time: " << obj[client_status::PERSISTENCE_LAST_SNAPSHOT_TIMESTAMP] << std::endl
1028  << "Persistent snapshot wait time Millis (EWMA): " << obj[client_status::PERSISTENCE_SNAPSHOT_WAIT_EWMA_SECONDS] << std::endl
1029  << "Persistent commit time Millis (EWMA): " << obj[client_status::PERSISTENCE_COMMIT_TIME_EWMA_SECONDS] << std::endl
1030  << "Last persistent snapshot rows changed (EWMA): " << obj[client_status::PERSISTENCE_SNAPSHOT_ROWS_CHANGED_EWMA_TOTAL] << std::endl
1031  << "Slowest context name: " << obj.getMostBackedUpInput() << std::endl
1032  << "Slowest context queue size: " << obj.getMostBackedUpQueueSize() << std::endl
1033  << "Slowest receiver name: " << obj.getSlowestReceiver() << std::endl
1034  << "Slowest receiver queue size: " << obj.getSlowestReceiverQueueSize() << std::endl;
1035  stream << ost.str();
1036  return stream;
1037  }
1038 
1042  inline std::ostream& operator << (std::ostream& stream, const EngineStatus* obj) {
1043  stream << *obj;
1044  return stream;
1045  }
1046 
1047  inline EngineStatus::StatusIterator::StatusIterator(const EngineStatus &es, bool end):
1048  m_status(&es),
1049  m_opaqueState(0),
1050  iterPair()
1051  {
1052  if (!end) step(); // get the first item in the map
1053  }
1054 
1056  inline EngineStatus::StatusIterator& EngineStatus::StatusIterator::operator++()
1057  {
1058  if (m_opaqueState) step();// don't step past the end
1059  return *this;
1060  }
1061 
1062  inline void EngineStatus::StatusIterator::step()
1063  {
1064  const char *name = nullptr;
1065  const char *value = nullptr;
1066 
1067  /* get the next item from the library map */
1068  m_status->getNext(name, value, m_opaqueState );
1069  if(!name || !value) {
1070  assert(!m_opaqueState);
1071  } else {
1072  iterPair = pair_t(name, value);
1073  }
1074  }
1075 
1086  class AP_ENGINE_CLIENT_API NameInfo
1087  {
1088  public:
1092  virtual const char* getName() const = 0;
1093 
1098  virtual const char* getPackage() const = 0;
1099 
1103  virtual const char* getFullyQualifiedName() const = 0;
1104 
1105  private:
1107  NameInfo(const NameInfo&);
1109  NameInfo& operator= (const NameInfo&);
1110 
1111  protected:
1113  NameInfo();
1115  virtual ~NameInfo();
1116  };
1117 
1122  class AP_ENGINE_CLIENT_API NamedMonitorInfo : public NameInfo
1123  {
1124  public:
1128  virtual unsigned int getNumSubMonitors() const = 0;
1129 
1130  private:
1134  NamedMonitorInfo& operator= (const NamedMonitorInfo&);
1135 
1136  protected:
1138  NamedMonitorInfo();
1140  virtual ~NamedMonitorInfo();
1141  };
1142 
1147  class AP_ENGINE_CLIENT_API NamedJavaApplicationInfo : public NameInfo {
1148 
1149  public:
1153  virtual unsigned int getNumListeners() const = 0;
1154 
1155  private:
1160 
1161  protected:
1165  virtual ~NamedJavaApplicationInfo();
1166  };
1167 
1172  class AP_ENGINE_CLIENT_API NamedContextInfo : public NameInfo {
1173 
1174  public:
1178  virtual unsigned int getNumSubMonitors() const = 0;
1179 
1183  virtual unsigned int getQueueSize() const = 0;
1184 
1188  virtual char const *const *getChannels() const = 0;
1189 
1190  private:
1194  NamedContextInfo& operator= (const NamedContextInfo&);
1195 
1196  protected:
1198  NamedContextInfo();
1200  virtual ~NamedContextInfo();
1201  };
1202 
1203 
1208  class AP_ENGINE_CLIENT_API NamedReceiverInfo : public NameInfo {
1209 
1210  public:
1214  virtual unsigned int getQueueSize() const = 0;
1215 
1219  virtual char const *const *getChannels() const = 0;
1220 
1224  virtual const AP_char8 *getAddress() const = 0;
1225 
1226  private:
1230  NamedReceiverInfo& operator= (const NamedReceiverInfo&);
1231 
1232  protected:
1236  virtual ~NamedReceiverInfo();
1237  };
1238 
1239 
1244  class AP_ENGINE_CLIENT_API NamedPluginReceiverInfo : public NameInfo {
1245 
1246  public:
1250  virtual unsigned int getQueueSize() const = 0;
1251 
1255  virtual char const *const *getChannels() const = 0;
1256 
1257  private:
1262 
1263  protected:
1267  virtual ~NamedPluginReceiverInfo();
1268  };
1269 
1274  class AP_ENGINE_CLIENT_API NamedEventTypeInfo : public NameInfo {
1275 
1276  public:
1280  virtual unsigned int getNumEventTemplates() const = 0;
1281 
1282  private:
1286  NamedEventTypeInfo& operator= (const NamedEventTypeInfo&);
1287 
1288  protected:
1292  virtual ~NamedEventTypeInfo();
1293  };
1294 
1299  class AP_ENGINE_CLIENT_API NamedTimerInfo : public NameInfo {
1300 
1301  public:
1305  virtual unsigned int getNumTimers() const = 0;
1306 
1307  private:
1311  NamedTimerInfo& operator= (const NamedTimerInfo&);
1312 
1313  protected:
1315  NamedTimerInfo();
1317  virtual ~NamedTimerInfo();
1318  };
1319 
1325  class AP_ENGINE_CLIENT_API NamedAggregateInfo : public NameInfo {
1326 
1327  private:
1331  NamedAggregateInfo& operator= (const NamedAggregateInfo&);
1332 
1333  protected:
1337  virtual ~NamedAggregateInfo();
1338  };
1339 
1352  class AP_ENGINE_CLIENT_API EngineInfo
1353  {
1354  friend AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
1355 
1356  public:
1360  virtual unsigned int getNumMonitors() const = 0;
1361 
1365  virtual unsigned int getNumJavaApplications() const = 0;
1366 
1370  virtual unsigned int getNumEventTypes() const = 0;
1371 
1375  virtual unsigned int getNumTimers() const = 0;
1376 
1380  virtual unsigned int getNumAggregates() const = 0;
1381 
1389  virtual NamedMonitorInfo** getMonitors() const = 0;
1390 
1398  virtual NamedJavaApplicationInfo** getJavaApplications() const = 0;
1399 
1407  virtual NamedEventTypeInfo** getEventTypes() const = 0;
1408 
1416  virtual NamedTimerInfo** getTimers() const = 0;
1417 
1425  virtual NamedAggregateInfo** getAggregates() const = 0;
1426 
1430  virtual unsigned int getNumContexts() const = 0;
1431 
1439  virtual NamedContextInfo** getContexts() const = 0;
1440 
1444  virtual unsigned int getNumReceivers() const = 0;
1445 
1453  virtual NamedReceiverInfo **getReceivers() const = 0;
1454 
1458  virtual unsigned int getNumPluginReceivers() const = 0;
1459 
1467  virtual NamedPluginReceiverInfo **getPluginReceivers() const = 0;
1468 
1469  private:
1471  EngineInfo(const EngineInfo&);
1473  EngineInfo& operator= (const EngineInfo&);
1474 
1475  protected:
1477  EngineInfo();
1479  virtual ~EngineInfo();
1480  };
1481 
1482  class AP_ENGINE_CLIENT_API EngineConnection;
1483 
1500  class AP_ENGINE_CLIENT_API EngineManagement : public com::apama::event::EventConsumer
1501  {
1502  public:
1508  CONNECT_PARALLEL
1509  };
1516  virtual void injectMonitorScript(MonitorScript& script) = 0;
1517 
1533  virtual const char* const* injectMonitorScriptWithWarnings(MonitorScript& script) = 0;
1534 
1551  virtual const char* const* injectMonitorScriptWithWarningsFilename(MonitorScript& script, const char *filename) = 0;
1552 
1559  virtual void deleteName(const char * name) = 0;
1560 
1567  virtual void forceDeleteName(const char * name) = 0;
1568 
1575  virtual void killName(const char * name) = 0;
1576 
1580  virtual void deleteAll() = 0;
1581 
1590  virtual void injectJava(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1591 
1608  virtual const char* const* injectJavaWithWarnings(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1609 
1624  virtual const char* const* injectJavaWithWarningsFilename(const AP_uint8* jarbytes, AP_uint32 size, const char *filename) = 0;
1625 
1626 
1636  virtual void injectCDP(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename=NULL) = 0;
1637 
1654  virtual const char* const* injectCDPWithWarnings(const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1655 
1670  virtual const char* const* injectCDPWithWarningsFilename(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename) = 0;
1671 
1677  {
1678  char *errmsg = nullptr;
1679  AP_EngineStatus *es_api = engineManagement_getStatusOpaque(this, &errmsg);
1680  if (errmsg) {
1681  com::apama::EngineException e(errmsg);
1682  free(errmsg);
1683  throw e;
1684  }
1685 
1686  return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1687  }
1688 
1712  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels, bool disconnectSlow) = 0;
1713 
1730  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels) = 0;
1731 
1754  virtual bool attachAsEventConsumerTo(EngineManagement* target, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1755 
1756 
1779  virtual bool attachAsEventConsumerTo(const char* host, int port, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1780 
1781 
1798  virtual void detachAsEventConsumerFrom(EngineManagement* target, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1799 
1817  virtual void detachAsEventConsumerFrom(const char* host, int port, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1818 
1829  virtual void sendEvents(const com::apama::event::Event* const* events) = 0;
1830 
1838  virtual void sendEventsNoBatching(const com::apama::event::Event* const* events) = 0;
1839 
1843  virtual void flushEvents() = 0;
1844 
1853  virtual EngineInfo* inspectEngine() = 0;
1854 
1871  virtual void ping() = 0;
1872 
1878  virtual bool isConnected() = 0;
1879 
1895  virtual void setReceiverConnections(const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1896 
1901  virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1902 
1903  protected:
1905  EngineManagement();
1907  virtual ~EngineManagement();
1908 
1909  private:
1913  EngineManagement& operator= (const EngineManagement&);
1914  };
1915 
1920  class AP_ENGINE_CLIENT_API EngineConnection {
1921  private:
1922  std::string host;
1923  int port;
1924  std::vector<std::string> channels;
1925  bool disconnectSlow;
1926  EngineManagement::ConnectMode connectMode;
1927 
1928  void init(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char * const * channels) {
1929  if (host == NULL || channels == NULL) {
1930  throw EngineException("EngineConnection cannot be created with null host or channels");
1931  }
1932  if (port < 0 || port > 65535) {
1933  throw EngineException("EngineConnection cannot be created with invalid port value");
1934  }
1935 
1936  this->host = std::string(host);
1937  this->port = port;
1938  this->disconnectSlow = disconnectSlow;
1939  this->connectMode = connectMode;
1940 
1941  for (const char* const* c = channels; *c != NULL; c++) {
1942  this->channels.push_back(std::string(*c));
1943  }
1944  }
1945 
1946  public:
1957  EngineConnection(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode,
1958  const char * const * channels) {
1959  init(host, port, disconnectSlow, connectMode, channels);
1960  }
1961 
1969  EngineConnection(const char * host, int port, const char * const * channels) {
1970  init(host, port, false, EngineManagement::CONNECT_LEGACY, channels);
1971  }
1972 
1978  virtual const std::vector<std::string>& getChannels() const {
1979  return channels;
1980  }
1981 
1986  virtual const std::string& getHost() const {
1987  return host;
1988  }
1989 
1994  virtual int getPort() const {
1995  return port;
1996  }
1997 
2002  virtual bool getDisconnectSlow() const{
2003  return disconnectSlow;
2004  }
2005 
2011  return connectMode;
2012  }
2013 
2015  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection& obj) {
2016  std::ostringstream ost;
2017  ost << "EngineConnection to " << obj.host << ":" << obj.port << (obj.disconnectSlow == true ? " diconnectSlow" : "") << " on" <<
2018  (obj.connectMode == EngineManagement::CONNECT_PARALLEL ? " parallel" : "") << " channels [";
2019 
2020  if (!obj.channels.empty()) {
2021  std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost, ", "));
2022  ost << obj.channels.back();
2023  }
2024  ost << "]";
2025  stream << ost.str();
2026  return stream;
2027  }
2028 
2030  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection* obj) {
2031  stream << *obj;
2032  return stream;
2033  }
2034 
2036  virtual ~EngineConnection() {
2037  }
2038  };
2039 
2046  AP_ENGINE_CLIENT_API void engineInit(const char* processName = "C++ Client");
2047 
2048 
2055  AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true);
2056 
2062  AP_ENGINE_CLIENT_API void engineShutdown();
2063 
2064 
2079  AP_ENGINE_CLIENT_API EngineManagement* connectToEngine(const char* host, unsigned short port, bool disconnectSlowReceiver = false, const char *processName = nullptr);
2080 
2094  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineReceiveOnly(const char* host, unsigned short port, const char *processName = nullptr);
2095 
2108  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineMonitorOnly(const char* host, unsigned short port, const char *processName = nullptr);
2109 
2119  AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement* corr);
2120 
2127  AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
2128 
2134  AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
2135 
2145  AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
2146 
2147 
2155  AP_ENGINE_CLIENT_API void deleteWarnings(const char* const* warnings);
2156 
2169  AP_ENGINE_CLIENT_API void setEngineParams(const char* params);
2170 
2171  } // namespace engine
2172 
2173 } // namespace apama
2174 
2175 } // namespace com
2176 
2177 
2178 #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:610
AP_uint32 getNumListeners() const
The number of listeners in all contexts.
Definition: engine_client_cpp.hpp:574
AP_uint64 getUptime() const
The time in milliseconds since the correlator was started.
Definition: engine_client_cpp.hpp:539
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:78
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:322
AP_uint32 getNumJavaApplications() const
The number of Java applications and Java EPL plug-ins loaded in the correlator.
Definition: engine_client_cpp.hpp:567
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1086
AP_uint32 getNumQueuedFastTrack() const
The sum of routed events on the route queues of all contexts.
Definition: engine_client_cpp.hpp:588
AP_uint32 getNumSubListeners() const
The number of sub-event-listeners that are active across all contexts.
Definition: engine_client_cpp.hpp:682
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events.
Definition: engine_client_cpp.hpp:289
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:762
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:2010
const AP_char8 * getMostBackedUpInput() const
The name of the slowest context.
Definition: engine_client_cpp.hpp:654
AP_uint32 getNumConsumers() const
The number of external consumers/receivers connected to receive emitted events.
Definition: engine_client_cpp.hpp:617
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:632
~EngineStatus()
Destroy the underlying status data.
Definition: engine_client_cpp.hpp:916
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1676
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:742
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:553
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1500
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:459
Fatal messages.
Definition: engine_client_cpp.hpp:101
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:732
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1920
Nothing logged.
Definition: engine_client_cpp.hpp:95
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:772
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:506
AP_uint32 getNumQueuedInput() const
The number of executors on the input queues of all contexts.
Definition: engine_client_cpp.hpp:596
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1299
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:1172
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:475
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:826
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:1957
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:624
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:97
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:927
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:534
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:1994
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:249
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:837
AP_uint32 getNumContexts() const
The number of contexts in the correlator, including the main context.
Definition: engine_client_cpp.hpp:546
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:1506
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1122
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:1208
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:852
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:1504
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:935
Information messages (default)
Definition: engine_client_cpp.hpp:107
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1325
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1352
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:1978
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:1005
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:1986
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1147
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:792
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:177
AP_uint32 getNumProcesses() const
The number of monitor instances, also known as sub-monitors.
Definition: engine_client_cpp.hpp:560
const_iterator end() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:708
Critical messages.
Definition: engine_client_cpp.hpp:99
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:495
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2036
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:903
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:698
AP_ENGINE_CLIENT_API void reOpenLog()
Re-opens the log file.
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:93
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1244
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:811
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:661
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:923
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:1969
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:440
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:675
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:484
AP_ENGINE_CLIENT_API int getLogFD()
Get the file descriptor of this logger.
Warning messages.
Definition: engine_client_cpp.hpp:105
AP_uint32 getNumInputQueuedInput() const
The number of events on the input queues of all public contexts.
Definition: engine_client_cpp.hpp:647
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:497
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:802
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:1042
Debugging messages.
Definition: engine_client_cpp.hpp:109
AP_float64 getUserFloat(const char *key)
Get a user value of type AP_float64.
Definition: engine_client_cpp.hpp:752
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1274
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:867
AP_uint64 getNumProcessed() const
The number of events processed by the correlator in all contexts.
Definition: engine_client_cpp.hpp:689
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:464
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:603
An EngineException (or instance of a derived class) is thrown by methods in this library if any probl...
Definition: engine_client_cpp.hpp:46
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:111
A MonitorScript object encapsulates an EPL code fragment, containing package, event and monitor defin...
Definition: engine_client_cpp.hpp:391
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:455
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:532
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:581
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:491
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:470
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:2002
Error messages.
Definition: engine_client_cpp.hpp:103
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:500
AP_uint64 getNumOutEventsSent() const
The number of events that have been delivered to external consumers/receivers.
Definition: engine_client_cpp.hpp:640
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:668
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:782
static char const *const JAVA_APPLICATIONS_TOTAL
Number of java applications.
Definition: client_status_names.hpp:37