Class KSC_PerformanceReportFactory


  • public class KSC_PerformanceReportFactory
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] TIMESPAN_OPTIONS
      The array of values that may be used in the timespan declaration of a graph
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addReport​(Report report)  
      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)
      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
      java.util.Map<java.lang.Integer,​java.lang.String> getReportList()
      getReportList
      java.util.Map<java.lang.Integer,​Report> getReportMap()
      getReportMap
      static void init()
      Init routine.
      void reload()
      Parses the KSC_PerformanceReport.xml
      void saveCurrent()
      Saves the KSC_PerformanceReport.xml data.
      static void setConfigFile​(java.io.File configFile)  
      void setReport​(int index, Report report)  
      • 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 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
        Init routine. Must be called before calling getInstance() to instantiate *
        Throws:
        java.io.IOException - if any.
        java.io.FileNotFoundException - if any.
      • 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 - if any.
      • reload

        public void reload()
                    throws java.io.IOException,
                           java.io.FileNotFoundException
        Parses the KSC_PerformanceReport.xml
        Throws:
        java.io.IOException - if any.
        java.io.FileNotFoundException - if any.
      • setConfigFile

        public static void setConfigFile​(java.io.File configFile)
      • saveCurrent

        public void saveCurrent()
                         throws java.io.IOException,
                                java.io.FileNotFoundException
        Saves the KSC_PerformanceReport.xml data.
        Throws:
        java.io.IOException - if any.
        java.io.FileNotFoundException - if any.
      • getReportByIndex

        public Report getReportByIndex​(int index)

        getReportByIndex

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

        public java.util.Map<java.lang.Integer,​java.lang.String> getReportList()

        getReportList

        Returns:
        a Map object.
      • getReportMap

        public java.util.Map<java.lang.Integer,​Report> getReportMap()

        getReportMap

        Returns:
        a Map object.
      • deleteReportAndSave

        public void deleteReportAndSave​(int index)
                                 throws java.lang.ArrayIndexOutOfBoundsException,
                                        java.io.IOException,
                                        java.io.FileNotFoundException
        Deletes the indexed report and updates file configuration
        Parameters:
        index - a int.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if any.
        java.io.IOException - if any.
        java.io.FileNotFoundException - if any.
      • addReport

        public void addReport​(Report report)
      • setReport

        public void setReport​(int index,
                              Report report)
      • getBeginEndTime

        public static void getBeginEndTime​(java.lang.String interval,
                                           java.util.Calendar begin_time,
                                           java.util.Calendar end_time)
                                    throws java.lang.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:
        java.lang.IllegalArgumentException - if any.