Package org.opennms.netmgt.config
Class KSC_PerformanceReportFactory
- java.lang.Object
-
- org.opennms.netmgt.config.KSC_PerformanceReportFactory
-
public class KSC_PerformanceReportFactory extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static 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 configurationstatic 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_PerformanceReportFactoryReport
getReportByIndex(int index)
getReportByIndexMap<Integer,String>
getReportList()
getReportListMap<Integer,Report>
getReportMap()
getReportMapstatic void
init()
Init routine.void
reload()
Parses the KSC_PerformanceReport.xmlvoid
saveCurrent()
Saves the KSC_PerformanceReport.xml data.static void
setConfigFile(File configFile)
void
setReport(int index, Report report)
-
-
-
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
Init routine. Must be called before calling getInstance() to instantiate *- Throws:
IOException
- if any.FileNotFoundException
- 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
Parses the KSC_PerformanceReport.xml- Throws:
IOException
- if any.FileNotFoundException
- if any.
-
setConfigFile
public static void setConfigFile(File configFile)
-
saveCurrent
public void saveCurrent() throws IOException, FileNotFoundException
Saves the KSC_PerformanceReport.xml data.- Throws:
IOException
- if any.FileNotFoundException
- if any.
-
getReportByIndex
public Report getReportByIndex(int index)
getReportByIndex
- Parameters:
index
- a int.- Returns:
- a
Report
object.
-
deleteReportAndSave
public void deleteReportAndSave(int index) throws ArrayIndexOutOfBoundsException, IOException, FileNotFoundException
Deletes the indexed report and updates file configuration- Parameters:
index
- a int.- Throws:
ArrayIndexOutOfBoundsException
- if any.IOException
- if any.FileNotFoundException
- if any.
-
addReport
public void addReport(Report report)
-
setReport
public void setReport(int index, Report report)
-
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
- aString
object.begin_time
- aCalendar
object.end_time
- aCalendar
object.- Throws:
IllegalArgumentException
- if any.
-
-