INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

gbxutilacfr::TrivialStatus Class Reference

A trivial implementation of the status API which does not assemble information. More...

#include <trivialstatus.h>

Inherits gbxutilacfr::Status.

List of all members.

Public Member Functions

virtual void addSubsystem (const std::string &subsystem, double maxHeartbeatIntervalSec=-1.0, SubsystemType type=SubsystemStandard)
virtual void removeSubsystem (const std::string &subsystem)
virtual std::vector< std::string > subsystems ()
 Does not keep track of subsystems, returns empty vector.
virtual SubsystemStatus subsystemStatus (const std::string &subsystem)
 Does not keep track of status, throws Exception on any query.
virtual ComponentStatus componentStatus ()
virtual void setMaxHeartbeatInterval (const std::string &subsystem, double interval)
virtual void setSubsystemType (const std::string &subsystem, SubsystemType type)
 Sets the subsystem type which describes the expected behavior of the subsystem.
virtual void setSubsystemStatus (const std::string &subsystem, SubsystemState state, SubsystemHealth health, const std::string &msg="")
virtual void initialising (const std::string &subsystem)
virtual void working (const std::string &subsystem)
virtual void finalising (const std::string &subsystem)
virtual void fault (const std::string &subsystem, const std::string &msg)
virtual void ok (const std::string &subsystem, const std::string &msg="")
virtual void warning (const std::string &subsystem, const std::string &msg)
virtual void critical (const std::string &subsystem, const std::string &msg)
virtual void heartbeat (const std::string &subsystem)
virtual void message (const std::string &subsystem, const std::string &msg)
virtual void process ()


Detailed Description

A trivial implementation of the status API which does not assemble information.

System status information is not assembled but all changes are traced to Tracer.

See also:
Status

Member Function Documentation

void gbxutilacfr::TrivialStatus::addSubsystem ( const std::string &  subsystem,
double  maxHeartbeatIntervalSec = -1.0,
SubsystemType  type = SubsystemStandard 
) [virtual]

Adds a new subsystem to the system status descriptor. This command must be called before actually modifying the subsystem status, i.e. all other status commands will raise an exception if a subsystem with that name does not already exists.

An Exception is also raised when trying to add a subsystem with an existing name.

It is possible to specify the maximum expected interval between heartbeats. See setMaxHeartbeatInterval() for details.

It is also possible to describe the expected behavior of the subsystem by specifying SubsystemType. See setSubsystemType() for details.

The initial status of the new subsystem is the same as produced by the empty constructor of SubsystemStatus.

Implements gbxutilacfr::Status.

References gbxutilacfr::Tracer::warning().

ComponentStatus gbxutilacfr::TrivialStatus::componentStatus (  )  [virtual]

Does not keep track of individual subsystems and therefore cannot determine component status. Always throws Exception.

Implements gbxutilacfr::Status.

void gbxutilacfr::TrivialStatus::critical ( const std::string &  subsystem,
const std::string &  message 
) [virtual]

Sets subsystem health to Critical. Diagnostic message is required. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemCritical.

void gbxutilacfr::TrivialStatus::fault ( const std::string &  subsystem,
const std::string &  message 
) [virtual]

Sets state of the subsystem to Fault. Diagnostic message is required. Subsystem health is automatically changed to Critical. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemCritical, and gbxutilacfr::SubsystemFault.

void gbxutilacfr::TrivialStatus::finalising ( const std::string &  subsystem  )  [virtual]

Sets state of the subsystem to Finalising. Health and message are not affected. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemFinalising.

void gbxutilacfr::TrivialStatus::heartbeat ( const std::string &  subsystem  )  [virtual]

Record heartbeat from a subsystem: let Status know the subsystem is alive without modifying its status. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

void gbxutilacfr::TrivialStatus::initialising ( const std::string &  subsystem  )  [virtual]

Sets state of the subsystem to Initialising. Health and message are not affected. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemInitialising.

void gbxutilacfr::TrivialStatus::message ( const std::string &  subsystem,
const std::string &  message 
) [virtual]

Change the human-readable message for a subsystem but keep the previous state and health information. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

void gbxutilacfr::TrivialStatus::ok ( const std::string &  subsystem,
const std::string &  message = "" 
) [virtual]

Sets subsystem health to Ok. The old message is cleared if a new one is not supplied. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemOk.

void gbxutilacfr::TrivialStatus::process (  )  [virtual]

This function must be called periodically in order for status publishing to happen and stalled susbsystems identified.

Implements gbxutilacfr::Status.

void gbxutilacfr::TrivialStatus::removeSubsystem ( const std::string &  subsystem  )  [virtual]

Removes a subsystem from the status descriptor. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::Tracer::warning().

void gbxutilacfr::TrivialStatus::setMaxHeartbeatInterval ( const std::string &  subsystem,
double  intervalSec 
) [virtual]

Sets the maximum expected interval between heartbeats (in seconds). When time since the last heartbeat exceeds the specified value, the subsystem is considered stalled. Negative interval means infinite interval. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

void gbxutilacfr::TrivialStatus::setSubsystemStatus ( const std::string &  subsystem,
SubsystemState  state,
SubsystemHealth  health,
const std::string &  message = "" 
) [virtual]

Sets the status of a subsystem (both state and health) in an atomic operation. Use this method when both state and health have changed. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

void gbxutilacfr::TrivialStatus::warning ( const std::string &  subsystem,
const std::string &  message 
) [virtual]

Sets subsystem health to Warning. Diagnostic message is required. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemWarning.

void gbxutilacfr::TrivialStatus::working ( const std::string &  subsystem  )  [virtual]

Sets state of the subsystem to Working. Health and message are not affected. Throws Exception if the subsystem does not exist.

Implements gbxutilacfr::Status.

References gbxutilacfr::SubsystemWorking.


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

Generated for GearBox by  doxygen 1.4.5