org.opengts.extra.tables
Class ReportJob

java.lang.Object
  extended by org.opengts.dbtools.DBRecord<RT>
      extended by org.opengts.db.AccountRecord<ReportJob>
          extended by org.opengts.extra.tables.ReportJob

public class ReportJob
extends AccountRecord<ReportJob>


Nested Class Summary
static class ReportJob.IntervalTag
          IntervalTag class
static class ReportJob.Key
           
 
Nested classes/interfaces inherited from class org.opengts.db.AccountRecord
AccountRecord.AccountKey<RT extends DBRecord>
 
Nested classes/interfaces inherited from class org.opengts.dbtools.DBRecord
DBRecord.DBChangeListener
 
Field Summary
static java.lang.String _TABLE_NAME
           
static java.lang.String CRONTAG_DAILY
           
static java.lang.String CRONTAG_NONE
           
static java.lang.String CRONTAG_WEEKLY
           
static java.lang.String FLD_deviceID
           
static java.lang.String FLD_groupID
           
static java.lang.String FLD_intervalTag
           
static java.lang.String FLD_lastReportTime
           
static java.lang.String FLD_recipients
           
static java.lang.String FLD_reportFormat
           
static java.lang.String FLD_reportJobID
           
static java.lang.String FLD_reportName
           
static java.lang.String FLD_reportOption
           
static java.lang.String FLD_reportTimeFrom
           
static java.lang.String FLD_reportTimeTo
           
 
Fields inherited from class org.opengts.db.AccountRecord
FLD_accountID, FLD_displayName, FLD_isActive, FLD_notes
 
Fields inherited from class org.opengts.dbtools.DBRecord
errorDescription, excludedUpdateFields, FLD_creationMillis, FLD_creationTime, FLD_description, FLD_lastUpdateAccount, FLD_lastUpdateTime, FLD_lastUpdateUser, hasError, ID_SIZE, isValidating, lastSQLException, NOTIFY_GROUP, PSEUDO_FIELD_CHAR, tempProps
 
Constructor Summary
ReportJob()
           
ReportJob(ReportJob.Key key)
           
 
Method Summary
static void AddIntervalTag(ReportJob.IntervalTag tagInt)
          Adds the specified IntervalTag to the cached tag map
static void AddIntervalTag(java.lang.String tagID, I18N.Text desc, java.lang.String frTime, java.lang.String toTime)
          Adds the interval tag attributes to the cached tag map.
Called from ReportFactory while parsing "ReportJobs" tag.
See "reports.xml", "ReportJobs" tag for list of defined tags.
static void AddIntervalTag(java.lang.String tagID, java.lang.String desc, java.lang.String frTime, java.lang.String toTime)
          Adds the interval tag attributes to the cached tag map.
 java.lang.String createGTSRequest_Report(Account A, User U)
          Returns an XML formated Report "GTSRequest" (long form)
static java.lang.String createGTSRequest_Report(Account A, User U, java.util.Collection<java.lang.String> rptJobIDs)
          Returns an XML formated Report "GTSRequest" (short form)
static java.lang.String createGTSRequest_Report(Account A, User U, java.lang.String cronTags)
          Returns an XML formated Report "GTSRequest" (short form)
static ReportJob createNewReportJob(Account account, java.lang.String reportJobID)
          Creates the specified ReportJob, and returns an instance to the record
static int cron(java.lang.String[] argv)
           
static boolean exists(java.lang.String accountID, java.lang.String reportJobID)
          Returns true if the specified ReportJob exists
 java.lang.String getDeviceID()
          Gets the assigned report Device-ID
static DBFactory<ReportJob> getFactory()
           
 java.lang.String getGroupID()
          Gets the assigned report Group-ID
 java.lang.String getIntervalTag()
          Gets the reporting interval tag
static java.lang.String GetIntervalTagDescription(java.lang.String tagID, java.util.Locale locale)
          Returns the localized description for the specified interval tag-id
static java.util.Map<java.lang.String,ReportJob.IntervalTag> GetIntervalTagMap()
          Returns the IntervalTag map
 long getLastReportTime()
          Gets the time of the last generated report
 java.lang.String getRecipients()
          Gets the list of email recipients
 java.lang.String getReportFormat()
          Gets the report format
 java.lang.String getReportFormat(java.lang.String dft)
          Gets the report format
static ReportJob getReportJob(Account account, java.lang.String reportJobID)
          Gets the specified ReportJob instance
static ReportJob getReportJob(Account account, java.lang.String reportJobID, boolean createOK)
          Gets the specified ReportJob instance
 java.lang.String getReportJobID()
          Gets the report ID for this entry
static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID, boolean activeOnly)
          Gets a list of ReportJob IDs for the specified Account
static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID, java.lang.String tagID, boolean activeOnly)
          Gets a list of ReportJob IDs for the specified Account
static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID, java.lang.String tagID, boolean activeOnly, long limit)
          Gets a list of ReportJob IDs for the specified Account
static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID, java.lang.String tagIDs, boolean activeOnly, long limit, DBRecordHandler<ReportJob> handler)
          Gets a list of ReportJob IDs for the specified Account
static ReportJob[] getReportJobsForAccount(java.lang.String accountID)
          Gets a list of ReportJob instances for the specified Account
static ReportJob[] getReportJobsForAccount(java.lang.String accountID, long limit, DBRecordHandler<ReportJob> handler)
          Gets a list of ReportJob instances for the specified Account
 java.lang.String getReportName()
          Gets the report name (as defined in 'reports.xml')
 java.lang.String getReportOption()
          Gets the assigned report options
 java.lang.String getReportTimeFrom()
          Gets the Report "From" time.
 java.lang.String getReportTimeTo()
          Gets the Report "To" time.
static java.lang.String getTableDescription(java.util.Locale loc)
           
static boolean HasIntervalTagID(java.lang.String tagID)
          Returns true if the specified tagID is defined
 boolean hasReportName()
          Returns true if a report name is defined
static void main(java.lang.String[] argv)
           
 void setCreationDefaultValues()
          Override to set default values
 void setDeviceID(java.lang.String v)
          Sets the assigned report Device-ID
 void setGroupID(java.lang.String v)
          Sets the assigned report Group-ID
 void setIntervalTag(java.lang.String v)
          Sets the reporting interval
 void setLastReportTime(long v)
          Sets the time of the last generated report
 void setRecipients(java.lang.String v)
          Sets the list of email recipients
 void setReportFormat(java.lang.String v)
          Gets the report format
 void setReportJobID(java.lang.String v)
          Sets the report ID for this entry
 void setReportName(java.lang.String v)
          Sets the report name (as defined in 'reports.xml')
 void setReportOption(java.lang.String v)
          Sets the assigned report options
 void setReportTimeFrom(java.lang.String v)
          Sets the Report "From" time.
 void setReportTimeTo(java.lang.String v)
          Sets the Report "To" time.
static java.lang.String TABLE_NAME()
           
 java.lang.String toString()
          Returns a String representation of instance
 
Methods inherited from class org.opengts.db.AccountRecord
createSystemAdminAccount, getAccount, getAccountDescription, getAccountID, getDisplayName, getFilteredID, getFilteredID, getIsActive, getNotes, GetSimpleLocalString, getSystemAdminAccount, getSystemAdminAccountID, hasAccount, hasSystemAdminAccountID, isAccountManager, isActive, isSystemAdmin, isSystemAdmin, isSystemAdminAccountID, isValidID, newField_accountID, newField_accountID, newField_displayName, newField_displayName, newField_isActive, newField_isActive, newField_notes, newField_notes, setAccount, setDisplayName, setIsActive, setNotes, setRuntimeDefaultValues
 
Methods inherited from class org.opengts.dbtools.DBRecord
_getFactory, _reload, addChangedNotification, addExcludedUpdateFields, adjustStringLength_1, adjustStringLength, appendFieldValues, clearChanged, clearError, clearExcludedUpdateFields, clearLastCaughtSQLException, equals, excludeFieldFromUpdate, excludeFieldFromUpdate, fireChangeNotification, geKeyValue, getCreationDateTime, getCreationMillis, getCreationTime, GetCurrentAccount, GetCurrentUser, getDefaultFieldValueKey, getDescription, getErrorDescription, getFactory, getFactory, getField, getFieldBoolean, getFieldDateTime, getFieldDouble, getFieldFloat, getFieldInt, getFieldLong, getFieldName, getFieldString, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getKeyValue, getLastCaughtSQLException, getLastUpdateAccount, getLastUpdateTime, getLastUpdateTime, getLastUpdateUser, getNextGroup, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getRecordCount, getRecordCount, getRecordCount, getRecordCount, getRecordCount, getRecordKey, getRecords, getRecords, getTemporaryProperties, getValue, getVirtual, hasChanged, hasError, hasField, hasFieldValue, hasOptionalFieldValue, hasTemporaryProperties, insert, isFieldUnsigned, isLastCaughtSQLExceptionErrorCode, isOkToReload, isOkToSave, isValidating, isVirtual, lock, lockRead, lockWrite, newField_creationMillis, newField_creationTime, newField_creationTime, newField_description, newField_description, newField_lastUpdateAccount, newField_lastUpdateAccount, newField_lastUpdateTime, newField_lastUpdateUser, newField_lastUpdateUser, printXML, printXML, printXML, printXML, printXML, printXML, recordDidInsert, recordDidUpdate, recordWillInsert, recordWillUpdate, reload, reload, removeChangedNotification, save, select, select, select, setAllFieldValues, setAllFieldValues, setAllFieldValues, setAllFieldValues, setChanged, setChanged, setCreationMillis, setCreationTime, SetCurrentAccount, SetCurrentUser, setDescription, setError, setError, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setIgnoreInvalidFields, setKeyValue, setLastCaughtSQLException, setLastUpdateAccount, setLastUpdateTime, setLastUpdateUser, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setValidating, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVirtual, toXML, toXML, toXML, toXML, toXML, unlock, update, update, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CRONTAG_NONE

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

CRONTAG_DAILY

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

CRONTAG_WEEKLY

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

_TABLE_NAME

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

FLD_reportJobID

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

FLD_reportName

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

FLD_reportOption

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

FLD_deviceID

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

FLD_groupID

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

FLD_reportTimeFrom

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

FLD_reportTimeTo

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

FLD_reportFormat

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

FLD_recipients

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

FLD_intervalTag

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

FLD_lastReportTime

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

ReportJob

public ReportJob()

ReportJob

public ReportJob(ReportJob.Key key)
Method Detail

GetIntervalTagMap

public static java.util.Map<java.lang.String,ReportJob.IntervalTag> GetIntervalTagMap()
Returns the IntervalTag map


HasIntervalTagID

public static boolean HasIntervalTagID(java.lang.String tagID)
Returns true if the specified tagID is defined


AddIntervalTag

public static void AddIntervalTag(ReportJob.IntervalTag tagInt)
Adds the specified IntervalTag to the cached tag map


AddIntervalTag

public static void AddIntervalTag(java.lang.String tagID,
                                  I18N.Text desc,
                                  java.lang.String frTime,
                                  java.lang.String toTime)
Adds the interval tag attributes to the cached tag map.
Called from ReportFactory while parsing "ReportJobs" tag.
See "reports.xml", "ReportJobs" tag for list of defined tags.


AddIntervalTag

public static void AddIntervalTag(java.lang.String tagID,
                                  java.lang.String desc,
                                  java.lang.String frTime,
                                  java.lang.String toTime)
Adds the interval tag attributes to the cached tag map.


GetIntervalTagDescription

public static java.lang.String GetIntervalTagDescription(java.lang.String tagID,
                                                         java.util.Locale locale)
Returns the localized description for the specified interval tag-id

Parameters:
tagID - The Tag-id
locale - The language locale
Returns:
The tag-id description

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<ReportJob> getFactory()

getTableDescription

public static java.lang.String getTableDescription(java.util.Locale loc)

getReportJobID

public java.lang.String getReportJobID()
Gets the report ID for this entry


setReportJobID

public void setReportJobID(java.lang.String v)
Sets the report ID for this entry


getReportName

public java.lang.String getReportName()
Gets the report name (as defined in 'reports.xml')


setReportName

public void setReportName(java.lang.String v)
Sets the report name (as defined in 'reports.xml')


hasReportName

public boolean hasReportName()
Returns true if a report name is defined


getReportOption

public java.lang.String getReportOption()
Gets the assigned report options


setReportOption

public void setReportOption(java.lang.String v)
Sets the assigned report options


getDeviceID

public java.lang.String getDeviceID()
Gets the assigned report Device-ID


setDeviceID

public void setDeviceID(java.lang.String v)
Sets the assigned report Device-ID


getGroupID

public java.lang.String getGroupID()
Gets the assigned report Group-ID


setGroupID

public void setGroupID(java.lang.String v)
Sets the assigned report Group-ID


getReportTimeFrom

public java.lang.String getReportTimeFrom()
Gets the Report "From" time. Specified as a String to allow custom relative time specifications.


setReportTimeFrom

public void setReportTimeFrom(java.lang.String v)
Sets the Report "From" time. Specified as a String to allow custom relative time specifications.


getReportTimeTo

public java.lang.String getReportTimeTo()
Gets the Report "To" time. Specified as a String to allow custom relative time specifications.


setReportTimeTo

public void setReportTimeTo(java.lang.String v)
Sets the Report "To" time. Specified as a String to allow custom relative time specifications.


getReportFormat

public java.lang.String getReportFormat()
Gets the report format


getReportFormat

public java.lang.String getReportFormat(java.lang.String dft)
Gets the report format


setReportFormat

public void setReportFormat(java.lang.String v)
Gets the report format


getRecipients

public java.lang.String getRecipients()
Gets the list of email recipients


setRecipients

public void setRecipients(java.lang.String v)
Sets the list of email recipients


getIntervalTag

public java.lang.String getIntervalTag()
Gets the reporting interval tag


setIntervalTag

public void setIntervalTag(java.lang.String v)
Sets the reporting interval


getLastReportTime

public long getLastReportTime()
Gets the time of the last generated report


setLastReportTime

public void setLastReportTime(long v)
Sets the time of the last generated report


toString

public java.lang.String toString()
Returns a String representation of instance

Overrides:
toString in class DBRecord<ReportJob>
Returns:
A String representation of the DBRecordKey for this DBRecord

setCreationDefaultValues

public void setCreationDefaultValues()
Override to set default values

Overrides:
setCreationDefaultValues in class DBRecord<ReportJob>

getReportJobsForAccount

public static ReportJob[] getReportJobsForAccount(java.lang.String accountID)
                                           throws DBException
Gets a list of ReportJob instances for the specified Account

Throws:
DBException

getReportJobsForAccount

public static ReportJob[] getReportJobsForAccount(java.lang.String accountID,
                                                  long limit,
                                                  DBRecordHandler<ReportJob> handler)
                                           throws DBException
Gets a list of ReportJob instances for the specified Account

Throws:
DBException

getReportJobIDsForAccount

public static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID,
                                                                     boolean activeOnly)
                                                              throws DBException
Gets a list of ReportJob IDs for the specified Account

Throws:
DBException

getReportJobIDsForAccount

public static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID,
                                                                     java.lang.String tagID,
                                                                     boolean activeOnly)
                                                              throws DBException
Gets a list of ReportJob IDs for the specified Account

Throws:
DBException

getReportJobIDsForAccount

public static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID,
                                                                     java.lang.String tagID,
                                                                     boolean activeOnly,
                                                                     long limit)
                                                              throws DBException
Gets a list of ReportJob IDs for the specified Account

Throws:
DBException

getReportJobIDsForAccount

public static OrderedSet<java.lang.String> getReportJobIDsForAccount(java.lang.String accountID,
                                                                     java.lang.String tagIDs,
                                                                     boolean activeOnly,
                                                                     long limit,
                                                                     DBRecordHandler<ReportJob> handler)
                                                              throws DBException
Gets a list of ReportJob IDs for the specified Account

Throws:
DBException

exists

public static boolean exists(java.lang.String accountID,
                             java.lang.String reportJobID)
                      throws DBException
Returns true if the specified ReportJob exists

Throws:
DBException

getReportJob

public static ReportJob getReportJob(Account account,
                                     java.lang.String reportJobID,
                                     boolean createOK)
                              throws DBException
Gets the specified ReportJob instance

Throws:
DBException

getReportJob

public static ReportJob getReportJob(Account account,
                                     java.lang.String reportJobID)
                              throws DBException
Gets the specified ReportJob instance

Throws:
DBException

createNewReportJob

public static ReportJob createNewReportJob(Account account,
                                           java.lang.String reportJobID)
                                    throws DBException
Creates the specified ReportJob, and returns an instance to the record

Throws:
DBException

createGTSRequest_Report

public java.lang.String createGTSRequest_Report(Account A,
                                                User U)
Returns an XML formated Report "GTSRequest" (long form)


createGTSRequest_Report

public static java.lang.String createGTSRequest_Report(Account A,
                                                       User U,
                                                       java.lang.String cronTags)
Returns an XML formated Report "GTSRequest" (short form)


createGTSRequest_Report

public static java.lang.String createGTSRequest_Report(Account A,
                                                       User U,
                                                       java.util.Collection<java.lang.String> rptJobIDs)
Returns an XML formated Report "GTSRequest" (short form)


cron

public static int cron(java.lang.String[] argv)

main

public static void main(java.lang.String[] argv)