alma::acs::logtools::monitor::LogDetailsDispatcher Class Reference

Inheritance diagram for alma::acs::logtools::monitor::LogDetailsDispatcher:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logtools::monitor::LogDetailsDispatcher:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LogDetailsDispatcher ()
void errorReceived (String xml)
void xmlEntryReceived (String xmlLogString)
void acsLogConnConnecting ()
void acsLogConnDisconnected ()
void acsLogConnEstablished ()
void acsLogConnLost ()
void acsLogConnSuspended ()
void acsLogsDelay ()
void reportStatus (String status)
void logEntryReceived (ILogEntry logEntry)
void addNumsListener (LogNumbersListener listener)
void removeNumsListener (LogNumbersListener listener)
void run ()
void close ()

Static Public Attributes

static final int NUMBER_LISTENERS_INTERVAL = 10

Private Attributes

final int[] receivedLogNums = new int[LogTypeHelper.values().length]
final long[] totalLogs = new long[LogTypeHelper.values().length]
int longestLogSize = Integer.MIN_VALUE
int shortestLogSize = Integer.MAX_VALUE
int errors = 0
final TotalStatsData totData = new TotalStatsData()
final LCEngine engine
final Vector< LogNumbersListenernumListeners = new Vector<LogNumbersListener>()
final Thread notifierThread
boolean terminateThread = false

Detailed Description

LogDetailsDispatcher reads logs from the logging NC and dispatch them to the registered listeners.

There are 2 types of listeners to perform different kind of statistics:

Author:
acaproni
Since:
ACS 8.1.0

Constructor & Destructor Documentation

alma::acs::logtools::monitor::LogDetailsDispatcher::LogDetailsDispatcher (  )  [inline]

Member Function Documentation

void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnConnecting (  )  [inline]

Notify that an attempt to connect to ACS NC is in progress

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnDisconnected (  )  [inline]

Notify that the connection with ACS NC has been disconnected It can happen as a consequence of an error as well as as consequence of a request

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnEstablished (  )  [inline]

Notify that the connection with ACS NC has been established

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnLost (  )  [inline]

Notify that the connection with ACS NC has been lost (it means an error or something abnormal).

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogConnSuspended (  )  [inline]

Notify that the service is supended (i.e. it is connected to the NC and receiving logs but the logs are discarded instead of being sent to the listeners) Note: the suspension of the service is not a malfunctioning but a status requested by the user

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::acsLogsDelay (  )  [inline]

Notify that for some internal reason the service is not able to follow the flow of the incoming logs and is queueing the messages to be inserted later, when flow will decrease and enough CPU time is availbale

This method is not executed each time a log is queued but once when the situation begins. When the temporary problem has been fixed, the status will revert to connected

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::addNumsListener ( LogNumbersListener  listener  )  [inline]

Add a LogNumbersListener listener to be notified about incoming logs statistics

Parameters:
listener The listener to add

References numListeners.

Referenced by alma::acs::logtools::monitor::LogMonitor::LogMonitor().

void alma::acs::logtools::monitor::LogDetailsDispatcher::close (  )  [inline]
void alma::acs::logtools::monitor::LogDetailsDispatcher::errorReceived ( String  xml  )  [inline]

The method is executed when an error happened building a log from a string.

The parameter is the string that caused the error and it can be

  • the XML that was not possible to parse
  • a cache string if the binary format of logs is in use

The cache string is a string used in the cache whose format might change with different implementation of of the cache.

Parameters:
xml That string that caused the error

Implements com::cosylab::logging::engine::ACS::ACSRemoteErrorListener.

References errors, totData, and alma::acs::logtools::monitor::TotalStatsData::updateErrors().

void alma::acs::logtools::monitor::LogDetailsDispatcher::logEntryReceived ( ILogEntry  logEntry  )  [inline]

The method is executed when a new log arrives from the NC

Parameters:
logEntry The new log just read from the NC

Implements com::cosylab::logging::engine::ACS::ACSRemoteLogListener.

References com::cosylab::logging::engine::log::ILogEntry::getType(), receivedLogNums, totalLogs, totData, and alma::acs::logtools::monitor::TotalStatsData::updateTotalLogs().

void alma::acs::logtools::monitor::LogDetailsDispatcher::removeNumsListener ( LogNumbersListener  listener  )  [inline]

Remove a LogNumbersListener listener.

Parameters:
listener The listener to remove

References numListeners.

Referenced by alma::acs::logtools::monitor::LogMonitor::close().

void alma::acs::logtools::monitor::LogDetailsDispatcher::reportStatus ( String  status  )  [inline]

Send a report string with the current status of the connection

Parameters:
status The status string

Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.

void alma::acs::logtools::monitor::LogDetailsDispatcher::run (  )  [inline]

The thread notifying listeners about statistics

References NUMBER_LISTENERS_INTERVAL, numListeners, receivedLogNums, terminateThread, and totData.

void alma::acs::logtools::monitor::LogDetailsDispatcher::xmlEntryReceived ( String  xmlLogString  )  [inline]

The method is executed when a new XML string arrives from the NC

Parameters:
xmlLogString The new XML string just read from the NC

Implements com::cosylab::logging::engine::ACS::ACSRemoteRawLogListener.

References longestLogSize, shortestLogSize, totData, and alma::acs::logtools::monitor::TotalStatsData::updateSizes().


Member Data Documentation

The engine to receive logs from the logging NC

Referenced by close(), and LogDetailsDispatcher().

Number of errors parsing logs since the begging of the execution

Referenced by errorReceived().

The longest XML log received since the begging of the execution

Referenced by xmlEntryReceived().

The thread to notify listeners about statistics

Referenced by close(), and LogDetailsDispatcher().

The interval of time (seconds) to notify listener of numbers

See also:
LogNumbersListener

Referenced by run().

The listeners of numbers

Referenced by addNumsListener(), removeNumsListener(), and run().

final int [] alma::acs::logtools::monitor::LogDetailsDispatcher::receivedLogNums = new int[LogTypeHelper.values().length] [private]

The number of each received log in the NUMBER_LISTENERS_INTERVAL time interval.
One entry for each log type.

Referenced by logEntryReceived(), and run().

The shortest XML log received since the begging of the execution

Referenced by xmlEntryReceived().

Signal the thread to terminate

Referenced by close(), and run().

final long [] alma::acs::logtools::monitor::LogDetailsDispatcher::totalLogs = new long[LogTypeHelper.values().length] [private]

The total number of logs received since the begging of the execution
One entry for each log type.

Referenced by logEntryReceived().

The total numbers read since when the application started

Referenced by errorReceived(), logEntryReceived(), run(), and xmlEntryReceived().


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

Generated by  doxygen 1.6.2