org.opennms.report.availability
Class AvailabilityCalculator

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

public class AvailabilityCalculator
extends java.lang.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 java.lang.String[] months
           
 
Constructor Summary
AvailabilityCalculator()
           
 
Method Summary
 void calculate()
           
 java.lang.String getAuthor()
           
 java.lang.String getBaseDir()
           
 java.lang.String getCategoryName()
           
 AvailabilityReportLocatorService getLocatorService()
           
 java.lang.String getLogoURL()
           
 java.lang.String getMonthFormat()
           
 java.lang.String getOutputFileName()
           
 java.util.Date getPeriodEndDate()
           
 Report getReport()
           
 java.lang.String getReportFormat()
           
 void marshal(java.io.File outputFile)
           
 void setAuthor(java.lang.String author)
           
 void setBaseDir(java.lang.String baseDir)
           
 void setCalendar(java.util.Calendar calendar)
           
 void setCategoryName(java.lang.String categoryName)
           
 void setLocatorService(AvailabilityReportLocatorService locatorService)
           
 void setLogoURL(java.lang.String logoURL)
           
 void setMonthFormat(java.lang.String monthFormat)
           
 void setOutputFileName(java.lang.String outputFileName)
           
 void setPeriodEndDate(java.util.Date periodEndDate)
           
 void setReportFormat(java.lang.String reportFormat)
           
 void writeLocateableXML()
           
 void writeXML()
           
 void writeXML(java.lang.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 java.lang.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(java.lang.String outputFileName)
              throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

writeLocateableXML

public void writeLocateableXML()
                        throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

marshal

public void marshal(java.io.File outputFile)
             throws AvailabilityCalculationException
Throws:
AvailabilityCalculationException

getLogoURL

public java.lang.String getLogoURL()

setLogoURL

public void setLogoURL(java.lang.String logoURL)

getOutputFileName

public java.lang.String getOutputFileName()

setOutputFileName

public void setOutputFileName(java.lang.String outputFileName)

getAuthor

public java.lang.String getAuthor()

setAuthor

public void setAuthor(java.lang.String author)

getCategoryName

public java.lang.String getCategoryName()

setCategoryName

public void setCategoryName(java.lang.String categoryName)

getMonthFormat

public java.lang.String getMonthFormat()

setMonthFormat

public void setMonthFormat(java.lang.String monthFormat)

getReportFormat

public java.lang.String getReportFormat()

setReportFormat

public void setReportFormat(java.lang.String reportFormat)

getReport

public Report getReport()

setCalendar

public void setCalendar(java.util.Calendar calendar)

getPeriodEndDate

public java.util.Date getPeriodEndDate()

setPeriodEndDate

public void setPeriodEndDate(java.util.Date periodEndDate)

getLocatorService

public AvailabilityReportLocatorService getLocatorService()

setLocatorService

public void setLocatorService(AvailabilityReportLocatorService locatorService)

getBaseDir

public java.lang.String getBaseDir()

setBaseDir

public void setBaseDir(java.lang.String baseDir)


Copyright © 2007. All Rights Reserved.