Class AvailabilityCalculatorImpl
- java.lang.Object
-
- org.opennms.reporting.availability.AvailabilityCalculatorImpl
-
- All Implemented Interfaces:
AvailabilityCalculator
public class AvailabilityCalculatorImpl extends Object implements AvailabilityCalculator
AvailabilityCalculator is a partial refactoring of AvailabilityReport that removes the responsibility for rendering the report. This can now be found in the ReportRenderer implementations HTMLReportRenderer and PDFReportRenderer (for batch-mode report rendering) and in the availability report viewer service and its associated views. Depending on the type of reportStore configured, Availability Calculator will marshal the availability report to either a predefined file on disk, or a file on disk with attendant report locator table entry. This table entry can be used later to retrieve the ready run report. The object needs a string representation for the month in the year. This is unnecessarily complex for the information that it conveys and should be changed. TODO: This is still not locale independent.- Author:
- Jonathan Sartin
-
-
Constructor Summary
Constructors Constructor Description AvailabilityCalculatorImpl()
Constructor for AvailabilityCalculatorImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculate()
calculateString
getAuthor()
getAuthorString
getBaseDir()
getBaseDirString
getCategoryName()
getCategoryNameString
getLogoURL()
getLogoURLString
getMonthFormat()
getMonthFormatString
getOutputFileName()
getOutputFileNameDate
getPeriodEndDate()
getPeriodEndDateReport
getReport()
getReportString
getReportFormat()
getReportFormatvoid
marshal(File outputFile)
marshalvoid
setAuthor(String author)
setAuthorvoid
setAvailabilityData(AvailabilityData availabilityData)
setAvailabilityDatavoid
setBaseDir(String baseDir)
setBaseDirvoid
setCategoryName(String categoryName)
setCategoryNamevoid
setLogoURL(String logoURL)
setLogoURLvoid
setMonthFormat(String monthFormat)
setMonthFormatvoid
setOutputFileName(String outputFileName)
setOutputFileNamevoid
setPeriodEndDate(Date periodEndDate)
setPeriodEndDatevoid
setReportFormat(String reportFormat)
setReportFormatvoid
setReportStoreService(ReportStoreService reportStoreService)
setReportStoreServiceString
writeLocateableXML(String id)
writeLocateableXMLString
writeXML()
writeXMLvoid
writeXML(OutputStream outputStream)
writeXMLvoid
writeXML(String outputFileName)
writeXML
-
-
-
Field Detail
-
months
public static String[] months
-
-
Method Detail
-
calculate
public void calculate() throws AvailabilityCalculationException
calculate
- Specified by:
calculate
in interfaceAvailabilityCalculator
- Throws:
AvailabilityCalculationException
- if any.
-
writeXML
public String writeXML() throws AvailabilityCalculationException
writeXML
- Specified by:
writeXML
in interfaceAvailabilityCalculator
- Returns:
- a
String
object. - Throws:
AvailabilityCalculationException
- if any.
-
writeXML
public void writeXML(String outputFileName) throws AvailabilityCalculationException
writeXML
- Specified by:
writeXML
in interfaceAvailabilityCalculator
- Parameters:
outputFileName
- aString
object.- Throws:
AvailabilityCalculationException
- if any.
-
writeLocateableXML
public String writeLocateableXML(String id) throws AvailabilityCalculationException
writeLocateableXML
- Specified by:
writeLocateableXML
in interfaceAvailabilityCalculator
- Parameters:
id
- aString
object.- Returns:
- a
String
object. - Throws:
AvailabilityCalculationException
- if any.
-
writeXML
public void writeXML(OutputStream outputStream) throws AvailabilityCalculationException
writeXML
- Specified by:
writeXML
in interfaceAvailabilityCalculator
- Parameters:
outputStream
- aOutputStream
object.- Throws:
AvailabilityCalculationException
- if any.
-
marshal
public void marshal(File outputFile) throws AvailabilityCalculationException
marshal
- Specified by:
marshal
in interfaceAvailabilityCalculator
- Parameters:
outputFile
- aFile
object.- Throws:
AvailabilityCalculationException
- if any.
-
getLogoURL
public String getLogoURL()
getLogoURL
- Specified by:
getLogoURL
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setLogoURL
public void setLogoURL(String logoURL)
setLogoURL
- Specified by:
setLogoURL
in interfaceAvailabilityCalculator
- Parameters:
logoURL
- aString
object.
-
getOutputFileName
public String getOutputFileName()
getOutputFileName
- Specified by:
getOutputFileName
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setOutputFileName
public void setOutputFileName(String outputFileName)
setOutputFileName
- Specified by:
setOutputFileName
in interfaceAvailabilityCalculator
- Parameters:
outputFileName
- aString
object.
-
getAuthor
public String getAuthor()
getAuthor
- Specified by:
getAuthor
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setAuthor
public void setAuthor(String author)
setAuthor
- Specified by:
setAuthor
in interfaceAvailabilityCalculator
- Parameters:
author
- aString
object.
-
getCategoryName
public String getCategoryName()
getCategoryName
- Specified by:
getCategoryName
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setCategoryName
public void setCategoryName(String categoryName)
setCategoryName
- Specified by:
setCategoryName
in interfaceAvailabilityCalculator
- Parameters:
categoryName
- aString
object.
-
getMonthFormat
public String getMonthFormat()
getMonthFormat
- Specified by:
getMonthFormat
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setMonthFormat
public void setMonthFormat(String monthFormat)
setMonthFormat
- Specified by:
setMonthFormat
in interfaceAvailabilityCalculator
- Parameters:
monthFormat
- aString
object.
-
getReportFormat
public String getReportFormat()
getReportFormat
- Specified by:
getReportFormat
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setReportFormat
public void setReportFormat(String reportFormat)
setReportFormat
- Specified by:
setReportFormat
in interfaceAvailabilityCalculator
- Parameters:
reportFormat
- aString
object.
-
getReport
public Report getReport()
getReport
- Specified by:
getReport
in interfaceAvailabilityCalculator
- Returns:
- a
Report
object.
-
getPeriodEndDate
public Date getPeriodEndDate()
getPeriodEndDate
- Specified by:
getPeriodEndDate
in interfaceAvailabilityCalculator
- Returns:
- a
Date
object.
-
setPeriodEndDate
public void setPeriodEndDate(Date periodEndDate)
setPeriodEndDate
- Specified by:
setPeriodEndDate
in interfaceAvailabilityCalculator
- Parameters:
periodEndDate
- aDate
object.
-
setReportStoreService
public void setReportStoreService(ReportStoreService reportStoreService)
setReportStoreService
- Specified by:
setReportStoreService
in interfaceAvailabilityCalculator
- Parameters:
reportStoreService
- aReportStoreService
object.
-
getBaseDir
public String getBaseDir()
getBaseDir
- Specified by:
getBaseDir
in interfaceAvailabilityCalculator
- Returns:
- a
String
object.
-
setBaseDir
public void setBaseDir(String baseDir)
setBaseDir
- Specified by:
setBaseDir
in interfaceAvailabilityCalculator
- Parameters:
baseDir
- aString
object.
-
setAvailabilityData
public void setAvailabilityData(AvailabilityData availabilityData)
setAvailabilityData
- Specified by:
setAvailabilityData
in interfaceAvailabilityCalculator
- Parameters:
availabilityData
- aAvailabilityData
object.
-
-