org.opengts.db.tables
Class StatusCode

java.lang.Object
  extended by org.opengts.dbtools.DBRecord<RT>
      extended by org.opengts.db.AccountRecord<RT>
          extended by org.opengts.db.DeviceRecord<StatusCode>
              extended by org.opengts.db.tables.StatusCode
All Implemented Interfaces:
StatusCodeProvider

public class StatusCode
extends DeviceRecord<StatusCode>
implements StatusCodeProvider


Nested Class Summary
static class StatusCode.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 ALL_DEVICES
           
static java.lang.String FLD_backgroundColor
           
static java.lang.String FLD_foregroundColor
           
static java.lang.String FLD_iconName
           
static java.lang.String FLD_iconSelector
           
static java.lang.String FLD_statusCode
           
static java.lang.String FLD_statusName
           
 
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
StatusCode()
           
StatusCode(StatusCode.Key key)
           
 
Method Summary
static StatusCode createNewStatusCode(Account account, java.lang.String deviceID, int code)
           
static boolean exists(java.lang.String accountID, java.lang.String deviceID, int code)
           
static StatusCode findStatusCode(java.lang.String accountID, java.lang.String deviceID, int statusCode)
           
 java.lang.String getBackgroundColor()
          Gets the String represntation of the background color
static java.lang.String getBackgroundColor(Device device, int statusCode, BasicPrivateLabel bpl, java.lang.String dftColor)
           
static java.lang.String getBackgroundColor(java.lang.String accountID, int statusCode, BasicPrivateLabel bpl, java.lang.String dftColor)
           
 CssStyle getCssStyle()
          Returns a CssStyle instance if this status code has any foreground/background color, or null if no colors are defined.
static java.lang.String getDescription(Device device, int statusCode, BasicPrivateLabel bpl, java.lang.String dftDesc)
           
 java.lang.String getDescription(java.util.Locale locale)
          StatusCodeProvider interface
Gets the Decription of this status code
static java.lang.String getDescription(java.lang.String accountID, int statusCode, BasicPrivateLabel bpl, java.lang.String dftDesc)
           
static DBFactory<StatusCode> getFactory()
           
 java.lang.String getForegroundColor()
          Gets the String represntation of the foreground color
static java.lang.String getForegroundColor(Device device, int statusCode, BasicPrivateLabel bpl, java.lang.String dftColor)
           
static java.lang.String getForegroundColor(java.lang.String accountID, int statusCode, BasicPrivateLabel bpl, java.lang.String dftColor)
           
 java.lang.String getHtmlDescription()
          Gets the description text with the foreground/background colors wrapped in a <div style="...">DESCRPTION</div>
 java.lang.String getIconName()
          Gets the Icon name
static java.lang.String getIconName(Device device, int statusCode, BasicPrivateLabel bpl)
           
 java.lang.String getIconSelector()
          Gets the Icon RuleFactory selector.
static java.lang.String getIconSelector(Device device, int statusCode, BasicPrivateLabel bpl)
           
 int getStatusCode()
          Gets the status code value
static StatusCode getStatusCode(Account account, java.lang.String deviceID, int code)
           
static StatusCode getStatusCode(Account account, java.lang.String deviceID, int code, boolean createOK)
           
static StatusCode getStatusCode(java.lang.String accountID, java.lang.String deviceID, int code)
           
static StatusCodeProvider getStatusCodeProvider(Device device, int statusCode, BasicPrivateLabel bpl, StatusCodeProvider dftSCP)
           
static StatusCodeProvider getStatusCodeProvider(java.lang.String accountID, int statusCode, BasicPrivateLabel bpl, StatusCodeProvider dftSCP)
           
static int[] getStatusCodes(java.lang.String accountID, java.lang.String deviceID)
           
 java.lang.String getStatusName()
          Gets the status code name
 java.lang.String getStyleString()
          Gets the CSS style string
static java.lang.String getTableDescription(java.util.Locale loc)
          Gets the table description
 boolean hasStyle()
          Returns true if this status code has foreground/background color
static void main(java.lang.String[] argv)
           
 void setBackgroundColor(ColorTools.RGB rgb)
          Sets the ColorTools.RGB represntation of the background color
 void setBackgroundColor(java.lang.String v)
          Sets the String represntation of the background color
 void setCreationDefaultValues()
          Callback to set the record creation default values
 void setForegroundColor(ColorTools.RGB rgb)
          Sets the ColorTools.RGB represntation of the foreground color
 void setForegroundColor(java.lang.String v)
          Sets the String represntation of the foreground color
 void setIconName(java.lang.String v)
          Sets the Icon name
 void setIconSelector(java.lang.String v)
          Sets the Icon RuleFactory selector.
 void setStatusCode(int v)
          Sets the status code value
 void setStatusName(java.lang.String v)
          Sets the status code name
static java.lang.String TABLE_NAME()
           
 java.lang.String toString()
          Gets the String representation
 
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, 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

ALL_DEVICES

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

_TABLE_NAME

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

FLD_statusCode

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

FLD_statusName

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

FLD_foregroundColor

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

FLD_backgroundColor

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

FLD_iconSelector

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

FLD_iconName

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

StatusCode

public StatusCode()

StatusCode

public StatusCode(StatusCode.Key key)
Method Detail

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<StatusCode> getFactory()

getTableDescription

public static java.lang.String getTableDescription(java.util.Locale loc)
Gets the table description

Returns:
The table description

getStatusCode

public int getStatusCode()
Gets the status code value

Specified by:
getStatusCode in interface StatusCodeProvider
Returns:
The status code value

setStatusCode

public void setStatusCode(int v)
Sets the status code value

Parameters:
v - The status code value

getStatusName

public java.lang.String getStatusName()
Gets the status code name

Returns:
The status code name

setStatusName

public void setStatusName(java.lang.String v)
Sets the status code name

Parameters:
v - The status code name

getForegroundColor

public java.lang.String getForegroundColor()
Gets the String represntation of the foreground color

Specified by:
getForegroundColor in interface StatusCodeProvider
Returns:
The foreground color

setForegroundColor

public void setForegroundColor(java.lang.String v)
Sets the String represntation of the foreground color

Parameters:
v - The foreground color

setForegroundColor

public void setForegroundColor(ColorTools.RGB rgb)
Sets the ColorTools.RGB represntation of the foreground color

Parameters:
rgb - The foreground color

getBackgroundColor

public java.lang.String getBackgroundColor()
Gets the String represntation of the background color

Specified by:
getBackgroundColor in interface StatusCodeProvider
Returns:
The background color

setBackgroundColor

public void setBackgroundColor(java.lang.String v)
Sets the String represntation of the background color

Parameters:
v - The background color

setBackgroundColor

public void setBackgroundColor(ColorTools.RGB rgb)
Sets the ColorTools.RGB represntation of the background color

Parameters:
rgb - The background color

getIconSelector

public java.lang.String getIconSelector()
Gets the Icon RuleFactory selector. (An active RuleFactory must be enabled)

Specified by:
getIconSelector in interface StatusCodeProvider
Returns:
The Icon selector

setIconSelector

public void setIconSelector(java.lang.String v)
Sets the Icon RuleFactory selector. (An active RuleFactory must be enabled)

Parameters:
v - The Icon selector

getIconName

public java.lang.String getIconName()
Gets the Icon name

Specified by:
getIconName in interface StatusCodeProvider
Returns:
The Icon name

setIconName

public void setIconName(java.lang.String v)
Sets the Icon name

Parameters:
v - The Icon name

getDescription

public java.lang.String getDescription(java.util.Locale locale)
StatusCodeProvider interface
Gets the Decription of this status code

Specified by:
getDescription in interface StatusCodeProvider
Parameters:
locale - The Locale (currently ignored)
Returns:
The status code description

hasStyle

