OpenNMS API 1.2.3

org.opennms.netmgt.config
Class KSC_PerformanceReportFactory

java.lang.Object
  extended byorg.opennms.netmgt.config.KSC_PerformanceReportFactory

public class KSC_PerformanceReportFactory
extends java.lang.Object


Field Summary
private static java.io.InputStream configIn
          The input stream for the config file
private  int graph_index
           
private static boolean initialized
          Boolean indicating if the init() method has been called
private static KSC_PerformanceReportFactory instance
          The static singleton instance object
private static java.io.File KSC_PerformanceReportFile
          File name of the KSC_PerformanceReport.xml
private static ReportsList m_config
          An instance of the ReportsList configuration
private static long m_lastModified
          Last Modified timestamp
 java.lang.String[] timespan_options
          The array of values that may be used in the timespan declaration of a graph
private  Graph working_graph
          This is a working graph that may be used to hold a report graph & its index temporarily while moving between jsp's
private  int working_index
           
private  Report working_report
          This is a working report that may be used to hold a report & its index temporarily while moving between jsp's
 
Constructor Summary
private KSC_PerformanceReportFactory()
          Empty Private Constructor.
 
Method Summary
 void deleteReportAndSave(int index)
          Deletes the indexed report and updates file configuration
static void getBeginEndTime(java.lang.String interval, java.util.Calendar begin_time, java.util.Calendar end_time)
           
static ReportsList getConfiguration()
          Returns the KSC_PerformanceReport configuration object
static KSC_PerformanceReportFactory getInstance()
          Singleton static call to get the only instance that should exist for the KSC_PerformanceReportFactory
static Graph getNewGraph()
          Create a new blank graph & initialize it
static Report getNewReport()
          Create a new blank report & initialize it
 Graph getWorkingGraph()
          Returns the working graph object
 int getWorkingGraphIndex()
          Returns the working graph index
 Report getWorkingReport()
          Returns the working report object
 int getWorkingReportIndex()
          Returns the working report index
static void init()
          Init routine.
 void loadWorkingGraph(int index)
          Loads the indexed graph from the working report into the working graph object or creates a new one if the object does not exist
 void loadWorkingReport(int index)
          Loads the indexed report into the working report object or creates a new one if the object does not exist
 void loadWorkingReport(Report source_report)
          Loads the source report into the working report object
static void reload()
          Parses the KSC_PerformanceReport.xml via the Castor classes
 void saveCurrent()
          Saves the KSC_PerformanceReport.xml data
 void setWorkingReportIndex(int v_index)
          Sets the working report index
 void sortByTitle()
          Sorts the Reports List by their title.
 void unloadWorkingGraph(int requested_graphnum)
          Unloads the working graph into the working report list at the requested graph number.
 void unloadWorkingReport()
          Unloads the working report into the indexed report list at the point identified by working_index (this should have been set when the working report was loaded), then create a new blank working report
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static KSC_PerformanceReportFactory instance
The static singleton instance object


KSC_PerformanceReportFile

private static java.io.File KSC_PerformanceReportFile
File name of the KSC_PerformanceReport.xml


m_config

private static ReportsList m_config
An instance of the ReportsList configuration


configIn

private static java.io.InputStream configIn
The input stream for the config file


initialized

private static boolean initialized
Boolean indicating if the init() method has been called


m_lastModified

private static long m_lastModified
Last Modified timestamp


timespan_options

public final java.lang.String[] timespan_options
The array of values that may be used in the timespan declaration of a graph


working_report

private Report working_report
This is a working report that may be used to hold a report & its index temporarily while moving between jsp's


working_index

private int working_index

working_graph

private Graph working_graph
This is a working graph that may be used to hold a report graph & its index temporarily while moving between jsp's


graph_index

private int graph_index
Constructor Detail

KSC_PerformanceReportFactory

private KSC_PerformanceReportFactory()
Empty Private Constructor. Cannot be instantiated outside itself.

Method Detail

init

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

Throws:
java.io.IOException
java.io.FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getInstance

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

Returns:
the single KSC_PerformanceReportFactory instance
Throws:
java.lang.IllegalStateException

reload

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

Throws:
java.io.IOException
java.io.FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

saveCurrent

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

Throws:
java.io.IOException
java.io.FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

sortByTitle

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


getConfiguration

public static ReportsList getConfiguration()
Returns the KSC_PerformanceReport configuration object


deleteReportAndSave

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

Throws:
java.lang.ArrayIndexOutOfBoundsException
java.io.IOException
java.io.FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getWorkingReport

public Report getWorkingReport()
Returns the working report object


loadWorkingReport

public void loadWorkingReport(Report source_report)
                       throws org.exolab.castor.xml.MarshalException,
                              org.exolab.castor.xml.ValidationException
Loads the source report into the working report object

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

loadWorkingReport

public void loadWorkingReport(int index)
                       throws org.exolab.castor.xml.MarshalException,
                              org.exolab.castor.xml.ValidationException
Loads the indexed report into the working report object or creates a new one if the object does not exist

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

unloadWorkingReport

public void unloadWorkingReport()
                         throws org.exolab.castor.xml.MarshalException,
                                org.exolab.castor.xml.ValidationException
Unloads the working report into the indexed report list at the point identified by working_index (this should have been set when the working report was loaded), then create a new blank working report

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getNewReport

public static Report getNewReport()
Create a new blank report & initialize it


getWorkingReportIndex

public int getWorkingReportIndex()
Returns the working report index


setWorkingReportIndex

public void setWorkingReportIndex(int v_index)
Sets the working report index


getWorkingGraph

public Graph getWorkingGraph()
Returns the working graph object


getWorkingGraphIndex

public int getWorkingGraphIndex()
Returns the working graph index


getNewGraph

public static Graph getNewGraph()
Create a new blank graph & initialize it


loadWorkingGraph

public void loadWorkingGraph(int index)
                      throws org.exolab.castor.xml.MarshalException,
                             org.exolab.castor.xml.ValidationException
Loads the indexed graph from the working report into the working graph object or creates a new one if the object does not exist

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

unloadWorkingGraph

public void unloadWorkingGraph(int requested_graphnum)
                        throws org.exolab.castor.xml.MarshalException,
                               org.exolab.castor.xml.ValidationException
Unloads the working graph into the working report list at the requested graph number. If the graph was modified from an existing graph, then the old one is replaced. A new blank working graph is then created

Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getBeginEndTime

public static void getBeginEndTime(java.lang.String interval,
                                   java.util.Calendar begin_time,
                                   java.util.Calendar end_time)
                            throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.