Apama  10.3.1.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2018 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 339850 2018-10-24 14:11:01Z cat $
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 
140  AP_ENGINE_CLIENT_API void setLogFD(int fd);
141 
146  AP_ENGINE_CLIENT_API void setLogMutex(void *mutex);
147 
152  AP_ENGINE_CLIENT_API void reOpenLog();
153 
154 
156  AP_ENGINE_CLIENT_API AP_char8* convertToUTF8(const AP_char8* s);
157 
159  AP_ENGINE_CLIENT_API AP_char8* convertFromUTF8(const AP_char8* s);
160 
164  AP_ENGINE_CLIENT_API void char8free(char *string);
165 
169  namespace event {
170 
179  class AP_ENGINE_CLIENT_API Event
180  {
181  friend AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
182  friend AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
183 
184  public:
191  virtual const char* getText() const = 0;
192 
201  virtual const char* getChannel() const = 0;
202 
213  virtual double getTime() const = 0;
214 
216  inline friend std::ostream& operator << (std::ostream& stream, const Event& obj) {
217  stream << obj.getText();
218  return stream;
219  }
221  inline friend std::ostream& operator << (std::ostream& stream, const Event* obj) {
222  stream << obj->getText();
223  return stream;
224  }
225 
226  private:
228  Event(const Event&);
230  Event& operator= (const Event&);
231 
232  protected:
234  Event();
236  virtual ~Event();
237  };
238 
239 
251  class AP_ENGINE_CLIENT_API EventSupplier
252  {
253  friend AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
254 
255  public:
265  virtual void disconnect() = 0;
266 
267  protected:
269  EventSupplier();
271  virtual ~EventSupplier();
272 
273  private:
277  EventSupplier& operator= (const EventSupplier&);
278  };
279 
280 
291  class AP_ENGINE_CLIENT_API EventConsumer
292  {
293  public:
306  virtual void sendEvents(const Event* const* events) = 0;
307 
308  protected:
310  EventConsumer();
312  virtual ~EventConsumer();
313 
314  private:
318  EventConsumer& operator= (const EventConsumer&);
319  };
320 
324  class AP_ENGINE_CLIENT_API DisconnectableEventConsumer : public EventConsumer
325  {
326  public:
334  virtual void disconnect(const char* reason) = 0;
335 
336  protected:
340  virtual ~DisconnectableEventConsumer();
341 
342  private:
347  };
348 
349 
360  AP_ENGINE_CLIENT_API Event* createEvent(const char* eventString, const char* channelString);
361 
367  AP_ENGINE_CLIENT_API void deleteEvent(Event* ev);
368 
369 
378  AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier* evsup);
379 
380  } // namespace event
381 
383  namespace engine {
384 
393  class AP_ENGINE_CLIENT_API MonitorScript
394  {
395  friend AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
396  friend AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
397 
398  public:
406  virtual const char* getText() const = 0;
407 
409  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript& obj) {
410  stream << obj.getText();
411  return stream;
412  }
414  inline friend std::ostream& operator << (std::ostream& stream, const MonitorScript* obj) {
415  stream << obj->getText();
416  return stream;
417  }
418 
419  private:
423  MonitorScript& operator= (const MonitorScript&);
424 
425  protected:
427  MonitorScript();
429  virtual ~MonitorScript();
430  };
431 
432  class EngineStatus;
433  std::ostream& operator << (std::ostream& stream, const EngineStatus& obj);
434  std::ostream& operator << (std::ostream& stream, const EngineStatus* obj);
435 
436 
442  class AP_ENGINE_CLIENT_API EngineStatus
443  {
444  friend class EngineManagement; /* getStatus */
445 
446  public:
447 
453 #ifdef _MSC_VER
454 // needed or MSVC complains about the use of pair<string> here, even though it's all inlined
455 #pragma warning (disable : 4251)
456 #endif
457  class AP_ENGINE_CLIENT_API StatusIterator : public std::iterator<std::forward_iterator_tag, int>
458  {
459  public:
461  typedef pair<std::string, std::string> pair_t;
462 
464  explicit StatusIterator(const EngineStatus &es, bool end=false);
467  m_status(0),
468  m_opaqueState(0),
469  iterPair()
470  {}
473  {
474  if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
475  }
477  StatusIterator operator++(int dummy/*@unused@*/)
478  {
479  StatusIterator current(*this);
480  ++(*this); //this->operator++() // prefix ++
481  return current;
482  }
484  StatusIterator& operator++();
486  bool operator==(const StatusIterator& ref) const
487  {
488  return (m_status == ref.m_status) &&
489  (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
490  (iterPair.first == ref.iterPair.first));
491  }
493  bool operator!=(const StatusIterator& ref) const { return !((*this)==ref); }
495  pair_t &operator*() { return iterPair; }
497  pair_t *operator->() { return &iterPair; }
499  bool valid() { return 0 != m_opaqueState; }
500 
503  : m_status(ref.m_status),
504  m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
505  iterPair(ref.iterPair)
506  {}
509  {
510  StatusIterator(other).swap(*this);
511  return *this;
512  }
513 
514  private:
516  void step();
518  void swap(StatusIterator &other)
519  {
520  std::swap(m_status, other.m_status);
521  std::swap(m_opaqueState, other.m_opaqueState);
522  std::swap(iterPair, other.iterPair);
523  }
524 
526  const EngineStatus *m_status;
528  void *m_opaqueState;
530  pair_t iterPair;
531  };
532 
537 
541  AP_uint64 getUptime() const {
542  return getStatusIntValue(client_status::UPTIME_SECONDS);
543  }
544 
548  AP_uint32 getNumContexts() const {
549  return (AP_uint32) getStatusIntValue(client_status::CONTEXTS_TOTAL);
550  }
551 
555  AP_uint32 getNumMonitors() const {
556  return (AP_uint32) getStatusIntValue(client_status::MONITORS_TOTAL);
557  }
558 
562  AP_uint32 getNumProcesses() const {
563  return (AP_uint32) getStatusIntValue(client_status::MONITOR_INSTANCES_TOTAL);
564  }
565 
569  AP_uint32 getNumJavaApplications() const {
570  return (AP_uint32) getStatusIntValue(client_status::JAVA_APPLICATIONS_TOTAL);
571  }
572 
576  AP_uint32 getNumListeners() const {
577  return (AP_uint32) getStatusIntValue(client_status::LISTENERS_TOTAL);
578  }
579 
583  AP_uint32 getNumEventTypes() const {
584  return (AP_uint32) getStatusIntValue(client_status::EVENT_TYPES_TOTAL);
585  }
586 
590  AP_uint32 getNumQueuedFastTrack() const {
591  return (AP_uint32) getStatusIntValue(client_status::QUEUED_ROUTE_TOTAL);
592  }
593 
598  AP_uint32 getNumQueuedInput() const {
599  return (AP_uint32) getStatusIntValue(client_status::QUEUED_INPUT_TOTAL);
600  }
601 
605  AP_uint64 getNumReceived() const {
606  return getStatusIntValue(client_status::INPUT_TOTAL);
607  }
608 
612  AP_uint64 getNumFastTracked() const {
613  return getStatusIntValue(client_status::ROUTE_TOTAL);
614  }
615 
619  AP_uint32 getNumConsumers() const {
620  return (AP_uint32) getStatusIntValue(client_status::CONSUMERS_TOTAL);
621  }
622 
626  AP_uint32 getNumOutEventsQueued() const {
627  return (AP_uint32) getStatusIntValue(client_status::QUEUED_OUTPUT_TOTAL);
628  }
629 
634  AP_uint64 getNumOutEventsCreated() const {
635  return getStatusIntValue(client_status::CREATED_OUTPUT_TOTAL);
636  }
637 
642  AP_uint64 getNumOutEventsSent() const {
643  return getStatusIntValue(client_status::OUTPUT_TOTAL);
644  }
645 
649  AP_uint32 getNumInputQueuedInput() const {
650  return (AP_uint32) getStatusIntValue(client_status::QUEUED_INPUT_PUBLIC_TOTAL);
651  }
652 
656  const AP_char8* getMostBackedUpInput() const {
658  }
659 
663  const AP_char8 *getSlowestReceiver() const {
665  }
666 
670  AP_uint32 getSlowestReceiverQueueSize() const {
671  return (AP_uint32) getStatusIntValue(client_status::SLOWEST_OUTPUT_QUEUE_SIZE_TOTAL);
672  }
673 
677  AP_uint32 getMostBackedUpQueueSize() const {
678  return (AP_uint32) getStatusIntValue(client_status::SLOWEST_INPUT_QUEUE_SIZE_TOTAL);
679  }
680 
684  AP_uint32 getNumSubListeners() const {
685  return (AP_uint32) getStatusIntValue(client_status::SUB_LISTENERS_TOTAL);
686  }
687 
691  AP_uint64 getNumProcessed() const {
692  return getStatusIntValue(client_status::PROCESSED_TOTAL);
693  }
700  const_iterator begin() const {
701  return StatusIterator(*this);
702  }
703 
710  const_iterator end() const {
711  return StatusIterator(*this, true);
712  }
713 
717  const AP_char8* operator[] (const char *ref) const {
718  return getStatusValue(ref);
719  }
720 
724  const AP_char8* operator[] (std::string &ref) const {
725  return this->operator[](ref.c_str());
726  }
727 
734  AP_int64 getUserInt(const char* key) {
735  return userInt(key);
736  }
737 
744  AP_int64 getUserIntOr(const char* key, int alt) {
745  return userIntOr(key, alt);
746  }
747 
754  AP_float64 getUserFloat(const char* key) {
755  return userFloat(key);
756  }
757 
764  AP_float64 getUserFloatOr(const char* key, float alt) {
765  return userFloatOr(key, alt);
766  }
767 
774  AP_bool getUserBool(const char* key) {
775  return userBool(key);
776  }
777 
784  AP_bool getUserBoolOr(const char* key, bool alt) {
785  return userBoolOr(key, alt);
786  }
787 
794  const AP_char8* getUserString(const char* key) {
795  return userString(key);
796  }
797 
804  const AP_char8* getUserStringOr(const char* key, const char* alt) {
805  return userStringOr(key, alt);
806  }
807 
813  std::string getAllStatusValues() {
814  std::ostringstream ost;
815  ost << getStandardStatusValues();
816  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
817  if (it->first.find("user-") != std::string::npos)
818  ost << std::setw(32) << setiosflags(std::ios_base::left) << it->first.append(":") << it->second << std::endl;
819  }
820  return ost.str();
821  }
822 
828  std::string getStandardStatusValues() {
829  std::ostringstream ost;
830  ost << *this;
831  return ost.str();
832  }
833 
839  static std::string getRawHeader() {
840  std::ostringstream ost;
841  ost << "Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
842  ost << "# Sub-listeners,# Event types,Input queue,# Received events,";
843  ost << "Route queue,# Routed events,# Consumers,Output queue,";
844  ost << "# Created output events,# Sent output events,# Processed events,";
845  ost << "Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
846  return ost.str();
847  }
848 
854  std::string getRawHeaderAll() {
855  std::ostringstream ost;
856  ost << getRawHeader();
857  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
858  if (it->first.find("user-") != std::string::npos)
859  ost << "," << it->first;
860  }
861  return ost.str();
862  }
863 
870  std::ostringstream ost;
871  ost << getUptime()
872  << "," << getNumContexts()
873  << "," << getNumMonitors()
874  << "," << getNumProcesses()
875  << "," << getNumJavaApplications()
876  << "," << getNumListeners()
877  << "," << getNumSubListeners()
878  << "," << getNumEventTypes()
879  << "," << getNumQueuedInput()
880  << "," << getNumReceived()
881  << "," << getNumQueuedFastTrack()
882  << "," << getNumFastTracked()
883  << "," << getNumConsumers()
884  << "," << getNumOutEventsQueued()
885  << "," << getNumOutEventsCreated()
886  << "," << getNumOutEventsSent()
887  << "," << getStatusValue(client_status::PERSISTENCE_SNAPSHOTS_TOTAL)
892  << "," << getNumProcessed()
893  << "," << getMostBackedUpInput()
894  << "," << getMostBackedUpQueueSize()
895  << "," << getSlowestReceiver()
896  << "," << getSlowestReceiverQueueSize();
897  return ost.str();
898  }
899 
905  std::string getAllStatusValuesRaw() {
906  std::ostringstream ost;
907  ost << getStandardStatusValuesRaw();
908  for (EngineStatus::StatusIterator it = begin(); it != end(); ++it) {
909  if (it->first.find("user-") != std::string::npos)
910  ost << "," << it->second;
911  }
912  return ost.str();
913  }
914 
919  {
920  if (c_status) {
921  c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
922  }
923  }
926  : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
927  {}
930  {
931  EngineStatus(other).swap(*this);
932  return *this;
933  }
937  EngineStatus(): c_status(0) {}
938  private:
940  EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
942  void swap(EngineStatus &other) {
943  std::swap(c_status, other.c_status);
944  }
946  void getNext(const char *&name, const char *&value, void *&opaqueState) const {
947  if (c_status)
948  c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
949  }
951  const AP_char8* getStatusValue(const char *name) const {
952  return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
953  }
955  AP_uint64 getStatusIntValue(const char *name) const {
956  return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
957  }
959  void disposeIterator(void *opaqueState) const {
960  c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
961  }
963  void *copyIterator(void *opaqueState) const {
964  return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
965  }
966 
968  AP_int64 userIntOr(const char* key, AP_int64 alt) {
969  return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
970  }
972  AP_float64 userFloatOr(const char* key, AP_float64 alt) {
973  return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
974  }
976  AP_bool userBoolOr(const char* key, AP_bool alt) {
977  return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
978  }
980  const AP_char8* userStringOr(const char* key, const AP_char8* alt) {
981  return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
982  }
984  AP_int64 userInt(const char* key) {
985  return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
986  }
988  AP_float64 userFloat(const char* key) {
989  return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
990  }
992  AP_bool userBool(const char* key) {
993  return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
994  }
996  const AP_char8* userString(const char* key) {
997  return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
998  }
1000  AP_EngineStatus_API *c_status;
1001  };
1002 
1003 
1007  inline std::ostream& operator << (std::ostream& stream, const EngineStatus& obj) {
1008  std::ostringstream ost;
1009  ost
1010  << "Uptime(ms): " << obj.getUptime() << std::endl
1011  << "Number of contexts: " << obj.getNumContexts() << std::endl
1012  << "Number of monitors: " << obj.getNumMonitors() << std::endl
1013  << "Number of sub-monitors: " << obj.getNumProcesses() << std::endl
1014  << "Number of Java applications: " << obj.getNumJavaApplications() << std::endl
1015  << "Number of listeners: " << obj.getNumListeners() << std::endl
1016  << "Number of sub-listeners: " << obj.getNumSubListeners() << std::endl
1017  << "Number of event types: " << obj.getNumEventTypes() << std::endl
1018  << "Events on input queue: " << obj.getNumQueuedInput() << std::endl
1019  << "Events received: " << obj.getNumReceived() << std::endl
1020  << "Events processed: " << obj.getNumProcessed() << std::endl
1021  << "Events on internal queue: " << obj.getNumQueuedFastTrack() << std::endl
1022  << "Events routed internally: " << obj.getNumFastTracked() << std::endl
1023  << "Number of consumers: " << obj.getNumConsumers() << std::endl
1024  << "Events on output queue: " << obj.getNumOutEventsQueued() << std::endl
1025  << "Output events created: " << obj.getNumOutEventsCreated() << std::endl
1026  << "Output events sent: " << obj.getNumOutEventsSent() << std::endl
1027  << "Events on input context queues: " << obj.getNumInputQueuedInput() << std::endl
1028  << "Number of persistent snapshots: " << obj[client_status::PERSISTENCE_SNAPSHOTS_TOTAL] << std::endl
1029  << "Last persistent snapshot time: " << obj[client_status::PERSISTENCE_LAST_SNAPSHOT_TIMESTAMP] << std::endl
1030  << "Persistent snapshot wait time Millis (EWMA): " << obj[client_status::PERSISTENCE_SNAPSHOT_WAIT_EWMA_SECONDS] << std::endl
1031  << "Persistent commit time Millis (EWMA): " << obj[client_status::PERSISTENCE_COMMIT_TIME_EWMA_SECONDS] << std::endl
1032  << "Last persistent snapshot rows changed (EWMA): " << obj[client_status::PERSISTENCE_SNAPSHOT_ROWS_CHANGED_EWMA_TOTAL] << std::endl
1033  << "Slowest context name: " << obj.getMostBackedUpInput() << std::endl
1034  << "Slowest context queue size: " << obj.getMostBackedUpQueueSize() << std::endl
1035  << "Slowest receiver name: " << obj.getSlowestReceiver() << std::endl
1036  << "Slowest receiver queue size: " << obj.getSlowestReceiverQueueSize() << std::endl;
1037  stream << ost.str();
1038  return stream;
1039  }
1040 
1044  inline std::ostream& operator << (std::ostream& stream, const EngineStatus* obj) {
1045  stream << *obj;
1046  return stream;
1047  }
1048 
1049  inline EngineStatus::StatusIterator::StatusIterator(const EngineStatus &es, bool end):
1050  m_status(&es),
1051  m_opaqueState(0),
1052  iterPair()
1053  {
1054  if (!end) step(); // get the first item in the map
1055  }
1056 
1058  inline EngineStatus::StatusIterator& EngineStatus::StatusIterator::operator++()
1059  {
1060  if (m_opaqueState) step();// don't step past the end
1061  return *this;
1062  }
1063 
1064  inline void EngineStatus::StatusIterator::step()
1065  {
1066  const char *name = nullptr;
1067  const char *value = nullptr;
1068 
1069  /* get the next item from the library map */
1070  m_status->getNext(name, value, m_opaqueState );
1071  if(!name || !value) {
1072  assert(!m_opaqueState);
1073  } else {
1074  iterPair = pair_t(name, value);
1075  }
1076  }
1077 
1088  class AP_ENGINE_CLIENT_API NameInfo
1089  {
1090  public:
1094  virtual const char* getName() const = 0;
1095 
1100  virtual const char* getPackage() const = 0;
1101 
1105  virtual const char* getFullyQualifiedName() const = 0;
1106 
1107  private:
1109  NameInfo(const NameInfo&);
1111  NameInfo& operator= (const NameInfo&);
1112 
1113  protected:
1115  NameInfo();
1117  virtual ~NameInfo();
1118  };
1119 
1124  class AP_ENGINE_CLIENT_API NamedMonitorInfo : public NameInfo
1125  {
1126  public:
1130  virtual unsigned int getNumSubMonitors() const = 0;
1131 
1132  private:
1136  NamedMonitorInfo& operator= (const NamedMonitorInfo&);
1137 
1138  protected:
1140  NamedMonitorInfo();
1142  virtual ~NamedMonitorInfo();
1143  };
1144 
1149  class AP_ENGINE_CLIENT_API NamedJavaApplicationInfo : public NameInfo {
1150 
1151  public:
1155  virtual unsigned int getNumListeners() const = 0;
1156 
1157  private:
1162 
1163  protected:
1167  virtual ~NamedJavaApplicationInfo();
1168  };
1169 
1174  class AP_ENGINE_CLIENT_API NamedContextInfo : public NameInfo {
1175 
1176  public:
1180  virtual unsigned int getNumSubMonitors() const = 0;
1181 
1185  virtual unsigned int getQueueSize() const = 0;
1186 
1190  virtual char const *const *getChannels() const = 0;
1191 
1192  private:
1196  NamedContextInfo& operator= (const NamedContextInfo&);
1197 
1198  protected:
1200  NamedContextInfo();
1202  virtual ~NamedContextInfo();
1203  };
1204 
1205 
1210  class AP_ENGINE_CLIENT_API NamedReceiverInfo : public NameInfo {
1211 
1212  public:
1216  virtual unsigned int getQueueSize() const = 0;
1217 
1221  virtual char const *const *getChannels() const = 0;
1222 
1226  virtual const AP_char8 *getAddress() const = 0;
1227 
1228  private:
1232  NamedReceiverInfo& operator= (const NamedReceiverInfo&);
1233 
1234  protected:
1238  virtual ~NamedReceiverInfo();
1239  };
1240 
1241 
1246  class AP_ENGINE_CLIENT_API NamedPluginReceiverInfo : public NameInfo {
1247 
1248  public:
1252  virtual unsigned int getQueueSize() const = 0;
1253 
1257  virtual char const *const *getChannels() const = 0;
1258 
1259  private:
1264 
1265  protected:
1269  virtual ~NamedPluginReceiverInfo();
1270  };
1271 
1276  class AP_ENGINE_CLIENT_API NamedEventTypeInfo : public NameInfo {
1277 
1278  public:
1282  virtual unsigned int getNumEventTemplates() const = 0;
1283 
1284  private:
1288  NamedEventTypeInfo& operator= (const NamedEventTypeInfo&);
1289 
1290  protected:
1294  virtual ~NamedEventTypeInfo();
1295  };
1296 
1301  class AP_ENGINE_CLIENT_API NamedTimerInfo : public NameInfo {
1302 
1303  public:
1307  virtual unsigned int getNumTimers() const = 0;
1308 
1309  private:
1313  NamedTimerInfo& operator= (const NamedTimerInfo&);
1314 
1315  protected:
1317  NamedTimerInfo();
1319  virtual ~NamedTimerInfo();
1320  };
1321 
1327  class AP_ENGINE_CLIENT_API NamedAggregateInfo : public NameInfo {
1328 
1329  private:
1333  NamedAggregateInfo& operator= (const NamedAggregateInfo&);
1334 
1335  protected:
1339  virtual ~NamedAggregateInfo();
1340  };
1341 
1354  class AP_ENGINE_CLIENT_API EngineInfo
1355  {
1356  friend AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
1357 
1358  public:
1362  virtual unsigned int getNumMonitors() const = 0;
1363 
1367  virtual unsigned int getNumJavaApplications() const = 0;
1368 
1372  virtual unsigned int getNumEventTypes() const = 0;
1373 
1377  virtual unsigned int getNumTimers() const = 0;
1378 
1382  virtual unsigned int getNumAggregates() const = 0;
1383 
1391  virtual NamedMonitorInfo** getMonitors() const = 0;
1392 
1400  virtual NamedJavaApplicationInfo** getJavaApplications() const = 0;
1401 
1409  virtual NamedEventTypeInfo** getEventTypes() const = 0;
1410 
1418  virtual NamedTimerInfo** getTimers() const = 0;
1419 
1427  virtual NamedAggregateInfo** getAggregates() const = 0;
1428 
1432  virtual unsigned int getNumContexts() const = 0;
1433 
1441  virtual NamedContextInfo** getContexts() const = 0;
1442 
1446  virtual unsigned int getNumReceivers() const = 0;
1447 
1455  virtual NamedReceiverInfo **getReceivers() const = 0;
1456 
1460  virtual unsigned int getNumPluginReceivers() const = 0;
1461 
1469  virtual NamedPluginReceiverInfo **getPluginReceivers() const = 0;
1470 
1471  private:
1473  EngineInfo(const EngineInfo&);
1475  EngineInfo& operator= (const EngineInfo&);
1476 
1477  protected:
1479  EngineInfo();
1481  virtual ~EngineInfo();
1482  };
1483 
1484  class AP_ENGINE_CLIENT_API EngineConnection;
1485 
1502  class AP_ENGINE_CLIENT_API EngineManagement : public com::apama::event::EventConsumer
1503  {
1504  public:
1510  CONNECT_PARALLEL
1511  };
1518  virtual void injectMonitorScript(MonitorScript& script) = 0;
1519 
1535  virtual const char* const* injectMonitorScriptWithWarnings(MonitorScript& script) = 0;
1536 
1553  virtual const char* const* injectMonitorScriptWithWarningsFilename(MonitorScript& script, const char *filename) = 0;
1554 
1561  virtual void deleteName(const char * name) = 0;
1562 
1569  virtual void forceDeleteName(const char * name) = 0;
1570 
1577  virtual void killName(const char * name) = 0;
1578 
1582  virtual void deleteAll() = 0;
1583 
1592  virtual void injectJava(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1593 
1610  virtual const char* const* injectJavaWithWarnings(const AP_uint8* jarbytes, AP_uint32 size) = 0;
1611 
1626  virtual const char* const* injectJavaWithWarningsFilename(const AP_uint8* jarbytes, AP_uint32 size, const char *filename) = 0;
1627 
1628 
1638  virtual void injectCDP(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename=NULL) = 0;
1639 
1656  virtual const char* const* injectCDPWithWarnings(const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1657 
1672  virtual const char* const* injectCDPWithWarningsFilename(const AP_uint8* cdpbytes, AP_uint32 size, const char *filename) = 0;
1673 
1679  {
1680  char *errmsg = nullptr;
1681  AP_EngineStatus *es_api = engineManagement_getStatusOpaque(this, &errmsg);
1682  if (errmsg) {
1683  com::apama::EngineException e(errmsg);
1684  free(errmsg);
1685  throw e;
1686  }
1687 
1688  return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1689  }
1690 
1714  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels, bool disconnectSlow) = 0;
1715 
1732  virtual com::apama::event::EventSupplier* connectEventConsumer(com::apama::event::EventConsumer* consumer, const char* const* channels) = 0;
1733 
1756  virtual bool attachAsEventConsumerTo(EngineManagement* target, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1757 
1758 
1781  virtual bool attachAsEventConsumerTo(const char* host, int port, const char* const* channels, bool disconnectSlow = false, ConnectMode mode = CONNECT_LEGACY) = 0;
1782 
1783 
1800  virtual void detachAsEventConsumerFrom(EngineManagement* target, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1801 
1819  virtual void detachAsEventConsumerFrom(const char* host, int port, const char* const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1820 
1831  virtual void sendEvents(const com::apama::event::Event* const* events) = 0;
1832 
1840  virtual void sendEventsNoBatching(const com::apama::event::Event* const* events) = 0;
1841 
1845  virtual void flushEvents() = 0;
1846 
1855  virtual EngineInfo* inspectEngine() = 0;
1856 
1873  virtual void ping() = 0;
1874 
1880  virtual bool isConnected() = 0;
1881 
1897  virtual void setReceiverConnections(const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1898 
1903  virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1904 
1905  protected:
1907  EngineManagement();
1909  virtual ~EngineManagement();
1910 
1911  private:
1915  EngineManagement& operator= (const EngineManagement&);
1916  };
1917 
1922  class AP_ENGINE_CLIENT_API EngineConnection {
1923  private:
1924  std::string host;
1925  int port;
1926  std::vector<std::string> channels;
1927  bool disconnectSlow;
1928  EngineManagement::ConnectMode connectMode;
1929 
1930  void init(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char * const * channels) {
1931  if (host == NULL || channels == NULL) {
1932  throw EngineException("EngineConnection cannot be created with null host or channels");
1933  }
1934  if (port < 0 || port > 65535) {
1935  throw EngineException("EngineConnection cannot be created with invalid port value");
1936  }
1937 
1938  this->host = std::string(host);
1939  this->port = port;
1940  this->disconnectSlow = disconnectSlow;
1941  this->connectMode = connectMode;
1942 
1943  for (const char* const* c = channels; *c != NULL; c++) {
1944  this->channels.push_back(std::string(*c));
1945  }
1946  }
1947 
1948  public:
1959  EngineConnection(const char * host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode,
1960  const char * const * channels) {
1961  init(host, port, disconnectSlow, connectMode, channels);
1962  }
1963 
1971  EngineConnection(const char * host, int port, const char * const * channels) {
1972  init(host, port, false, EngineManagement::CONNECT_LEGACY, channels);
1973  }
1974 
1980  virtual const std::vector<std::string>& getChannels() const {
1981  return channels;
1982  }
1983 
1988  virtual const std::string& getHost() const {
1989  return host;
1990  }
1991 
1996  virtual int getPort() const {
1997  return port;
1998  }
1999 
2004  virtual bool getDisconnectSlow() const{
2005  return disconnectSlow;
2006  }
2007 
2013  return connectMode;
2014  }
2015 
2017  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection& obj) {
2018  std::ostringstream ost;
2019  ost << "EngineConnection to " << obj.host << ":" << obj.port << (obj.disconnectSlow == true ? " diconnectSlow" : "") << " on" <<
2020  (obj.connectMode == EngineManagement::CONNECT_PARALLEL ? " parallel" : "") << " channels [";
2021 
2022  if (!obj.channels.empty()) {
2023  std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost, ", "));
2024  ost << obj.channels.back();
2025  }
2026  ost << "]";
2027  stream << ost.str();
2028  return stream;
2029  }
2030 
2032  inline friend std::ostream& operator << (std::ostream& stream, const EngineConnection* obj) {
2033  stream << *obj;
2034  return stream;
2035  }
2036 
2038  virtual ~EngineConnection() {
2039  }
2040  };
2041 
2048  AP_ENGINE_CLIENT_API void engineInit(const char* processName = "C++ Client");
2049 
2050 
2057  AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true);
2058 
2064  AP_ENGINE_CLIENT_API void engineShutdown();
2065 
2066 
2081  AP_ENGINE_CLIENT_API EngineManagement* connectToEngine(const char* host, unsigned short port, bool disconnectSlowReceiver = false, const char *processName = nullptr);
2082 
2096  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineReceiveOnly(const char* host, unsigned short port, const char *processName = nullptr);
2097 
2110  AP_ENGINE_CLIENT_API EngineManagement* connectToEngineMonitorOnly(const char* host, unsigned short port, const char *processName = nullptr);
2111 
2121  AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement* corr);
2122 
2129  AP_ENGINE_CLIENT_API MonitorScript* createMonitorScript(const char* monitorString);
2130 
2136  AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript* mon);
2137 
2147  AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo* info);
2148 
2149 
2157  AP_ENGINE_CLIENT_API void deleteWarnings(const char* const* warnings);
2158 
2171  AP_ENGINE_CLIENT_API void setEngineParams(const char* params);
2172 
2173  } // namespace engine
2174 
2175 } // namespace apama
2176 
2177 } // namespace com
2178 
2179 
2180 #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_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.
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:324
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1088
const AP_char8 * getMostBackedUpInput() const
The name of the slowest context.
Definition: engine_client_cpp.hpp:656
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events...
Definition: engine_client_cpp.hpp:291
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:764
virtual const char * getText() const =0
Retrieve the event's type and its contents as a string.
AP_uint32 getNumConsumers() const
The number of external consumers/receivers connected to receive emitted events.
Definition: engine_client_cpp.hpp:619
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
AP_uint32 getNumInputQueuedInput() const
The number of events on the input queues of all public contexts.
Definition: engine_client_cpp.hpp:649
virtual const char * getText() const =0
Retrieve the text of a MonitorScript fragment as a string.
~EngineStatus()
Destroy the underlying status data.
Definition: engine_client_cpp.hpp:918
AP_uint32 getNumSubListeners() const
The number of sub-event-listeners that are active across all contexts.
Definition: engine_client_cpp.hpp:684
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1678
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:744
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:605
static char const *const INPUT_TOTAL
Number of events received (includes those that failed to be parsed)
Definition: client_status_names.hpp:57
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1502
static char const *const PERSISTENCE_SNAPSHOT_ROWS_CHANGED_EWMA_TOTAL
The EWMA of number of rows changed.
Definition: client_status_names.hpp:67
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:486
virtual const std::vector< std::string > & getChannels() const
Get the channels associated with this connection.
Definition: engine_client_cpp.hpp:1980
virtual const std::string & getHost() const
Get the host associated with this connection.
Definition: engine_client_cpp.hpp:1988
pair< std::string, std::string > pair_t
element type
Definition: engine_client_cpp.hpp:461
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:734
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1922
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:774
AP_uint32 getNumJavaApplications() const
The number of Java applications and Java EPL plug-ins loaded in the correlator.
Definition: engine_client_cpp.hpp:569
Definition: sag_connectivity_threading.h:178
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:508
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1301
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...
AP_uint32 getNumContexts() const
The number of contexts in the correlator, including the main context.
Definition: engine_client_cpp.hpp:548
Information about a context returned by an engine inspection.
Definition: engine_client_cpp.hpp:1174
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:477
pair_t & operator*()
Return a reference to the element pointed to.
Definition: engine_client_cpp.hpp:495
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:828
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:1959
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
AP_uint32 getNumQueuedFastTrack() const
The sum of routed events on the route queues of all contexts.
Definition: engine_client_cpp.hpp:590
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:929
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:536
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:251
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:839
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:663
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:1508
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1124
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:1210
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:854
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:1506
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:937
Information messages (default)
Definition: engine_client_cpp.hpp:108
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1327
virtual const char *const * getWarnings() const
Retrieve the set of warnings associated with the exception.
Definition: engine_client_cpp.hpp:79
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:670
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1354
Contains the key names for all standard status values within the correlator.
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:1007
AP_ENGINE_CLIENT_API void engineShutdown()
This function must be called once per process before the application closes down. ...
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1149
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:794
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:179
AP_uint32 getNumMonitors() const
The number of EPL monitor definitions injected into the correlator.
Definition: engine_client_cpp.hpp:555
virtual bool getDisconnectSlow() const
Get the value of disconnectSlow flag associated with this connection.
Definition: engine_client_cpp.hpp:2004
Critical messages.
Definition: engine_client_cpp.hpp:100
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:677
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:497
AP_uint64 getUptime() const
The time in milliseconds since the correlator was started.
Definition: engine_client_cpp.hpp:541
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items...
Definition: engine_client_cpp.hpp:700
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2038
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:905
AP_ENGINE_CLIENT_API void reOpenLog()
Re-opens the log file.
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:626
AP_uint32 getNumEventTypes() const
The number of event types defined within the correlator.
Definition: engine_client_cpp.hpp:583
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:94
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1246
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:813
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:925
AP_uint32 getNumQueuedInput() const
The number of executors on the input queues of all contexts.
Definition: engine_client_cpp.hpp:598
AP_uint64 getNumOutEventsSent() const
The number of events that have been delivered to external consumers/receivers.
Definition: engine_client_cpp.hpp:642
AP_ENGINE_CLIENT_API void deleteWarnings(const char *const *warnings)
This function allows deletion of the lists of warnings returned by injectMonitorScriptWithWarnings()...
const_iterator end() const
Returns an instance of the StatusIterator which allows to iterate over all status items...
Definition: engine_client_cpp.hpp:710
virtual EngineManagement::ConnectMode getConnectMode() const
Get the connection mode associated with this connection.
Definition: engine_client_cpp.hpp:2012
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:1971
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:442
AP_uint32 getNumListeners() const
The number of listeners in all contexts.
Definition: engine_client_cpp.hpp:576
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:634
Warning messages.
Definition: engine_client_cpp.hpp:106
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:499
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:804
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:1044
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:754
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:493
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1276
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:869
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:466
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:393
AP_ENGINE_CLIENT_API void setLogFD(int fd)
Sets the file descriptor to which the client library should log information.
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:457
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:534
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 getNumProcesses() const
The number of monitor instances, also known as sub-monitors.
Definition: engine_client_cpp.hpp:562
AP_uint64 getNumProcessed() const
The number of events processed by the correlator in all contexts.
Definition: engine_client_cpp.hpp:691
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:472
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:1996
static char const *const MONITOR_INSTANCES_TOTAL
Number of monitor processes.
Definition: client_status_names.hpp:51
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:502
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:612
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:784
static char const *const JAVA_APPLICATIONS_TOTAL
Number of java applications.
Definition: client_status_names.hpp:37