org.hardtokenmgmt.admin.model
Class AnalyzeHelper

java.lang.Object
  extended by org.hardtokenmgmt.admin.model.AnalyzeHelper

public class AnalyzeHelper
extends java.lang.Object

Contains help methods used when analyzing the status of the server.

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

Constructor Summary
AnalyzeHelper()
           
 
Method Summary
static int calcUsedInPercent(long totalspace, long freespace)
           
static java.lang.String[] getHostnames(OverallStatus overallStatus)
          Parses all the hostnames from a overall status object.
static int getThresholdAsInt(IStatusAnalyzer statusAnalyser, java.lang.String threshold)
           
static java.lang.String getThresholdSetting(IStatusAnalyzer statusAnalyser, boolean globalsetting)
          Method that determines the property name for the given object in the global.settings, alternatively administrator settings.
static boolean isThresholdValueBoolean(IStatusAnalyzer statusAnalyser, java.lang.String thresholdValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalyzeHelper

public AnalyzeHelper()
Method Detail

getThresholdSetting

public static java.lang.String getThresholdSetting(IStatusAnalyzer statusAnalyser,
                                                   boolean globalsetting)
Method that determines the property name for the given object in the global.settings, alternatively administrator settings.

Parameters:
statusAnalyser - the object to fetch threshold setting for
globalsetting - if the setting should be fetched from the global.properties or the administrator settings.
Returns:
the property key or null if no property key is valid for given object.

getThresholdAsInt

public static int getThresholdAsInt(IStatusAnalyzer statusAnalyser,
                                    java.lang.String threshold)

calcUsedInPercent

public static int calcUsedInPercent(long totalspace,
                                    long freespace)

isThresholdValueBoolean

public static boolean isThresholdValueBoolean(IStatusAnalyzer statusAnalyser,
                                              java.lang.String thresholdValue)

getHostnames

public static java.lang.String[] getHostnames(OverallStatus overallStatus)
Parses all the hostnames from a overall status object.

Parameters:
overallStatus - the overall statuses
Returns:
all hostnames extracted from the overall status object.