com.sun.slamd.report
Class PDFReportGenerator

java.lang.Object
  extended bycom.sun.slamd.report.PDFReportGenerator
All Implemented Interfaces:
com.lowagie.text.pdf.PdfPageEvent, ReportGenerator

public class PDFReportGenerator
extends java.lang.Object
implements ReportGenerator, com.lowagie.text.pdf.PdfPageEvent

This class provides an implementation of a SLAMD report generator that will write the report information to a PDF document.


Field Summary
static java.lang.String PARAM_INCLUDE_GRAPHS
          The name of the configuration parameter that indicates whether to include graphs in the report.
static java.lang.String PARAM_INCLUDE_JOB_CONFIG
          The name of the configuration parameter that indicates whether to include the job-specific configuration in the report.
static java.lang.String PARAM_INCLUDE_MONITOR_STATS
          The name of the configuration parameter that indicates whether to include resource monitor statistics in the report.
static java.lang.String PARAM_INCLUDE_OPTIMIZING_ITERATIONS
          The name of the configuration parameter that indicates whether to include the individual iterations of an optimizing job.
static java.lang.String PARAM_INCLUDE_SCHEDULE_CONFIG
          The name of the configuration parameter that indicates whether to include the schedule configuration in the report.
static java.lang.String PARAM_INCLUDE_STATS
          The name of the configuration parameter that indicates whether to include job statistics in the report.
static java.lang.String PARAM_REQUIRE_STATS
          The name of the configuration parameter that indicates whether to only include jobs that contain statistics in the generated report.
static java.lang.String PARAM_VIEW_IN_BROWSER
          The name of the configuration parameter that indicates whether to view the resulting PDF document in the browser (if supported) or save to disk.
 
Constructor Summary
PDFReportGenerator()
          Creates a new text report generator.
 
Method Summary
 void addJobReport(Job job)
          Indicates that information about the provided job should be included in the report.
 void addOptimizingJobReport(OptimizingJob optimizingJob)
          Indicates that information about the provided optimizing job should be included in the report.
 void generateReport(RequestInfo requestInfo)
          Generates the report and sends it to the user over the provided servlet response.
 java.lang.String getReportGeneratorName()
          Retrieves a user-friendly name that can be used to indicate the type of report that will be generated.
 ParameterList getReportParameterStubs()
          Retrieves a set of parameters that can be used to allow the user to configure the way that the report is generated.
