org.opennms.netmgt.config
Class KSC_PerformanceReportFactory

java.lang.Object
  extended by org.opennms.netmgt.config.KSC_PerformanceReportFactory

public class KSC_PerformanceReportFactory
extends Object

KSC_PerformanceReportFactory class.

Version:
$Id: $
Author:
ranger

Field Summary
static String[] TIMESPAN_OPTIONS
          The array of values that may be used in the timespan declaration of a graph
 
Method Summary
 void deleteReportAndSave(int index)
          Deletes the indexed report and updates file configuration
static void getBeginEndTime(String interval, Calendar begin_time, Calendar end_time)
          This method requires begin time and end time to be set to the current time prior to call.
static KSC_PerformanceReportFactory getInstance()
          Singleton static call to get the only instance that should exist for the KSC_PerformanceReportFactory
 Report getReportByIndex(int index)
          getReportByIndex
 Map<Integer,String> getReportList()
          getReportList
static void init()
          Init routine.
 void reload()
          Parses the KSC_PerformanceReport.xml via the Castor classes.
 void saveCurrent()
          Saves the KSC_PerformanceReport.xml data.
 void sortByTitle()
          Sorts the Reports List by their title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMESPAN_OPTIONS

public static final String[] TIMESPAN_OPTIONS
The array of values that may be used in the timespan declaration of a graph

Method Detail

init

public static void init()
                 throws IOException,
                        FileNotFoundException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Init routine. Must be called before calling getInstance() to instantiate *

Throws:
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

getInstance

public static KSC_PerformanceReportFactory getInstance()
                                                throws IllegalStateException
Singleton static call to get the only instance that should exist for the KSC_PerformanceReportFactory

Returns:
the single KSC_PerformanceReportFactory instance
Throws:
IllegalStateException - if any.

reload

public void reload()
            throws IOException,
                   FileNotFoundException,
                   org.exolab.castor.xml.MarshalException,
                   org.exolab.castor.xml.ValidationException
Parses the KSC_PerformanceReport.xml via the Castor classes.

Throws:
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

saveCurrent

public void saveCurrent()
                 throws IOException,
                        FileNotFoundException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Saves the KSC_PerformanceReport.xml data.

Throws:
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

sortByTitle

public void sortByTitle()
Sorts the Reports List by their title.


getReportByIndex

public Report getReportByIndex(int index)

getReportByIndex

Parameters:
index - a int.
Returns:
a Report object.

getReportList

public Map<Integer,String> getReportList()

getReportList

Returns:
a Map object.

deleteReportAndSave

public void deleteReportAndSave(int index)
                         throws ArrayIndexOutOfBoundsException,
                                IOException,
                                FileNotFoundException,
                                org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException
Deletes the indexed report and updates file configuration

Parameters:
index - a int.
Throws:
ArrayIndexOutOfBoundsException - if any.
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

getBeginEndTime

public static void getBeginEndTime(String interval,
                                   Calendar begin_time,
                                   Calendar end_time)
                            throws IllegalArgumentException
This method requires begin time and end time to be set to the current time prior to call. The start and stop times are relative to this time. Init values as follows: begin_time = Calendar.getInstance(); end_time = Calendar.getInstance();

Parameters:
interval - a String object.
begin_time - a Calendar object.
end_time - a Calendar object.
Throws:
IllegalArgumentException - if any.


Copyright © 2011. All Rights Reserved.