org.opennms.reporting.availability
Class AvailabilityCalculatorImpl

java.lang.Object
  extended by 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 castor generated object created 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

Field Summary
static String[] months
           
 
Constructor Summary
AvailabilityCalculatorImpl()
          Constructor for AvailabilityCalculatorImpl.
 
Method Summary
 void calculate()
          calculate
 String getAuthor()
          getAuthor
 String getBaseDir()
          getBaseDir
 String getCategoryName()
          getCategoryName
 String getLogoURL()
          getLogoURL
 String getMonthFormat()
          getMonthFormat
 String getOutputFileName()
          getOutputFileName
 Date getPeriodEndDate()
          getPeriodEndDate
 Report getReport()
          getReport
 String getReportFormat()
          getReportFormat
 void marshal(File outputFile)
          marshal
 void setAuthor(String author)
          setAuthor
 void setAvailabilityData(AvailabilityData availabilityData)
          setAvailabilityData
 void setBaseDir(String baseDir)
          setBaseDir
 void setCalendar(Calendar calendar)
          setCalendar
 void setCategoryName(String categoryName)
          setCategoryName
 void setLogoURL(String logoURL)
          setLogoURL
 void setMonthFormat(String monthFormat)
          setMonthFormat
 void setOutputFileName(String outputFileName)
          setOutputFileName
 void setPeriodEndDate(Date periodEndDate)
          setPeriodEndDate
 void setReportFormat(String reportFormat)
          setReportFormat
 void setReportStoreService(ReportStoreService reportStoreService)
          setReportStoreService
 String writeLocateableXML(String id)
          writeLocateableXML
 String writeXML()
          writeXML
 void writeXML(OutputStream outputStream)
          writeXML
 void writeXML(String outputFileName)
          writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

months

public static String[] months
Constructor Detail

AvailabilityCalculatorImpl

public AvailabilityCalculatorImpl()

Constructor for AvailabilityCalculatorImpl.

Method Detail

calculate

public void calculate()
               throws AvailabilityCalculationException

calculate

Specified by:
calculate in interface AvailabilityCalculator
Throws:
AvailabilityCalculationException - if any.

writeXML

public String writeXML()
                throws AvailabilityCalculationException

writeXML

Specified by:
writeXML in interface AvailabilityCalculator
Returns:
a String object.
Throws:
AvailabilityCalculationException - if any.

writeXML

public void writeXML(String outputFileName)
              throws AvailabilityCalculationException

writeXML

Specified by:
writeXML in interface AvailabilityCalculator
Parameters:
outputFileName - a String object.
Throws:
AvailabilityCalculationException - if any.

writeLocateableXML

public String writeLocateableXML(String id)
                          throws AvailabilityCalculationException

writeLocateableXML

Specified by:
writeLocateableXML in interface AvailabilityCalculator
Parameters:
id - a String object.
Returns:
a String object.
Throws:
AvailabilityCalculationException - if any.

writeXML

public void writeXML(OutputStream outputStream)
              throws AvailabilityCalculationException

writeXML

Specified by:
writeXML in interface AvailabilityCalculator
Parameters:
outputStream - a OutputStream object.
Throws:
AvailabilityCalculationException - if any.

marshal

public void marshal(File outputFile)
             throws AvailabilityCalculationException

marshal

Specified by:
marshal in interface AvailabilityCalculator
Parameters:
outputFile - a File object.
Throws:
AvailabilityCalculationException - if any.

getLogoURL

public String getLogoURL()

getLogoURL

Specified by:
getLogoURL in interface AvailabilityCalculator
Returns:
a String object.

setLogoURL

public void setLogoURL(String logoURL)

setLogoURL

Specified by:
setLogoURL in interface AvailabilityCalculator
Parameters:
logoURL - a String object.

getOutputFileName

public String getOutputFileName()

getOutputFileName

Specified by:
getOutputFileName in interface AvailabilityCalculator
Returns:
a String object.

setOutputFileName

public void setOutputFileName(String outputFileName)

setOutputFileName

Specified by:
setOutputFileName in interface AvailabilityCalculator
Parameters:
outputFileName - a String object.

getAuthor

public String getAuthor()

getAuthor

Specified by:
getAuthor in interface AvailabilityCalculator
Returns:
a String object.

setAuthor

public void setAuthor(String author)

setAuthor

Specified by:
setAuthor in interface AvailabilityCalculator
Parameters:
author - a String object.

getCategoryName

public String getCategoryName()

getCategoryName

Specified by:
getCategoryName in interface AvailabilityCalculator
Returns:
a String object.

setCategoryName

public void setCategoryName(String categoryName)

setCategoryName

Specified by:
setCategoryName in interface AvailabilityCalculator
Parameters:
categoryName - a String object.

getMonthFormat

public String getMonthFormat()

getMonthFormat

Specified by:
getMonthFormat in interface AvailabilityCalculator
Returns:
a String object.

setMonthFormat

public void setMonthFormat(String monthFormat)

setMonthFormat

Specified by:
setMonthFormat in interface AvailabilityCalculator
Parameters:
monthFormat - a String object.

getReportFormat

public String getReportFormat()

getReportFormat

Specified by:
getReportFormat in interface AvailabilityCalculator
Returns:
a String object.

setReportFormat

public void setReportFormat(String reportFormat)

setReportFormat

Specified by:
setReportFormat in interface AvailabilityCalculator
Parameters:
reportFormat - a String object.

getReport

public Report getReport()

getReport

Specified by:
getReport in interface AvailabilityCalculator
Returns:
a Report object.

setCalendar

public void setCalendar(Calendar calendar)

setCalendar

Specified by:
setCalendar in interface AvailabilityCalculator
Parameters:
calendar - a Calendar object.

getPeriodEndDate

public Date getPeriodEndDate()

getPeriodEndDate

Specified by:
getPeriodEndDate in interface AvailabilityCalculator
Returns:
a Date object.

setPeriodEndDate

public void setPeriodEndDate(Date periodEndDate)

setPeriodEndDate

Specified by:
setPeriodEndDate in interface AvailabilityCalculator
Parameters:
periodEndDate - a Date object.

setReportStoreService

public void setReportStoreService(ReportStoreService reportStoreService)

setReportStoreService

Specified by:
setReportStoreService in interface AvailabilityCalculator
Parameters:
reportStoreService - a ReportStoreService object.

getBaseDir

public String getBaseDir()

getBaseDir

Specified by:
getBaseDir in interface AvailabilityCalculator
Returns:
a String object.

setBaseDir

public void setBaseDir(String baseDir)

setBaseDir

Specified by:
setBaseDir in interface AvailabilityCalculator
Parameters:
baseDir - a String object.

setAvailabilityData

public void setAvailabilityData(AvailabilityData availabilityData)

setAvailabilityData

Specified by:
setAvailabilityData in interface AvailabilityCalculator
Parameters:
availabilityData - a AvailabilityData object.


Copyright © 2011. All Rights Reserved.