org.opennms.report.availability
Class AvailabilityCalculator

java.lang.Object
  extended by org.opennms.report.availability.AvailabilityCalculator

public class AvailabilityCalculator
extends Object

AvailabilityCalculator is a partial refectoring 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 Calulator will marshall 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 retrive 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
AvailabilityCalculator()
           
 
Method Summary
 void calculate()
           
 String getAuthor()
           
 String getBaseDir()
           
 String getCategoryName()
           
 AvailabilityReportLocatorService getLocatorService()
           
 String getLogoURL()
           
 String getMonthFormat()
           
 String getOutputFileName()
           
 Date getPeriodEndDate()
           
 Report getReport()
           
 String getReportFormat()
           
 void marshal(File outputFile)
           
 void setAuthor(String author)
           
 void setBaseDir(String baseDir)
           
 void setCalendar(Calendar calendar)
           
 void setCategoryName(String categoryName)
           
 void setLocatorService(AvailabilityReportLocatorService locatorService)
           
 void setLogoURL(String logoURL)
           
 void setMonthFormat(String monthFormat)
           
 void setOutputFileName(String outputFileName)
           
 void setPeriodEndDate(Date periodEndDate)
           
 void setReportFormat(String reportFormat)
           
 void writeLocateableXML()
           
 void writeXML()
           
 void writeXML(String outputFileName)
           
 
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

AvailabilityCalculator

public AvailabilityCalculator()
Method Detail

calculate

public void calculate()
               throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

writeXML

public void writeXML()
              throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

writeXML

public void writeXML(String outputFileName)
              throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

writeLocateableXML

public void writeLocateableXML()
                        throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

marshal

public void marshal(File outputFile)
             throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

getLogoURL

public String getLogoURL()

setLogoURL

public void setLogoURL(String logoURL)

getOutputFileName

public String getOutputFileName()

setOutputFileName

public void setOutputFileName(String outputFileName)

getAuthor

public String getAuthor()

setAuthor

public void setAuthor(String author)

getCategoryName

public String getCategoryName()

setCategoryName

public void setCategoryName(String categoryName)

getMonthFormat

public String getMonthFormat()

setMonthFormat

public void setMonthFormat(String monthFormat)

getReportFormat

public String getReportFormat()

setReportFormat

public void setReportFormat(String reportFormat)

getReport

public Report getReport()

setCalendar

public void setCalendar(Calendar calendar)

getPeriodEndDate

public Date getPeriodEndDate()

setPeriodEndDate

public void setPeriodEndDate(Date periodEndDate)

getLocatorService

public AvailabilityReportLocatorService getLocatorService()

setLocatorService

public void setLocatorService(AvailabilityReportLocatorService locatorService)

getBaseDir

public String getBaseDir()

setBaseDir

public void setBaseDir(String baseDir)


Copyright ? 2008. All Rights Reserved.