org.hardtokenmgmt.admin.model
Class BaseStatusAnalyzer

java.lang.Object
  extended by org.hardtokenmgmt.admin.model.BaseStatusAnalyzer
All Implemented Interfaces:
IStatusAnalyzer
Direct Known Subclasses:
CAStatusAnalyzer, GeneralStatusAnalyzer, HostStatusAnalyzer, MemStatusAnalyzer, PartitionStatusAnalyzer, SysCheckStatusAnalyzer

public abstract class BaseStatusAnalyzer
extends java.lang.Object
implements IStatusAnalyzer

Base class of all status analyzers containing all the in common methods.

Version:
$Id$
Author:
Philip Vendil 22 feb 2009

Field Summary
protected  java.lang.Integer alarmPriority
           
protected  java.lang.String hostname
           
protected  java.lang.String status
           
protected  java.lang.String statusMessage
           
protected  java.lang.String threshold
           
 
Constructor Summary
protected BaseStatusAnalyzer(java.lang.String hostname)
           
 
Method Summary
protected abstract  void analyze()
          Method that should analyze the objects data and set the status, statusMessage and alarmPriority variables.
 int getAlarmPriority()
          Alarm priority determines which event that should have the highest priority when something is wrong.
 java.lang.String getHostname()
           
 java.lang.String getStatus()
          The status of the current partition.
 java.lang.String getStatusMessage()
           
 java.lang.String getThreshold()
           
 void resetAnalyzis()
          Instructs the analyzer that it's time to redo it's analysing the next time the status is requested.
 void resetThreshold()
          Reset the the configured threshold to the default value.
 void setThreshold(java.lang.String threshold)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hostname

protected java.lang.String hostname

status

protected java.lang.String status

statusMessage

protected java.lang.String statusMessage

threshold

protected java.lang.String threshold

alarmPriority

protected java.lang.Integer alarmPriority
Constructor Detail

BaseStatusAnalyzer

protected BaseStatusAnalyzer(java.lang.String hostname)
Method Detail

getHostname

public java.lang.String getHostname()
Specified by:
getHostname in interface IStatusAnalyzer
Returns:
the hostname the current analyzer belongs to.
See Also:
IStatusAnalyzer.getHostname()

getStatus

public java.lang.String getStatus()
Description copied from interface: IStatusAnalyzer
The status of the current partition.

Specified by:
getStatus in interface IStatusAnalyzer
Returns:
one of Constants.STATUS_ constants
See Also:
IStatusAnalyzer.getStatus()

getStatusMessage

public java.lang.String getStatusMessage()
Specified by:
getStatusMessage in interface IStatusAnalyzer
See Also:
IStatusAnalyzer.getStatusMessage()

getThreshold

public java.lang.String getThreshold()
Specified by:
getThreshold in interface IStatusAnalyzer
Returns:
the threshold
See Also:
IStatusAnalyzer.getThreshold()

setThreshold

public void setThreshold(java.lang.String threshold)
Specified by:
setThreshold in interface IStatusAnalyzer
Parameters:
threshold - the threshold to set
See Also:
IStatusAnalyzer.setThreshold(java.lang.String)

getAlarmPriority

public int getAlarmPriority()
Description copied from interface: IStatusAnalyzer
Alarm priority determines which event that should have the highest priority when something is wrong. I.e shown first in overall status bar. Should return a value between 0 and 299 where 0 is the lowest
  • 0 - 99 is information level
  • 100 - 199 is warning level
  • 200 - 299 is error level

    Specified by:
    getAlarmPriority in interface IStatusAnalyzer
    See Also:
    IStatusAnalyzer.getAlarmPriority()

  • analyze

    protected abstract void analyze()
    Method that should analyze the objects data and set the status, statusMessage and alarmPriority variables.


    resetThreshold

    public void resetThreshold()
    Description copied from interface: IStatusAnalyzer
    Reset the the configured threshold to the default value.

    Specified by:
    resetThreshold in interface IStatusAnalyzer

    resetAnalyzis

    public void resetAnalyzis()
    Description copied from interface: IStatusAnalyzer
    Instructs the analyzer that it's time to redo it's analysing the next time the status is requested.

    Specified by:
    resetAnalyzis in interface IStatusAnalyzer
    See Also:
    IStatusAnalyzer.resetAnalyzis()