Apama  10.7.2.2
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 Types

typedef std::unique_ptr< StatusItemitem_ptr
 Unique pointer to a StatusItem. More...
 

Public Member Functions

item_ptr createStatusItem (const std::string &key, const std::string &initialValue)
 Creates a StatusItem instance that can be used to report status for a given key. More...
 
item_ptr createStatusItem (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 thread-safe.

Since
10.0

Member Typedef Documentation

◆ item_ptr

Unique pointer to a StatusItem.

Member Function Documentation

◆ createStatusItem() [1/2]

item_ptr 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+".messagesTowardsHost". The key will have any leading or traling whitespace stripped. Keys may not be empty.
initialValuethe initial value for this item.
Returns
The StatusItem instance that can be used to update the status value as needed; caller tasks ownership.

◆ createStatusItem() [2/2]

item_ptr 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+".messagesTowardsHost". The key will have any leading or traling whitespace stripped. Keys may not be empty.
initialValuethe initial value for this item.
Returns
The StatusItem instance that can be used to update the status value as needed; caller tasks ownership.

◆ setStatus()

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. The keys will have any leading or traling whitespace stripped. Keys may not be empty.

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.

◆ STATUS_FAILED()

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.

◆ STATUS_ONLINE()

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.

◆ STATUS_STARTING()

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: