org.opengts.war.report
Class ReportData

java.lang.Object
  extended by org.opengts.war.report.ReportData
Direct Known Subclasses:
AccountReport, AntxDailyReport, AntxDayDetailReport, AntxDayValueSummaryReport, AuditReport, DeviceReport, DiagnosticReport, DigitalIOReport, EntityReport, EventCountReport, EventDetailReport, EventSummaryReport, FuelSummaryReport, GeozoneDepartReport, GeozoneReport, MotionReport, PropertyReport, SessionStatusReport, TripReport, UnassignedDevicesReport

public abstract class ReportData
extends java.lang.Object


Nested Class Summary
 class ReportData.ArrayDataIterator
           
protected  class ReportData.ListDataIterator
           
 
Field Summary
static java.lang.String FORMAT_GRAPH
           
static java.lang.String FORMAT_KML
           
static java.lang.String FORMAT_MAP
           
 
Constructor Summary
ReportData(ReportEntry rptEntry, RequestProperties reqState, ReportDeviceList devList)
           
ReportData(ReportFactory rptFact, RequestProperties reqState, Account acct, User user, ReportDeviceList devList)
           
 
Method Summary
protected  long _countEventData(Device deviceDB)
           
protected  EventData[] _getEventData(Device deviceDB, DBRecordHandler<EventData> rcdHandler)
          Returns an array EventData records for the specified Device
protected  long countEventData(Device deviceDB)
           
 java.lang.String expandHeaderText(java.lang.String text)
           
 Account getAccount()
           
 java.lang.String getAccountID()
           
 URIArg getAutoReportURL()
           
abstract  DBDataIterator getBodyDataIterator()
           
 int getColumnCount()
           
 DataRowTemplate getDataRowTemplate()
           
 Device getDevice(java.lang.String deviceID)
           
 int getDeviceCount()
           
protected  EventData[] getEventData(DBRecordHandler<EventData> rcdHandler)
          Returns an array EventData records based on the predefined ReportDeviceList and constraints
protected  EventData[] getEventData(Device deviceDB, DBRecordHandler<EventData> rcdHandler)
          Returns an array EventData records for the specified Device
 java.lang.String getFirstDeviceID()
           
 java.lang.String getGraphLinkDescription()
           
 URIArg getGraphURL()
           
 MapDimension getGraphWindowSize()
           
 java.lang.String getKmlLinkDescription()
           
 URIArg getKmlURL()
           
 java.util.Locale getLocale()
           
 java.lang.String getMapIconSelector()
           
 java.lang.String getMapLinkDescription()
           
 URIArg getMapURL()
           
 MapDimension getMapWindowSize()
           
 long getMaximumEventDataCount()
           
 boolean getOrderAscending()
          Returns true if the data records are to be in ascending order
 java.lang.String getPreferredFormat()
           
 PrivateLabel getPrivateLabel()
           
 RTProperties getProperties()
           
 URIArg getRefreshURL()
           
 ReportCallback getReportCallback()
          Gets the ReportCallback instance (if specified)
 ReportColumn[] getReportColumns()
           
 ReportConstraints getReportConstraints()
          Gets the ReportConstraints for this report
 ReportDeviceList getReportDeviceList()
           
 ReportEntry getReportEntry()
           
 ReportFactory getReportFactory()
           
abstract  ReportLayout getReportLayout()
           
 long getReportLimit()
          Returns the report limit constraint.
 java.lang.String getReportName()
           
 ReportOption getReportOption()
           
 java.lang.String getReportSubtitle()
           
 java.lang.String getReportTitle()
           
 java.lang.String getReportType()
           
 RequestProperties getRequestProperties()
           
 java.lang.String getRuleSelector()
          Returns the 'rule' selector constraint
 long getSelectionLimit()
          Returns the selection limit constraint.
 EventData.LimitType getSelectionLimitType()
          Returns the selection limit type constraint
 int[] getStatusCodes()
          Returns the status codes constraint
 boolean getSupportsGraphDisplay()
          Returns true if this report supports displaying a graph
 boolean getSupportsKmlDisplay()
          Returns true if this report supports displaying KML
 boolean getSupportsMapDisplay()
          Returns true if this report supports displaying a map
 long getTimeEnd()
          Returns the time end constraint
 long getTimeStart()
          Returns the time start constraint
 java.util.TimeZone getTimeZone()
           
 java.lang.String getTimeZoneString()
           
abstract  DBDataIterator getTotalsDataIterator()
           
 User getUser()
           
 java.lang.String getUserID()
           
 boolean getValidGPSRequired()
          Returns the "valid GPS required" constraint
 java.lang.String getWhereSelector()
          Returns the 'WHERE' selector constraint
 boolean hasReportColumn(java.lang.String name)
           
 boolean hasReportOption()
           
 boolean isSingleDeviceOnly()
          Returns true if this report handles only a single device at a time
 boolean isSoapRequest()
           
 void postInitialize()
          This method is called after all other ReportConstraints have been set.
 void setAutoReportURL(URIArg autoReportURL)
           
 void setGraphURL(URIArg graphURL)
           
 void setKmlURL(URIArg kmlURL)
           
 void setMapIconSelector(java.lang.String iconSel)
           
 void setMapURL(URIArg mapURL)
           
 void setPreferredFormat(java.lang.String format)
           
 void setRefreshURL(URIArg refreshURL)
           
 void setReportCallback(ReportCallback rptCB)
          Sets the ReportCallback instance
 void setReportColumns(ReportColumn[] columns)
           
 void setReportConstraints(ReportConstraints rc)
          Sets the ReportConstraints for this report
protected  void setReportDeviceList(ReportDeviceList devList)
           
 void setReportName(java.lang.String name)
           
 void setReportOption(ReportOption rptOpt)
           
 void setReportSubtitle(java.lang.String title)
           
 void setReportTitle(java.lang.String title)
           
 int writeReport(java.lang.String format, OutputProvider out)
           
 int writeReport(java.lang.String format, OutputProvider out, int indentLevel)
           
 void writeReportStyle(java.lang.String format, OutputProvider out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_MAP

public static final java.lang.String FORMAT_MAP
See Also:
Constant Field Values

FORMAT_KML

public static final java.lang.String FORMAT_KML
See Also:
Constant Field Values

FORMAT_GRAPH

public static final java.lang.String FORMAT_GRAPH
See Also:
Constant Field Values
Constructor Detail

ReportData

public ReportData(ReportFactory rptFact,
                  RequestProperties reqState,
                  Account acct,
                  User user,
                  ReportDeviceList devList)
           throws ReportException
Throws:
ReportException

ReportData

public ReportData(ReportEntry rptEntry,
                  RequestProperties reqState,
                  ReportDeviceList devList)
           throws ReportException
Throws:
ReportException
Method Detail

getReportEntry

public ReportEntry getReportEntry()

getReportFactory

public ReportFactory getReportFactory()

getProperties

public RTProperties getProperties()

setReportName

public void setReportName(java.lang.String name)

getReportName

public java.lang.String getReportName()

getReportType

public java.lang.String getReportType()

setReportTitle

public void setReportTitle(java.lang.String title)

getReportTitle

public java.lang.String getReportTitle()

setReportSubtitle

public void setReportSubtitle(java.lang.String title)

getReportSubtitle

public java.lang.String getReportSubtitle()

expandHeaderText

public java.lang.String expandHeaderText(java.lang.String text)

getRequestProperties

public RequestProperties getRequestProperties()

isSoapRequest

public boolean isSoapRequest()

getTimeZone

public java.util.TimeZone getTimeZone()

getTimeZoneString

public java.lang.String getTimeZoneString()

getPrivateLabel

public PrivateLabel getPrivateLabel()

getLocale

public java.util.Locale getLocale()

setMapIconSelector

public void setMapIconSelector(java.lang.String iconSel)

getMapIconSelector

public java.lang.String getMapIconSelector()

getAccount

public Account getAccount()

getAccountID

public java.lang.String getAccountID()

getUser

public User getUser()

getUserID

public java.lang.String getUserID()

getPreferredFormat

public java.lang.String getPreferredFormat()

setPreferredFormat

public void setPreferredFormat(java.lang.String format)

isSingleDeviceOnly

public boolean isSingleDeviceOnly()
Returns true if this report handles only a single device at a time

Returns:
True If this report handles only a single device at a time

setReportDeviceList

protected void setReportDeviceList(ReportDeviceList devList)
                            throws ReportException
Throws:
ReportException

getReportDeviceList

public ReportDeviceList getReportDeviceList()

getDeviceCount

public int getDeviceCount()

getFirstDeviceID

public java.lang.String getFirstDeviceID()

getDevice

public Device getDevice(java.lang.String deviceID)
                 throws DBException
Throws:
DBException

setReportColumns

public void setReportColumns(ReportColumn[] columns)

getReportColumns

public ReportColumn[] getReportColumns()

getColumnCount

public int getColumnCount()

hasReportColumn

public boolean hasReportColumn(java.lang.String name)

hasReportOption

public boolean hasReportOption()

getReportOption

public ReportOption getReportOption()

setReportOption

public void setReportOption(ReportOption rptOpt)

setReportConstraints

public void setReportConstraints(ReportConstraints rc)
Sets the ReportConstraints for this report

Parameters:
rc - The ReportConstraints

getReportConstraints

public ReportConstraints getReportConstraints()
Gets the ReportConstraints for this report

Returns:
The ReportConstraints

getRuleSelector

public java.lang.String getRuleSelector()
Returns the 'rule' selector constraint

Returns:
The 'rule' selector constraint

getWhereSelector

public java.lang.String getWhereSelector()
Returns the 'WHERE' selector constraint

Returns:
The 'WHERE' selector constraint

getSelectionLimitType

public EventData.LimitType getSelectionLimitType()
Returns the selection limit type constraint

Returns:
The selection limit type constraint

getSelectionLimit

public long getSelectionLimit()
Returns the selection limit constraint.

Returns:
The selection limit constraint

getReportLimit

public long getReportLimit()
Returns the report limit constraint.

Returns:
The report limit constraint

getTimeStart

public long getTimeStart()
Returns the time start constraint

Returns:
The time start constraint

getTimeEnd

public long getTimeEnd()
Returns the time end constraint

Returns:
The time end constraint

getValidGPSRequired

public boolean getValidGPSRequired()
Returns the "valid GPS required" constraint

Returns:
The "valid GPS required" constraint

getStatusCodes

public int[] getStatusCodes()
Returns the status codes constraint

Returns:
The status codes constraint

getOrderAscending

public boolean getOrderAscending()
Returns true if the data records are to be in ascending order

Returns:
True if the data records are to be in ascending order

getReportCallback

public ReportCallback getReportCallback()
Gets the ReportCallback instance (if specified)

Returns:
The ReportCallback instance, or null if not set

setReportCallback

public void setReportCallback(ReportCallback rptCB)
                       throws ReportException
Sets the ReportCallback instance

Parameters:
rptCB - The ReportCallback instance
Throws:
ReportException

getEventData

protected EventData[] getEventData(DBRecordHandler<EventData> rcdHandler)
Returns an array EventData records based on the predefined ReportDeviceList and constraints

Parameters:
rcdHandler - The callback DBRecordHandler. If specified, the returned EventData array may be null.
Returns:
An array of EventData records for the device (may be null if a callback DBRecordHandler has been specified).

getEventData

protected EventData[] getEventData(Device deviceDB,
                                   DBRecordHandler<EventData> rcdHandler)
Returns an array EventData records for the specified Device

Parameters:
deviceDB - The Device for which EventData records will be selected
rcdHandler - The callback DBRecordHandler. If specified, the returned EventData array may be null.
Returns:
An array of EventData records for the device (may be null if a callback DBRecordHandler has been specified).

_getEventData

protected EventData[] _getEventData(Device deviceDB,
                                    DBRecordHandler<EventData> rcdHandler)
Returns an array EventData records for the specified Device

Parameters:
deviceDB - The Device for which EventData records will be selected
rcdHandler - The callback DBRecordHandler. If specified, the returned EventData array may be null.
Returns:
An array of EventData records for the device (may be null if a callback DBRecordHandler has been specified).

getMaximumEventDataCount

public long getMaximumEventDataCount()

countEventData

protected long countEventData(Device deviceDB)

_countEventData

protected long _countEventData(Device deviceDB)

setAutoReportURL

public void setAutoReportURL(URIArg autoReportURL)

getAutoReportURL

public URIArg getAutoReportURL()

getSupportsGraphDisplay

public boolean getSupportsGraphDisplay()
Returns true if this report supports displaying a graph

Returns:
True if this report supports displaying a graph, false otherwise

setGraphURL

public void setGraphURL(URIArg graphURL)

getGraphURL

public URIArg getGraphURL()

getGraphLinkDescription

public java.lang.String getGraphLinkDescription()

getGraphWindowSize

public MapDimension getGraphWindowSize()

getSupportsMapDisplay

public boolean getSupportsMapDisplay()
Returns true if this report supports displaying a map

Returns:
True if this report supports displaying a map, false otherwise

setMapURL

public void setMapURL(URIArg mapURL)

getMapURL

public URIArg getMapURL()

getMapLinkDescription

public java.lang.String getMapLinkDescription()

getMapWindowSize

public MapDimension getMapWindowSize()

getSupportsKmlDisplay

public boolean getSupportsKmlDisplay()
Returns true if this report supports displaying KML

Returns:
True if this report supports displaying KML, false otherwise

setKmlURL

public void setKmlURL(URIArg kmlURL)

getKmlURL

public URIArg getKmlURL()

getKmlLinkDescription

public java.lang.String getKmlLinkDescription()

setRefreshURL

public void setRefreshURL(URIArg refreshURL)

getRefreshURL

public URIArg getRefreshURL()

postInitialize

public void postInitialize()
This method is called after all other ReportConstraints have been set. The report has this opportunity to make any changes to the ReportConstraints before the report is actually generated


getReportLayout

public abstract ReportLayout getReportLayout()

getDataRowTemplate

public DataRowTemplate getDataRowTemplate()

writeReportStyle

public void writeReportStyle(java.lang.String format,
                             OutputProvider out)
                      throws ReportException
Throws:
ReportException

writeReport

public int writeReport(java.lang.String format,
                       OutputProvider out)
                throws ReportException
Throws:
ReportException

writeReport

public int writeReport(java.lang.String format,
                       OutputProvider out,
                       int indentLevel)
                throws ReportException
Throws:
ReportException

getBodyDataIterator

public abstract DBDataIterator getBodyDataIterator()

getTotalsDataIterator

public abstract DBDataIterator getTotalsDataIterator()