org.opennms.netmgt.config
Class KSC_PerformanceReportFactory

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

public class KSC_PerformanceReportFactory
extends java.lang.Object


Field Summary
 java.lang.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(java.lang.String interval, java.util.Calendar begin_time, java.util.Calendar end_time)
           
static org.opennms.netmgt.config.kscReports.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 org.opennms.netmgt.config.kscReports.Graph getNewGraph()
          Create a new blank graph & initialize it
static org.opennms.netmgt.config.kscReports.Report getNewReport()
          Create a new blank report & initialize it
 org.opennms.netmgt.config.kscReports.Graph getWorkingGraph()
          Returns the working graph object
 int getWorkingGraphIndex()
          Returns the working graph index
 org.opennms.netmgt.config.kscReports.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(org.opennms.netmgt.config.kscReports.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

timespan_options

public final java.lang.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 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 org.opennms.netmgt.config.kscReports.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 org.opennms.netmgt.config.kscReports.Report getWorkingReport()
Returns the working report object


loadWorkingReport

public void loadWorkingReport(org.opennms.netmgt.config.kscReports.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 org.opennms.netmgt.config.kscReports.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 org.opennms.netmgt.config.kscReports.Graph getWorkingGraph()
Returns the working graph object


getWorkingGraphIndex

public int getWorkingGraphIndex()
Returns the working graph index


getNewGraph

public static org.opennms.netmgt.config.kscReports.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


Copyright © 2007. All Rights Reserved.