com.ebay.carad.os.vitalsigns
Class DashboardReport

java.lang.Object
  extended by com.ebay.carad.os.vitalsigns.AbstractListenerContainer
      extended by com.ebay.carad.os.vitalsigns.DashboardReport
All Implemented Interfaces:
IDashboardReport, IDashboardReportContainer, IReportingListenerContainer, ITemplatizable, java.lang.Comparable

public class DashboardReport
extends AbstractListenerContainer
implements java.lang.Comparable, IDashboardReport, IDashboardReportContainer, ITemplatizable

Configuration object for the reports that are run by ReportAgent.

Version:
$Id$
Author:
Jeremy Kraybill, Jeremy Thomerson

Field Summary
private  int frequencyInMinutes
           
private  int id
           
private  java.lang.Float lastObservedValue
           
private  long lastRunTimestamp
           
private static org.apache.log4j.Logger LOGGER
           
private  IDataRetriever mDataRetriever
           
private  java.lang.String mGroupName
           
private  boolean mIncludeInSummary
           
private  boolean moreIsBetter
           
private  java.lang.Float previouslyObservedValue
           
private  int sortOrder
           
private  java.lang.String subTitle
           
private  java.lang.String title
           
 
Constructor Summary
DashboardReport()
          Basic constructor.
DashboardReport(DashboardReport copyFrom)
          Copy constructor.
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 int getFrequencyInMinutes()
          Gets the frequency in minutes for the logging and generation of this report.
 java.lang.String getGroupName()
           
 int getID()
          Returns the ID of this report, used to key off the report's datasource.
 boolean getIncludeInSummary()
           
 boolean getMoreIsBetter()
          Returns whether this report represents a value that should be increasing over time.
 java.lang.Float getPreviousData()
           
 java.util.List getReports()
          Returns an iterator over zero or more IDashboardReport objects.
 int getSortOrder()
          Returns the display sort order of this report.
 java.lang.String getSubTitle()
          Returns the sub-title of this report, which will appear under the report's main title.
 java.lang.Float getThisRunData()
           
 java.lang.String getTitle()
          Returns the title of this report.
 void run(IDashboardAgent agent, long inRunTime)
          Causes this report to run; based on this report's configuration, may cause logging and/or report generation to occur.
 void setDataRetriever(IDataRetriever dataRetriever)
           
 void setFrequencyInMinutes(int freq)
          Sets the frequency in minutes for the generation of this report.
 void setGroupName(java.lang.String groupName)
           
 void setID(int setId)
          Sets the ID of this report.
 void setIncludeInSummary(boolean includeInSummary)
           
 void setMoreIsBetter(boolean flag)
          Sets whether this report represents a value that should be increasing over time.
 void setSortOrder(int setSortorder)
          Sets the display sort order of this report.
 void setSubTitle(java.lang.String title)
          Sets the sub-title of this report.
 void setTitle(java.lang.String inTitle)
          Sets the title of this report.
 void templatize(java.lang.Object[] substitutions)
          Templatizes the title / subtitle / ID based on the objects passed in.
 java.lang.String toString()
           
 
Methods inherited from class com.ebay.carad.os.vitalsigns.AbstractListenerContainer
addReportingListener, fireListenersCompleted, fireListenersException, fireListenersReportRan, fireListenersStarted, getReportingListeners, setReportingListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ebay.carad.os.vitalsigns.IReportingListenerContainer
addReportingListener, getReportingListeners
 

Field Detail

title

private java.lang.String title

subTitle

private java.lang.String subTitle

mGroupName

private java.lang.String mGroupName

frequencyInMinutes

private int frequencyInMinutes

id

private int id

sortOrder

private int sortOrder

moreIsBetter

private boolean moreIsBetter

mDataRetriever

private IDataRetriever mDataRetriever

lastObservedValue

private java.lang.Float lastObservedValue

previouslyObservedValue

private java.lang.Float previouslyObservedValue

lastRunTimestamp

private long lastRunTimestamp

mIncludeInSummary

private boolean mIncludeInSummary

LOGGER

private static final org.apache.log4j.Logger LOGGER
Constructor Detail

DashboardReport

public DashboardReport()
Basic constructor.


DashboardReport

public DashboardReport(DashboardReport copyFrom)
Copy constructor.

Parameters:
copyFrom - report to use as a template
Method Detail

run

public void run(IDashboardAgent agent,
                long inRunTime)
Description copied from interface: IDashboardReport
Causes this report to run; based on this report's configuration, may cause logging and/or report generation to occur.