public boolean hasStyle()
Returns true if this status code has foreground/background color

Specified by:
hasStyle in interface StatusCodeProvider
Returns:
True if this status code has foreground/background color

getCssStyle

public CssStyle getCssStyle()
Returns a CssStyle instance if this status code has any foreground/background color, or null if no colors are defined.

Returns:
The CssStyle instance.

getStyleString

public java.lang.String getStyleString()
Gets the CSS style string

Specified by:
getStyleString in interface StatusCodeProvider

getHtmlDescription

public java.lang.String getHtmlDescription()
Gets the description text with the foreground/background colors wrapped in a <div style="...">DESCRPTION</div>


toString

public java.lang.String toString()
Gets the String representation

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

setCreationDefaultValues

public void setCreationDefaultValues()
Callback to set the record creation default values

Overrides:
setCreationDefaultValues in class DBRecord<StatusCode>

findStatusCode

public static StatusCode findStatusCode(java.lang.String accountID,
                                        java.lang.String deviceID,
                                        int statusCode)

getStatusCodeProvider

public static StatusCodeProvider getStatusCodeProvider(Device device,
                                                       int statusCode,
                                                       BasicPrivateLabel bpl,
                                                       StatusCodeProvider dftSCP)

getStatusCodeProvider

public static StatusCodeProvider getStatusCodeProvider(java.lang.String accountID,
                                                       int statusCode,
                                                       BasicPrivateLabel bpl,
                                                       StatusCodeProvider dftSCP)

getDescription

public static java.lang.String getDescription(Device device,
                                              int statusCode,
                                              BasicPrivateLabel bpl,
                                              java.lang.String dftDesc)

getDescription

public static java.lang.String getDescription(java.lang.String accountID,
                                              int statusCode,
                                              BasicPrivateLabel bpl,
                                              java.lang.String dftDesc)

getForegroundColor

public static java.lang.String getForegroundColor(Device device,
                                                  int statusCode,
                                                  BasicPrivateLabel bpl,
                                                  java.lang.String dftColor)

getForegroundColor

public static java.lang.String getForegroundColor(java.lang.String accountID,
                                                  int statusCode,
                                                  BasicPrivateLabel bpl,
                                                  java.lang.String dftColor)

getBackgroundColor

public static java.lang.String getBackgroundColor(Device device,
                                                  int statusCode,
                                                  BasicPrivateLabel bpl,
                                                  java.lang.String dftColor)

getBackgroundColor

public static java.lang.String getBackgroundColor(java.lang.String accountID,
                                                  int statusCode,
                                                  BasicPrivateLabel bpl,
                                                  java.lang.String dftColor)

getIconSelector

public static java.lang.String getIconSelector(Device device,
                                               int statusCode,
                                               BasicPrivateLabel bpl)

getIconName

public static java.lang.String getIconName(Device device,
                                           int statusCode,
                                           BasicPrivateLabel bpl)

exists

public static boolean exists(java.lang.String accountID,
                             java.lang.String deviceID,
                             int code)
                      throws DBException
Throws:
DBException

getStatusCode

public static StatusCode getStatusCode(java.lang.String accountID,
                                       java.lang.String deviceID,
                                       int code)
                                throws DBException
Throws:
DBException

getStatusCode

public static StatusCode getStatusCode(Account account,
                                       java.lang.String deviceID,
                                       int code)
                                throws DBException
Throws:
DBException

getStatusCode

public static StatusCode getStatusCode(Account account,
                                       java.lang.String deviceID,
                                       int code,
                                       boolean createOK)
                                throws DBException
Throws:
DBException

createNewStatusCode

public static StatusCode createNewStatusCode(Account account,
                                             java.lang.String deviceID,
                                             int code)
                                      throws DBException
Throws:
DBException

getStatusCodes

public static int[] getStatusCodes(java.lang.String accountID,
                                   java.lang.String deviceID)
                            throws DBException
Throws:
DBException

main

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