static int inchesToPoints(double numInches)
          Converts the specified number of inches into points (there are 72 points per inch).
 void initializeReporter(ParameterList reportParameters)
          Initializes this reporter based on the parameters customized by the end user.
 ReportGenerator newInstance()
          Retrieves a new instance of this report generator initialized with the default configuration.
 void onChapter(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, float chapterPos, com.lowagie.text.Paragraph title)
          Performs the appropriate action necessary when starting a new chapter.
 void onChapterEnd(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, float chapterEndPos)
          Performs the appropriate action necessary when ending a chapter.
 void onCloseDocument(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Performs the appropriate action necessary when opening a document.
 void onEndPage(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Performs the appropriate action necessary when ending a page.
 void onGenericTag(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, com.lowagie.text.Rectangle rectangle, java.lang.String text)
          Performs the appropriate action necessary when writing a generic tag.
 void onOpenDocument(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Performs the appropriate action necessary when opening a document.
 void onParagraph(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, float paragraphPos)
          Performs the appropriate action necessary when starting a new paragraph.
 void onParagraphEnd(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, float paragraphEndPos)
          Performs the appropriate action necessary when ending a paragraph.
 void onSection(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, float sectionPos, int depth, com.lowagie.text.Paragraph sectionTitle)
          Performs the appropriate action necessary when beginning a new section.
 void onSectionEnd(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document, float sectionEndPos)
          Performs the appropriate action necessary when ending a section.
 void onStartPage(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.Document document)
          Performs the appropriate action necessary when starting a new page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_INCLUDE_GRAPHS

public static final java.lang.String PARAM_INCLUDE_GRAPHS
The name of the configuration parameter that indicates whether to include graphs in the report.

See Also:
Constant Field Values

PARAM_INCLUDE_MONITOR_STATS

public static final java.lang.String PARAM_INCLUDE_MONITOR_STATS
The name of the configuration parameter that indicates whether to include resource monitor statistics in the report.

See Also:
Constant Field Values

PARAM_INCLUDE_JOB_CONFIG

public static final java.lang.String PARAM_INCLUDE_JOB_CONFIG
The name of the configuration parameter that indicates whether to include the job-specific configuration in the report.

See Also:
Constant Field Values

PARAM_INCLUDE_SCHEDULE_CONFIG

public static final java.lang.String PARAM_INCLUDE_SCHEDULE_CONFIG
The name of the configuration parameter that indicates whether to include the schedule configuration in the report.

See Also:
Constant Field Values

PARAM_INCLUDE_STATS

public static final java.lang.String PARAM_INCLUDE_STATS
The name of the configuration parameter that indicates whether to include job statistics in the report.

See Also:
Constant Field Values

PARAM_REQUIRE_STATS

public static final java.lang.String PARAM_REQUIRE_STATS
The name of the configuration parameter that indicates whether to only include jobs that contain statistics in the generated report.

See Also:
Constant Field Values

PARAM_INCLUDE_OPTIMIZING_ITERATIONS

public static final java.lang.String PARAM_INCLUDE_OPTIMIZING_ITERATIONS
The name of the configuration parameter that indicates whether to include the individual iterations of an optimizing job.

See Also:
Constant Field Values

PARAM_VIEW_IN_BROWSER

public static final java.lang.String PARAM_VIEW_IN_BROWSER
The name of the configuration parameter that indicates whether to view the resulting PDF document in the browser (if supported) or save to disk.

See Also:
Constant Field Values
Constructor Detail

PDFReportGenerator

public PDFReportGenerator()
Creates a new text report generator.

Method Detail

getReportGeneratorName

public java.lang.String getReportGeneratorName()
Retrieves a user-friendly name that can be used to indicate the type of report that will be generated.

Specified by:
getReportGeneratorName in interface ReportGenerator
Returns:
The user-friendly name that can be used to indicate the type of report that will be generated.

newInstance

public ReportGenerator newInstance()
Retrieves a new instance of this report generator initialized with the default configuration.

Specified by:
newInstance in interface ReportGenerator
Returns:
A new instance of this report generator initialized with the default configuration.

getReportParameterStubs

public ParameterList getReportParameterStubs()
Retrieves a set of parameters that can be used to allow the user to configure the way that the report is generated.

Specified by:
getReportParameterStubs in interface ReportGenerator
Returns:
A set of parameters that can be used to allow the user to configure the way that the report is generated.

initializeReporter

public void initializeReporter(ParameterList reportParameters)
Initializes this reporter based on the parameters customized by the end user.

Specified by:
initializeReporter in interface ReportGenerator
Parameters:
reportParameters - The set of parameters provided by the end user that should be used to customize the report.

addJobReport

public void addJobReport(Job job)
Indicates that information about the provided job should be included in the report.

Specified by:
addJobReport in interface ReportGenerator
Parameters:
job - The job about which to include information in the report.

addOptimizingJobReport

public void addOptimizingJobReport(OptimizingJob optimizingJob)
Indicates that information about the provided optimizing job should be included in the report.

Specified by:
addOptimizingJobReport in interface ReportGenerator
Parameters:
optimizingJob - The optimizing job about which to include information in the report.

generateReport

public void generateReport(RequestInfo requestInfo)
Generates the report and sends it to the user over the provided servlet response.

Specified by:
generateReport in interface ReportGenerator
Parameters:
requestInfo - State information about the request being processed.

inchesToPoints

public static final int inchesToPoints(double numInches)
Converts the specified number of inches into points (there are 72 points per inch). The number of inches provided does not need to be an integer.

Parameters:
numInches - The number of inches to be converted to points.
Returns:
The number of points corresponding to the provided number of inches.

onStartPage

public void onStartPage(com.lowagie.text.pdf.PdfWriter writer,
                        com.lowagie.text.Document document)
Performs the appropriate action necessary when starting a new page. In this case, we will write the SLAMD header to the top of the page.

Specified by:
onStartPage in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.

onEndPage

public void onEndPage(com.lowagie.text.pdf.PdfWriter writer,
                      com.lowagie.text.Document document)
Performs the appropriate action necessary when ending a page. In this case, no action is required.

Specified by:
onEndPage in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.

onOpenDocument

public void onOpenDocument(com.lowagie.text.pdf.PdfWriter writer,
                           com.lowagie.text.Document document)
Performs the appropriate action necessary when opening a document. In this case, no action is required.

Specified by:
onOpenDocument in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.

onCloseDocument

public void onCloseDocument(com.lowagie.text.pdf.PdfWriter writer,
                            com.lowagie.text.Document document)
Performs the appropriate action necessary when opening a document. In this case, no action is required.

Specified by:
onCloseDocument in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.

onParagraph

public void onParagraph(com.lowagie.text.pdf.PdfWriter writer,
                        com.lowagie.text.Document document,
                        float paragraphPos)
Performs the appropriate action necessary when starting a new paragraph. In this case, no action is required.

Specified by:
onParagraph in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
paragraphPos - The position of the beginning of the paragraph.

onParagraphEnd

public void onParagraphEnd(com.lowagie.text.pdf.PdfWriter writer,
                           com.lowagie.text.Document document,
                           float paragraphEndPos)
Performs the appropriate action necessary when ending a paragraph. In this case, no action is required.

Specified by:
onParagraphEnd in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
paragraphEndPos - The position of the end of the paragraph.

onChapter

public void onChapter(com.lowagie.text.pdf.PdfWriter writer,
                      com.lowagie.text.Document document,
                      float chapterPos,
                      com.lowagie.text.Paragraph title)
Performs the appropriate action necessary when starting a new chapter. In this case, no action is required.

Specified by:
onChapter in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
chapterPos - The position at which the beginning of the chapter will be written.
title - The title to use for the chapter.

onChapterEnd

public void onChapterEnd(com.lowagie.text.pdf.PdfWriter writer,
                         com.lowagie.text.Document document,
                         float chapterEndPos)
Performs the appropriate action necessary when ending a chapter. In this case, no action is required.

Specified by:
onChapterEnd in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
chapterEndPos - The position at which the end of the chapter will be written.

onSection

public void onSection(com.lowagie.text.pdf.PdfWriter writer,
                      com.lowagie.text.Document document,
                      float sectionPos,
                      int depth,
                      com.lowagie.text.Paragraph sectionTitle)
Performs the appropriate action necessary when beginning a new section. In this case, no action is required.

Specified by:
onSection in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
sectionPos - The position at which the beginning of the section will be written.
depth - The depth for the section.
sectionTitle - The title to use for the section.

onSectionEnd

public void onSectionEnd(com.lowagie.text.pdf.PdfWriter writer,
                         com.lowagie.text.Document document,
                         float sectionEndPos)
Performs the appropriate action necessary when ending a section. In this case, no action is required.

Specified by:
onSectionEnd in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
sectionEndPos - The position at which the end of the section will be written.

onGenericTag

public void onGenericTag(com.lowagie.text.pdf.PdfWriter writer,
                         com.lowagie.text.Document document,
                         com.lowagie.text.Rectangle rectangle,
                         java.lang.String text)
Performs the appropriate action necessary when writing a generic tag. In this case, no action is required.

Specified by:
onGenericTag in interface com.lowagie.text.pdf.PdfPageEvent
Parameters:
writer - The writer used to write the PDF document.
document - The PDF document being written.
rectangle - The rectangle containing the chunk with the generic tag.
text - The text of the tag.