15 #ifndef ENGINE_CLIENT_CPP_HPP
16 #define ENGINE_CLIENT_CPP_HPP
19 #include <AP_Platform.h>
28 #include <sag_internal/engine_client_c.h>
69 virtual const
char* what() const throw() {
return m_message; }
78 virtual const char*
const*
getWarnings()
const {
return m_warnings; }
84 const char*
const* m_warnings;
132 AP_ENGINE_CLIENT_API
void setLogFile(
const AP_char8* filename,
bool truncate,
bool utf8 =
false);
139 AP_ENGINE_CLIENT_API
void setLogFD(
int fd);
145 AP_ENGINE_CLIENT_API
void setLogMutex(
void *mutex);
155 AP_ENGINE_CLIENT_API AP_char8*
convertToUTF8(
const AP_char8* s);
163 AP_ENGINE_CLIENT_API
void char8free(
char *
string);
180 friend AP_ENGINE_CLIENT_API
Event*
createEvent(
const char* eventString,
const char* channelString);
190 virtual const char* getText()
const = 0;
200 virtual const char* getChannel()
const = 0;
212 virtual double getTime()
const = 0;
264 virtual void disconnect() = 0;
305 virtual void sendEvents(
const Event*
const* events) = 0;
333 virtual void disconnect(
const char* reason) = 0;
359 AP_ENGINE_CLIENT_API
Event*
createEvent(
const char* eventString,
const char* channelString);
405 virtual const char* getText()
const = 0;
432 std::ostream&
operator << (std::ostream& stream,
const EngineStatus& obj);
433 std::ostream&
operator << (std::ostream& stream,
const EngineStatus* obj);
454 #pragma warning (disable : 4251)
456 class AP_ENGINE_CLIENT_API
StatusIterator :
public std::iterator<std::forward_iterator_tag, int>
460 typedef pair<std::string, std::string>
pair_t;
473 if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
487 return (m_status == ref.m_status) &&
488 (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
489 (iterPair.first == ref.iterPair.first));
498 bool valid() {
return 0 != m_opaqueState; }
502 : m_status(ref.m_status),
503 m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
504 iterPair(ref.iterPair)
519 std::swap(m_status, other.m_status);
520 std::swap(m_opaqueState, other.m_opaqueState);
521 std::swap(iterPair, other.iterPair);
541 return getStatusIntValue(
"uptime");
548 return (AP_uint32) getStatusIntValue(
"numContexts");
555 return (AP_uint32) getStatusIntValue(
"numMonitors");
562 return (AP_uint32) getStatusIntValue(
"numProcesses");
569 return (AP_uint32) getStatusIntValue(
"numJavaApplications");
576 return (AP_uint32) getStatusIntValue(
"numListeners");
583 return (AP_uint32) getStatusIntValue(
"numEventTypes");
590 return (AP_uint32) getStatusIntValue(
"numQueuedFastTrack");
598 return (AP_uint32) getStatusIntValue(
"numQueuedInput");
605 return getStatusIntValue(
"numReceived");
612 return getStatusIntValue(
"numFastTracked");
619 return (AP_uint32) getStatusIntValue(
"numConsumers");
626 return (AP_uint32) getStatusIntValue(
"numOutEventsQueued");
634 return getStatusIntValue(
"numEmits");
642 return getStatusIntValue(
"numOutEventsSent");
649 return (AP_uint32) getStatusIntValue(
"numInputQueuedInput");
656 return (*
this)[
"mostBackedUpInputContext"];
663 return (*
this)[
"slowestReceiver"];
670 return (AP_uint32) getStatusIntValue(
"slowestReceiverQueueSize");
677 return (AP_uint32) getStatusIntValue(
"mostBackedUpQueueSize");
684 return (AP_uint32) getStatusIntValue(
"numSubListeners");
691 return getStatusIntValue(
"numProcessed");
709 const_iterator
end()
const {
716 const AP_char8* operator[] (
const char *ref)
const {
717 return getStatusValue(ref);
723 const AP_char8* operator[] (std::string &ref)
const {
724 return this->operator[](ref.c_str());
744 return userIntOr(key, alt);
754 return userFloat(key);
764 return userFloatOr(key, alt);
774 return userBool(key);
784 return userBoolOr(key, alt);
794 return userString(key);
804 return userStringOr(key, alt);
813 std::ostringstream ost;
814 ost << getStandardStatusValues();
816 if (it->first.find(
"user-") != std::string::npos)
817 ost << std::setw(32) << setiosflags(std::ios_base::left) << it->first.append(
":") << it->second << std::endl;
828 std::ostringstream ost;
839 std::ostringstream ost;
840 ost <<
"Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
841 ost <<
"# Sub-listeners,# Event types,Input queue,# Received events,";
842 ost <<
"Route queue,# Routed events,# Consumers,Output queue,";
843 ost <<
"# Created output events,# Sent output events,# Processed events,";
844 ost <<
"Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
854 std::ostringstream ost;
855 ost << getRawHeader();
857 if (it->first.find(
"user-") != std::string::npos)
858 ost <<
"," << it->first;
869 std::ostringstream ost;
871 <<
"," << getNumContexts()
872 <<
"," << getNumMonitors()
873 <<
"," << getNumProcesses()
874 <<
"," << getNumJavaApplications()
875 <<
"," << getNumListeners()
876 <<
"," << getNumSubListeners()
877 <<
"," << getNumEventTypes()
878 <<
"," << getNumQueuedInput()
879 <<
"," << getNumReceived()
880 <<
"," << getNumQueuedFastTrack()
881 <<
"," << getNumFastTracked()
882 <<
"," << getNumConsumers()
883 <<
"," << getNumOutEventsQueued()
884 <<
"," << getNumOutEventsCreated()
885 <<
"," << getNumOutEventsSent()
886 <<
"," << getStatusValue(
"persistenceNumSnapshots")
887 <<
"," << getStatusValue(
"persistenceLastSnapshotTime")
888 <<
"," << getStatusValue(
"persistenceSnapshotWaitTimeEwmaMillis")
889 <<
"," << getStatusValue(
"persistenceCommitTimeEwmaMillis")
890 <<
"," << getStatusValue(
"persistenceLastSnapshotRowsChangedEwma")
891 <<
"," << getNumProcessed()
892 <<
"," << getMostBackedUpInput()
893 <<
"," << getMostBackedUpQueueSize()
894 <<
"," << getSlowestReceiver()
895 <<
"," << getSlowestReceiverQueueSize();
905 std::ostringstream ost;
906 ost << getStandardStatusValuesRaw();
908 if (it->first.find(
"user-") != std::string::npos)
909 ost <<
"," << it->second;
920 c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
925 : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
939 EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
941 void swap(EngineStatus &other) {
942 std::swap(c_status, other.c_status);
945 void getNext(
const char *&name,
const char *&value,
void *&opaqueState)
const {
947 c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
950 const AP_char8* getStatusValue(
const char *name)
const {
951 return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
954 AP_uint64 getStatusIntValue(
const char *name)
const {
955 return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
958 void disposeIterator(
void *opaqueState)
const {
959 c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
962 void *copyIterator(
void *opaqueState)
const {
963 return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
967 AP_int64 userIntOr(
const char* key, AP_int64 alt) {
968 return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
971 AP_float64 userFloatOr(
const char* key, AP_float64 alt) {
972 return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
975 AP_bool userBoolOr(
const char* key, AP_bool alt) {
976 return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
979 const AP_char8* userStringOr(
const char* key,
const AP_char8* alt) {
980 return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
983 AP_int64 userInt(
const char* key) {
984 return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
987 AP_float64 userFloat(
const char* key) {
988 return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
991 AP_bool userBool(
const char* key) {
992 return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
995 const AP_char8* userString(
const char* key) {
996 return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
999 AP_EngineStatus_API *c_status;
1007 std::ostringstream ost;
1009 <<
"Uptime(ms): " << obj.
getUptime() << std::endl
1027 <<
"Number of persistent snapshots: " << obj[
"persistenceNumSnapshots"] << std::endl
1028 <<
"Last persistent snapshot time: " << obj[
"persistenceLastSnapshotTime"] << std::endl
1029 <<
"Persistent snapshot wait time Millis (EWMA): " << obj[
"persistenceSnapshotWaitTimeEwmaMillis"] << std::endl
1030 <<
"Persistent commit time Millis (EWMA): " << obj[
"persistenceCommitTimeEwmaMillis"] << std::endl
1031 <<
"Last persistent snapshot rows changed (EWMA): " << obj[
"persistenceLastSnapshotRowsChangedEwma"] << std::endl
1036 stream << ost.str();
1059 if (m_opaqueState) step();
1063 inline void EngineStatus::StatusIterator::step()
1065 const char *name =
nullptr;
1066 const char *value =
nullptr;
1069 m_status->getNext(name, value, m_opaqueState );
1070 if(!name || !value) {
1071 assert(!m_opaqueState);
1073 iterPair = pair_t(name, value);
1093 virtual const char* getName()
const = 0;
1099 virtual const char* getPackage()
const = 0;
1104 virtual const char* getFullyQualifiedName()
const = 0;
1129 virtual unsigned int getNumSubMonitors()
const = 0;
1154 virtual unsigned int getNumListeners()
const = 0;
1179 virtual unsigned int getNumSubMonitors()
const = 0;
1184 virtual unsigned int getQueueSize()
const = 0;
1189 virtual char const *
const *getChannels()
const = 0;
1215 virtual unsigned int getQueueSize()
const = 0;
1220 virtual char const *
const *getChannels()
const = 0;
1225 virtual const AP_char8 *getAddress()
const = 0;
1251 virtual unsigned int getQueueSize()
const = 0;
1256 virtual char const *
const *getChannels()
const = 0;
1281 virtual unsigned int getNumEventTemplates()
const = 0;
1306 virtual unsigned int getNumTimers()
const = 0;
1361 virtual unsigned int getNumMonitors()
const = 0;
1366 virtual unsigned int getNumJavaApplications()
const = 0;
1371 virtual unsigned int getNumEventTypes()
const = 0;
1376 virtual unsigned int getNumTimers()
const = 0;
1381 virtual unsigned int getNumAggregates()
const = 0;
1431 virtual unsigned int getNumContexts()
const = 0;
1445 virtual unsigned int getNumReceivers()
const = 0;
1459 virtual unsigned int getNumPluginReceivers()
const = 0;
1517 virtual void injectMonitorScript(
MonitorScript& script) = 0;
1534 virtual const char*
const* injectMonitorScriptWithWarnings(
MonitorScript& script) = 0;
1552 virtual const char*
const* injectMonitorScriptWithWarningsFilename(
MonitorScript& script,
const char *filename) = 0;
1560 virtual void deleteName(
const char * name) = 0;
1568 virtual void forceDeleteName(
const char * name) = 0;
1576 virtual void killName(
const char * name) = 0;
1581 virtual void deleteAll() = 0;
1591 virtual void injectJava(
const AP_uint8* jarbytes, AP_uint32 size) = 0;
1609 virtual const char*
const* injectJavaWithWarnings(
const AP_uint8* jarbytes, AP_uint32 size) = 0;
1625 virtual const char*
const* injectJavaWithWarningsFilename(
const AP_uint8* jarbytes, AP_uint32 size,
const char *filename) = 0;
1637 virtual void injectCDP(
const AP_uint8* cdpbytes, AP_uint32 size,
const char *filename=NULL) = 0;
1655 virtual const char*
const* injectCDPWithWarnings(
const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1671 virtual const char*
const* injectCDPWithWarningsFilename(
const AP_uint8* cdpbytes, AP_uint32 size,
const char *filename) = 0;
1679 char *errmsg =
nullptr;
1680 AP_EngineStatus *es_api = engineManagement_getStatusOpaque(
this, &errmsg);
1687 return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1755 virtual bool attachAsEventConsumerTo(
EngineManagement* target,
const char*
const* channels,
bool disconnectSlow =
false, ConnectMode mode = CONNECT_LEGACY) = 0;
1780 virtual bool attachAsEventConsumerTo(
const char* host,
int port,
const char*
const* channels,
bool disconnectSlow =
false, ConnectMode mode = CONNECT_LEGACY) = 0;
1799 virtual void detachAsEventConsumerFrom(
EngineManagement* target,
const char*
const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1818 virtual void detachAsEventConsumerFrom(
const char* host,
int port,
const char*
const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1844 virtual void flushEvents() = 0;
1872 virtual void ping() = 0;
1879 virtual bool isConnected() = 0;
1896 virtual void setReceiverConnections(
const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1902 virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1925 std::vector<std::string> channels;
1926 bool disconnectSlow;
1930 if (host == NULL || channels == NULL) {
1931 throw EngineException(
"EngineConnection cannot be created with null host or channels");
1933 if (port < 0 || port > 65535) {
1934 throw EngineException(
"EngineConnection cannot be created with invalid port value");
1937 this->host = std::string(host);
1939 this->disconnectSlow = disconnectSlow;
1940 this->connectMode = connectMode;
1942 for (
const char*
const* c = channels; *c != NULL; c++) {
1943 this->channels.push_back(std::string(*c));
1959 const char *
const * channels) {
1960 init(host, port, disconnectSlow, connectMode, channels);
1971 init(host, port,
false, EngineManagement::CONNECT_LEGACY, channels);
2004 return disconnectSlow;
2017 std::ostringstream ost;
2018 ost <<
"EngineConnection to " << obj.host <<
":" << obj.port << (obj.disconnectSlow ==
true ?
" diconnectSlow" :
"") <<
" on" <<
2019 (obj.connectMode == EngineManagement::CONNECT_PARALLEL ?
" parallel" :
"") <<
" channels [";
2021 if (!obj.channels.empty()) {
2022 std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost,
", "));
2023 ost << obj.channels.back();
2026 stream << ost.str();
2047 AP_ENGINE_CLIENT_API
void engineInit(
const char* processName =
"C++ Client");
2056 AP_ENGINE_CLIENT_API
void engineInitMessaging(
const char *processName,
bool initMessaging=
true);
2080 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngine(
const char* host,
unsigned short port,
bool disconnectSlowReceiver =
false,
const char *processName =
nullptr);
2095 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngineReceiveOnly(
const char* host,
unsigned short port,
const char *processName =
nullptr);
2109 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngineMonitorOnly(
const char* host,
unsigned short port,
const char *processName =
nullptr);
2146 AP_ENGINE_CLIENT_API
void deleteInfo(EngineInfo* info);
2156 AP_ENGINE_CLIENT_API
void deleteWarnings(
const char*
const* warnings);
2179 #endif // ENGINE_CLIENT_CPP_HPP
AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo *info)
This function allows deletion of an EngineInfo object.
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:323
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1087
const AP_char8 * getMostBackedUpInput() const
The name of the slowest context.
Definition: engine_client_cpp.hpp:655
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events...
Definition: engine_client_cpp.hpp:290
AP_float64 getUserFloatOr(const char *key, float alt)
Get a user value of type AP_float64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:763
virtual const char * getText() const =0
Retrieve the event's type and its contents as a string.
AP_uint32 getNumConsumers() const
The number of external consumers/receivers connected to receive emitted events.
Definition: engine_client_cpp.hpp:618
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...
AP_uint32 getNumInputQueuedInput() const
The number of events on the input queues of all public contexts.
Definition: engine_client_cpp.hpp:648
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:917
AP_uint32 getNumSubListeners() const
The number of sub-event-listeners that are active across all contexts.
Definition: engine_client_cpp.hpp:683
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1677
AP_int64 getUserIntOr(const char *key, int alt)
Get a user value of type AP_int64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:743
AP_uint64 getNumReceived() const
The number of events that the correlator has received from external sources since the correlator star...
Definition: engine_client_cpp.hpp:604
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1501
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:485
virtual const std::vector< std::string > & getChannels() const
Get the channels associated with this connection.
Definition: engine_client_cpp.hpp:1979
virtual const std::string & getHost() const
Get the host associated with this connection.
Definition: engine_client_cpp.hpp:1987
pair< std::string, std::string > pair_t
element type
Definition: engine_client_cpp.hpp:460
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:733
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1921
Nothing logged.
Definition: engine_client_cpp.hpp:95
AP_bool getUserBool(const char *key)
Get a user value of type AP_bool.
Definition: engine_client_cpp.hpp:773
AP_uint32 getNumJavaApplications() const
The number of Java applications and Java EPL plug-ins loaded in the correlator.
Definition: engine_client_cpp.hpp:568
Definition: sag_connectivity_threading.h:178
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:507
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1300
AP_ENGINE_CLIENT_API AP_char8 * convertFromUTF8(const AP_char8 *s)
Convert a string in UTF-8 to the local encoding, since most of the Apama API returns UTF-8...
AP_uint32 getNumContexts() const
The number of contexts in the correlator, including the main context.
Definition: engine_client_cpp.hpp:547
Information about a context returned by an engine inspection.
Definition: engine_client_cpp.hpp:1173
StatusIterator operator++(int dummy)
(postfix) increment this iterator
Definition: engine_client_cpp.hpp:476
pair_t & operator*()
Return a reference to the element pointed to.
Definition: engine_client_cpp.hpp:494
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:827
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:1958
AP_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
AP_uint32 getNumQueuedFastTrack() const
The sum of routed events on the route queues of all contexts.
Definition: engine_client_cpp.hpp:589
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:928
AP_ENGINE_CLIENT_API MonitorScript * createMonitorScript(const char *monitorString)
This function allows creation of MonitorScript objects.
StatusIterator const_iterator
Iterator type for const EngineStatus.
Definition: engine_client_cpp.hpp:535
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:250
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:838
const AP_char8 * getSlowestReceiver() const
The name of the consumer/receiver with the largest number of incoming events waiting to be processed...
Definition: engine_client_cpp.hpp:662
For backwards compatibility, single serial connection.
Definition: engine_client_cpp.hpp:1507
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1123
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1209
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:853
AP_ENGINE_CLIENT_API void setLogFile(const AP_char8 *filename, bool truncate, bool utf8=false)
Sets the file to which the client library should log information.
ConnectMode
The mode that attachAsEventConsumerTo and detachAsEventConsumerFrom operate in.
Definition: engine_client_cpp.hpp:1505
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:936
Information messages (default)
Definition: engine_client_cpp.hpp:107
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1326
virtual const char *const * getWarnings() const
Retrieve the set of warnings associated with the exception.
Definition: engine_client_cpp.hpp:78
AP_uint32 getSlowestReceiverQueueSize() const
The number of events on the slowest consumer's/receiver's queue, as identified by the name of the slo...
Definition: engine_client_cpp.hpp:669
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1353
std::ostream & operator<<(std::ostream &stream, const EngineStatus &obj)
Stream output operator for a reference.
Definition: engine_client_cpp.hpp:1006
AP_ENGINE_CLIENT_API void engineShutdown()
This function must be called once per process before the application closes down. ...
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1148
AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement *corr)
This function allows disconnection from an Engine.
const AP_char8 * getUserString(const char *key)
Get a user value of type AP_char8*.
Definition: engine_client_cpp.hpp:793
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:178
AP_uint32 getNumMonitors() const
The number of EPL monitor definitions injected into the correlator.
Definition: engine_client_cpp.hpp:554
virtual bool getDisconnectSlow() const
Get the value of disconnectSlow flag associated with this connection.
Definition: engine_client_cpp.hpp:2003
Critical messages.
Definition: engine_client_cpp.hpp:99
AP_uint32 getMostBackedUpQueueSize() const
The number of events on the slowest context's queue, as identified by the name of the slowest context...
Definition: engine_client_cpp.hpp:676
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:496
AP_uint64 getUptime() const
The time in milliseconds since the correlator was started.
Definition: engine_client_cpp.hpp:540
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items...
Definition: engine_client_cpp.hpp:699
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2037
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineMonitorOnly(const char *host, unsigned short port, const char *processName=nullptr)
Attempt to establish a monitor-only connection to an Engine listening on the named host and port...
std::string getAllStatusValuesRaw()
Get all the status values available, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:904
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:625
AP_uint32 getNumEventTypes() const
The number of event types defined within the correlator.
Definition: engine_client_cpp.hpp:582
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:93
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1245
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:812
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineReceiveOnly(const char *host, unsigned short port, const char *processName=nullptr)
Attempt to establish a receive-only connection to an Engine listening on the named host and port...
EngineStatus(const EngineStatus &other)
Copy constructor.
Definition: engine_client_cpp.hpp:924
AP_uint32 getNumQueuedInput() const
The number of executors on the input queues of all contexts.
Definition: engine_client_cpp.hpp:597
AP_uint64 getNumOutEventsSent() const
The number of events that have been delivered to external consumers/receivers.
Definition: engine_client_cpp.hpp:641
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:709
virtual EngineManagement::ConnectMode getConnectMode() const
Get the connection mode associated with this connection.
Definition: engine_client_cpp.hpp:2011
EngineConnection(const char *host, int port, const char *const *channels)
Definition: engine_client_cpp.hpp:1970
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:441
AP_uint32 getNumListeners() const
The number of listeners in all contexts.
Definition: engine_client_cpp.hpp:575
AP_uint64 getNumOutEventsCreated() const
The number of events that have been sent or emitted to channels which have at least one external cons...
Definition: engine_client_cpp.hpp:633
Warning messages.
Definition: engine_client_cpp.hpp:105
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.
bool valid()
Returns true if this is a valid iterator over status data.
Definition: engine_client_cpp.hpp:498
const AP_char8 * getUserStringOr(const char *key, const char *alt)
Get a user value of type AP_char8* or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:803
AP_ENGINE_CLIENT_API Event * createEvent(const char *eventString, const char *channelString)
This function allows creation of an Event object.
std::ostream & operator<<(std::ostream &stream, const EngineStatus *obj)
Stream output operator for a pointer.
Definition: engine_client_cpp.hpp:1043
Debugging messages.
Definition: engine_client_cpp.hpp:109
AP_float64 getUserFloat(const char *key)
Get a user value of type AP_float64.
Definition: engine_client_cpp.hpp:753
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:492
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1275
AP_ENGINE_CLIENT_API EngineManagement * connectToEngine(const char *host, unsigned short port, bool disconnectSlowReceiver=false, const char *processName=nullptr)
This function attempts to establish a connection to an Engine.
std::string getStandardStatusValuesRaw()
Get the standard status values, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:868
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:465
An EngineException is thrown by methods in this library if any problems are encountered.
Definition: engine_client_cpp.hpp:46
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:392
AP_ENGINE_CLIENT_API void setLogFD(int fd)
Sets the file descriptor to which the client library should log information.
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
A class used for the iterating through all status items.
Definition: engine_client_cpp.hpp:456
AP_ENGINE_CLIENT_API void deleteEvent(Event *ev)
This function allows deletion of an Event object.
StatusIterator iterator
Iterator type.
Definition: engine_client_cpp.hpp:533
AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier *evsup)
This function disconnects and deletes an EventSupplier object.
AP_uint32 getNumProcesses() const
The number of monitor instances, also known as sub-monitors.
Definition: engine_client_cpp.hpp:561
AP_uint64 getNumProcessed() const
The number of events processed by the correlator in all contexts.
Definition: engine_client_cpp.hpp:690
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:471
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:1995
Error messages.
Definition: engine_client_cpp.hpp:103
StatusIterator(const StatusIterator &ref)
Copy constructor.
Definition: engine_client_cpp.hpp:501
AP_uint64 getNumFastTracked() const
The number of events that have been routed across all contexts since the correlator was started...
Definition: engine_client_cpp.hpp:611
AP_bool getUserBoolOr(const char *key, bool alt)
Get a user value of type AP_bool or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:783