Specified by:
run in interface IDashboardReport
inRunTime - the time this report run was kicked off (in ms since epoch)

templatize

public void templatize(java.lang.Object[] substitutions)
Templatizes the title / subtitle / ID based on the objects passed in. Note the behavior: we reset ID based on templatized title's hashcode, therefore, the ID must be unique among your report set.

Specified by:
templatize in interface ITemplatizable
Parameters:
substitutions - an array of objects (usually strings) to use for templatization
See Also:
ITemplatizable.templatize(java.lang.Object[])

getID

public int getID()
Description copied from interface: IDashboardReport
Returns the ID of this report, used to key off the report's datasource.

Specified by:
getID in interface IDashboardReport
Returns:
the ID of the report

getTitle

public java.lang.String getTitle()
Description copied from interface: IDashboardReport
Returns the title of this report.

Specified by:
getTitle in interface IDashboardReport
Returns:
the title of this report

getSubTitle

public java.lang.String getSubTitle()
Description copied from interface: IDashboardReport
Returns the sub-title of this report, which will appear under the report's main title.

Specified by:
getSubTitle in interface IDashboardReport
Returns:
the sub-title

getMoreIsBetter

public boolean getMoreIsBetter()
Description copied from interface: IDashboardReport
Returns whether this report represents a value that should be increasing over time.

Specified by:
getMoreIsBetter in interface IDashboardReport
Returns:
if true, this report is "happy" when its value has increased

setTitle

public void setTitle(java.lang.String inTitle)
Sets the title of this report.

Parameters:
inTitle - the title to set to

setSubTitle

public void setSubTitle(java.lang.String title)
Sets the sub-title of this report.

Parameters:
title - the sub-title to use

getFrequencyInMinutes

public int getFrequencyInMinutes()
Description copied from interface: IDashboardReport
Gets the frequency in minutes for the logging and generation of this report.

Specified by:
getFrequencyInMinutes in interface IDashboardReport
Returns:
the frequency in minutes

setFrequencyInMinutes

public void setFrequencyInMinutes(int freq)
Sets the frequency in minutes for the generation of this report. Currently, only valid values are 15, 60 or 1440. TODO : is this comment still correct? is there a restriction on how often it can run? I presume this is only valid if the reportagent is triggered less than given amount

Parameters:
freq - the frequency in minutes

setID

public void setID(int setId)
Sets the ID of this report. If more than one report has the same ID, bad things will happen!

Parameters:
setId - the ID to use

setSortOrder

public void setSortOrder(int setSortorder)
Sets the display sort order of this report. Reports with the same sort order will be sorted in a non-guaranteed order.

Parameters:
setSortorder - the order to use

setMoreIsBetter

public void setMoreIsBetter(boolean flag)
Sets whether this report represents a value that should be increasing over time.

Parameters:
flag - if true, this report is "happy" when its value has increased

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

getReports

public java.util.List getReports()
Description copied from interface: IDashboardReportContainer
Returns an iterator over zero or more IDashboardReport objects.

Specified by:
getReports in interface IDashboardReportContainer
Returns:
a list of IDashboardReport objects.

getSortOrder

public int getSortOrder()
Description copied from interface: IDashboardReport
Returns the display sort order of this report.

Specified by:
getSortOrder in interface IDashboardReport
Specified by:
getSortOrder in interface IDashboardReportContainer
Returns:
the sortorder for display purposes

setDataRetriever

public void setDataRetriever(IDataRetriever dataRetriever)

getThisRunData

public java.lang.Float getThisRunData()
Specified by:
getThisRunData in interface IDashboardReport
Returns:
The data from the most recent run.

getPreviousData

public java.lang.Float getPreviousData()
Specified by:
getPreviousData in interface IDashboardReport
Returns:
the data from the run prior to the most recent run

getIncludeInSummary

public boolean getIncludeInSummary()
Specified by:
getIncludeInSummary in interface IDashboardReport
Returns:
whether this report should be included in any summaries generated regarding reports

setIncludeInSummary

public void setIncludeInSummary(boolean includeInSummary)

getGroupName

public java.lang.String getGroupName()
Specified by:
getGroupName in interface IDashboardReportContainer
Returns:
Returns the groupName.
See Also:
IDashboardReportContainer.getGroupName()

setGroupName

public void setGroupName(java.lang.String groupName)
Parameters:
groupName - The groupName to set.
See Also:
IDashboardReportContainer.getGroupName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2009. All Rights Reserved.