Apama  10.1.0.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com::softwareag::connectivity::StatusReporter Class Reference

A class allowing a plug-in to report status values to the host. More...

#include <sag_connectivity_plugins.hpp>

Classes

class  StatusItem
 A class that can be used to efficiently update the value associated with a single status key. More...
 

Public Member Functions

std::unique_ptr< StatusItemcreateStatusItem (const std::string &key, const std::string &initialValue)
 Creates a StatusItem instance that can be used to report status for a given key. More...
 
std::unique_ptr< StatusItemcreateStatusItem (const std::string &key, int64_t initialValue)
 Creates a StatusItem instance that can be used to report status for a given key, using an integral initial value. More...
 
void setStatus (const map_t &statusmap)
 Set multiple related string status values at the same time (atomically). More...
 

Static Public Member Functions

static const char * STATUS_ONLINE ()
 Returns a constant that should be used as the status value when a component is online, operational, connected, and ready to handles messages. More...
 
static const char * STATUS_STARTING ()
 Returns a constant that should be used as the status value when a component is still starting, i.e. More...
 
static const char * STATUS_FAILED ()
 Returns a constant that should be used as the status value when a component is not currently operational due to an error condition. More...
 

Detailed Description

A class allowing a plug-in to report status values to the host.

Ensure that no methods are called on this object after the plug-in has been shutdown.

This object is NOT thread-safe, so please use additional locking if it is necessary to call its methods from multiple threads. However typically this will not be required, as usually all status items are created in a plug-in's constructor and each would be accessed subsequently from just one thread (e.g. hostwards status items on a thread handling hostwards messages and transportwards status items on a thread handling transportwards items).

Since
10.0

Member Function Documentation

std::unique_ptr<StatusItem> com::softwareag::connectivity::StatusReporter::createStatusItem ( const std::string &  key,
const std::string &  initialValue 
)
inline

Creates a StatusItem instance that can be used to report status for a given key.

It is an error to call this more than once for a given key.

The returned object must be deleted as part of plug-in destruction; the typical pattern for this is to store the unique_ptr as a member of the plug-in.

Parameters
keya unique key that will identify this status item to the host. Typically this will include the chainId and plugin name, for example chainId+"."+pluginName+".messagesSentTowardsHost".
initialValuethe initial value for this item.
Returns
The StatusItem instance that can be used to update the status value as needed; caller tasks ownership.
std::unique_ptr<StatusItem> com::softwareag::connectivity::StatusReporter::createStatusItem ( const std::string &  key,
int64_t  initialValue 
)
inline

Creates a StatusItem instance that can be used to report status for a given key, using an integral initial value.

It is an error to call this more than once for a given key.

The returned object must be deleted as part of plug-in destruction; the typical pattern for this is to store the unique_ptr as a member of the plug-in.

Parameters
keya unique key that will identify this status item to the host. Typically this will include the chainId and plugin name, for example chainId+"."+pluginName+".messagesSentTowardsHost".
initialValuethe initial value for this item.
Returns
The StatusItem instance that can be used to update the status value as needed; caller tasks ownership.
void com::softwareag::connectivity::StatusReporter::setStatus ( const map_t statusmap)
inline

Set multiple related string status values at the same time (atomically).

The more efficient setStatus(const std::string &key, const std::string &value) should be used instead unless there is a need to change multiple values atomically.

Any status keys set using this method will be automatically removed when the plug-in instance is shutdown.

Parameters
statusmapA map containing data_t string (char*) keys and data_t string (char*) values. Empty data_t() values can be used to indicate that an existing item should be cleared.
static const char* com::softwareag::connectivity::StatusReporter::STATUS_FAILED ( )
inlinestatic

Returns a constant that should be used as the status value when a component is not currently operational due to an error condition.

static const char* com::softwareag::connectivity::StatusReporter::STATUS_ONLINE ( )
inlinestatic

Returns a constant that should be used as the status value when a component is online, operational, connected, and ready to handles messages.

static const char* com::softwareag::connectivity::StatusReporter::STATUS_STARTING ( )
inlinestatic

Returns a constant that should be used as the status value when a component is still starting, i.e.

not yet online, but not failed.


The documentation for this class was generated from the following file: