org.opengts.extra.tables
Class SessionStats

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

public class SessionStats
extends DeviceRecord<SessionStats>


Nested Class Summary
static class SessionStats.Key
           
 
Nested classes/interfaces inherited from class org.opengts.db.DeviceRecord
DeviceRecord.DeviceKey<RT extends DBRecord>
 
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 FLD_bytesOverhead
           
static java.lang.String FLD_bytesRead
           
static java.lang.String FLD_bytesRounded
           
static java.lang.String FLD_bytesWritten
           
static java.lang.String FLD_eventsReceived
           
static java.lang.String FLD_ipAddress
           
static java.lang.String FLD_isDuplex
           
static java.lang.String FLD_timestamp
           
static long TCP_OVERHEAD
           
static long TCP_SESSION_OVERHEAD
           
static long UDP_OVERHEAD
           
 
Fields inherited from class org.opengts.db.DeviceRecord
FLD_deviceID
 
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
SessionStats()
           
SessionStats(SessionStats.Key key)
           
 
Method Summary
static void addStatistic(Device device, long timestamp, java.lang.String ipAddr, boolean isDuplex, long bytesRead, long bytesWritten, long eventsRecv)
           
static void addStatistic(java.lang.String acctID, java.lang.String devID, long timestamp, java.lang.String ipAddr, boolean isDuplex, long bytesRead, long bytesWritten, long eventsRecv)
           
static void deleteRange(Device device, long timeStart, long timeEnd)
           
static void deleteRange(java.lang.String acctID, java.lang.String devID, long timeStart, long timeEnd)
           
static long[] getByteCounts(Device dev, long timeStart, long timeEnd)
           
static long[] getByteCounts(java.lang.String acctID, java.lang.String devID, long timeStart, long timeEnd)
           
 long getBytesOverhead()
           
 long getBytesRead()
           
 long getBytesRounded()
           
 long getBytesWritten()
           
static long[] getConnectionCounts(Device dev, long timeStart, long timeEnd)
           
 long getEventsReceived()
           
static DBFactory<SessionStats> getFactory()
           
 DTIPAddress getIpAddress()
           
 boolean getIsDuplex()
           
static java.lang.String getTableDescription(java.util.Locale loc)
           
 long getTimestamp()
           
 boolean isDuplex()
           
static void main(java.lang.String[] args)
           
protected  void recordDidInsert()
          Callback after record has been be inserted into the table
protected  void recordDidUpdate()
          Callback after record has been be updated in the table
protected  void recordWillInsert()
          Callback when record is about to be inserted into the table
protected  void recordWillUpdate()
          Callback when record is about to be updated in the table
 void setBytesOverhead(long v)
           
 void setBytesRead(long v)
           
 void setBytesRounded(long v)
           
 void setBytesWritten(long v)
           
 void setCreationDefaultValues()
          Override to set default values
 void setEventsReceived(long v)
           
 void setIpAddress(DTIPAddress v)
           
 void setIpAddress(java.lang.String v)
           
 void setIsDuplex(boolean v)
           
 void setTimestamp(long v)
           
static java.lang.String TABLE_NAME()
           
 java.lang.String toString()
          Returns a String representation of the DBRecordKey for this DBRecord
 
Methods inherited from class org.opengts.db.DeviceRecord
getDevice, getDeviceDescription, getDeviceID, getDeviceVIN, hasDevice, newField_deviceID, newField_deviceID, newField_deviceID, newField_deviceID, setDevice, setDeviceID
 
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, 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

UDP_OVERHEAD

public static long UDP_OVERHEAD

TCP_OVERHEAD

public static long TCP_OVERHEAD

TCP_SESSION_OVERHEAD

public static long TCP_SESSION_OVERHEAD

_TABLE_NAME

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

FLD_timestamp

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

FLD_ipAddress

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

FLD_isDuplex

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

FLD_bytesRead

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

FLD_bytesWritten

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

FLD_bytesOverhead

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

FLD_bytesRounded

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

FLD_eventsReceived

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

SessionStats

public SessionStats()

SessionStats

public SessionStats(SessionStats.Key key)
Method Detail

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<SessionStats> getFactory()

getTableDescription

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

getTimestamp

public long getTimestamp()

setTimestamp

public void setTimestamp(long v)

getIpAddress

public DTIPAddress getIpAddress()

setIpAddress

public void setIpAddress(DTIPAddress v)

setIpAddress

public void setIpAddress(java.lang.String v)

getIsDuplex

public boolean getIsDuplex()

setIsDuplex

public void setIsDuplex(boolean v)

isDuplex

public boolean isDuplex()

getBytesRead

public long getBytesRead()

setBytesRead

public void setBytesRead(long v)

getBytesWritten

public long getBytesWritten()

setBytesWritten

public void setBytesWritten(long v)

getBytesOverhead

public long getBytesOverhead()

setBytesOverhead

public void setBytesOverhead(long v)

getBytesRounded

public long getBytesRounded()

setBytesRounded

public void setBytesRounded(long v)

getEventsReceived

public long getEventsReceived()

setEventsReceived

public void setEventsReceived(long v)

addStatistic

public static void addStatistic(Device device,
                                long timestamp,
                                java.lang.String ipAddr,
                                boolean isDuplex,
                                long bytesRead,
                                long bytesWritten,
                                long eventsRecv)
                         throws DBException
Throws:
DBException

addStatistic

public static void addStatistic(java.lang.String acctID,
                                java.lang.String devID,
                                long timestamp,
                                java.lang.String ipAddr,
                                boolean isDuplex,
                                long bytesRead,
                                long bytesWritten,
                                long eventsRecv)
                         throws DBException
Throws:
DBException

getConnectionCounts

public static long[] getConnectionCounts(Device dev,
                                         long timeStart,
                                         long timeEnd)

getByteCounts

public static long[] getByteCounts(Device dev,
                                   long timeStart,
                                   long timeEnd)
                            throws DBException
Throws:
DBException

getByteCounts

public static long[] getByteCounts(java.lang.String acctID,
                                   java.lang.String devID,
                                   long timeStart,
                                   long timeEnd)
                            throws DBException
Throws:
DBException

deleteRange

public static void deleteRange(Device device,
                               long timeStart,
                               long timeEnd)
                        throws DBException
Throws:
DBException

deleteRange

public static void deleteRange(java.lang.String acctID,
                               java.lang.String devID,
                               long timeStart,
                               long timeEnd)
                        throws DBException
Throws:
DBException

toString

public java.lang.String toString()
Description copied from class: DBRecord
Returns a String representation of the DBRecordKey for this DBRecord

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

setCreationDefaultValues

public void setCreationDefaultValues()
Description copied from class: DBRecord
Override to set default values

Overrides:
setCreationDefaultValues in class DBRecord<SessionStats>

recordWillInsert

protected void recordWillInsert()
Callback when record is about to be inserted into the table

Overrides:
recordWillInsert in class DBRecord<SessionStats>

recordDidInsert

protected void recordDidInsert()
Callback after record has been be inserted into the table

Overrides:
recordDidInsert in class DBRecord<SessionStats>

recordWillUpdate

protected void recordWillUpdate()
Callback when record is about to be updated in the table

Overrides:
recordWillUpdate in class DBRecord<SessionStats>

recordDidUpdate

protected void recordDidUpdate()
Callback after record has been be updated in the table

Overrides:
recordDidUpdate in class DBRecord<SessionStats>

main

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