org.opengts.db
Class AccountRecord<RT extends DBRecord>

java.lang.Object
  extended by org.opengts.dbtools.DBRecord<RT>
      extended by org.opengts.db.AccountRecord<RT>
Direct Known Subclasses:
Account, AccountString, DeviceRecord, Driver, Entity, Geozone, GroupRecord, HierarchyRecord, PointsOfInterest, ReportJob, Resource, RoleRecord, Rule, SystemAudit, Transport, UserRecord

public class AccountRecord<RT extends DBRecord>
extends DBRecord<RT>


Nested Class Summary
static class AccountRecord.AccountKey<RT extends DBRecord>
           
 
Nested classes/interfaces inherited from class org.opengts.dbtools.DBRecord
DBRecord.DBChangeListener
 
Field Summary
static java.lang.String FLD_accountID
           
static java.lang.String FLD_displayName
           
static java.lang.String FLD_isActive
           
static java.lang.String 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
AccountRecord()
           
AccountRecord(AccountRecord.AccountKey<RT> key)
           
 
Method Summary
static Account createSystemAdminAccount(java.lang.String password)
           
 Account getAccount()
           
 java.lang.String getAccountDescription()
          Return the description for this DBRecord's Account
 java.lang.String getAccountID()
           
 java.lang.String getDisplayName()
           
static java.lang.String getFilteredID(java.lang.String id)
          Returns a filtered ID with all invalid characters removed.
static java.lang.String getFilteredID(java.lang.String id, boolean nullOnError, boolean lowerCase)
          Returns a filtered ID with all invalid characters removed.
 boolean getIsActive()
           
 java.lang.String getNotes()
           
static java.lang.String GetSimpleLocalString(java.lang.String v, java.util.Locale loc)
          Attempts to return a localized String based on the specified value.
static Account getSystemAdminAccount()
           
static java.lang.String getSystemAdminAccountID()
           
 boolean hasAccount()
           
static boolean hasSystemAdminAccountID()
           
static boolean isAccountManager(Account account)
           
 boolean isActive()
           
 boolean isSystemAdmin()
           
static boolean isSystemAdmin(Account account)
           
static boolean isSystemAdminAccountID(java.lang.String acctID)
           
static boolean isValidID(java.lang.String id)
          Returns true if the id is valid
protected static DBField newField_accountID(boolean priKey)
           
protected static DBField newField_accountID(boolean priKey, java.lang.String xAttr)
           
protected static DBField newField_displayName()
           
protected static DBField newField_displayName(java.lang.String xAttr)
           
protected static DBField newField_isActive()
           
protected static DBField newField_isActive(java.lang.String xAttr)
           
protected static DBField newField_notes()
           
protected static DBField newField_notes(java.lang.String xAttr)
           
 void setAccount(Account acct)
           
 void setDisplayName(java.lang.String v)
           
 void setIsActive(boolean v)
           
 void setNotes(java.lang.String v)
           
 void setRuntimeDefaultValues()
          Sets the runtime default values.
 
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, getTableDescription, 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, setCreationDefaultValues, 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, toString, 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

FLD_accountID

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

FLD_isActive

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

FLD_displayName

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

FLD_notes

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

AccountRecord

public AccountRecord()

AccountRecord

public AccountRecord(AccountRecord.AccountKey<RT> key)
Method Detail

GetSimpleLocalString

public static java.lang.String GetSimpleLocalString(java.lang.String v,
                                                    java.util.Locale loc)
Attempts to return a localized String based on the specified value.

Parameters:
v - The value for which the localized string is returned.
loc - The Locale
Returns:
The localized value for the specified String, or the value unchanged if no match is found for the specified String.

newField_accountID

protected static DBField newField_accountID(boolean priKey)

newField_accountID

protected static DBField newField_accountID(boolean priKey,
                                            java.lang.String xAttr)

newField_isActive

protected static DBField newField_isActive()

newField_isActive

protected static DBField newField_isActive(java.lang.String xAttr)

newField_displayName

protected static DBField newField_displayName()

newField_displayName

protected static DBField newField_displayName(java.lang.String xAttr)

newField_notes

protected static DBField newField_notes()

newField_notes

protected static DBField newField_notes(java.lang.String xAttr)

getFilteredID

public static java.lang.String getFilteredID(java.lang.String id)
Returns a filtered ID with all invalid characters removed. If the resulting ID contains no valid characters, null will be returned.

Parameters:
id - The specified ID to filter
Returns:
The filtered ID, or null if the specified id contains no valid characters.

getFilteredID

public static java.lang.String getFilteredID(java.lang.String id,
                                             boolean nullOnError,
                                             boolean lowerCase)
Returns a filtered ID with all invalid characters removed. If the resulting ID contains no valid characters, null will be returned.

Parameters:
id - The specified ID to filter
nullOnError - If true, return 'null' immediately if the id contains any invalid characters.
lowerCase - If true, return the filtered ID in lower case.
Returns:
The filtered ID, or null if the specified id contains no valid characters.

isValidID

public static boolean isValidID(java.lang.String id)
Returns true if the id is valid

Returns:
True if the id is valid

getAccountID

public final java.lang.String getAccountID()

isSystemAdmin

public final boolean isSystemAdmin()

getSystemAdminAccountID

public static java.lang.String getSystemAdminAccountID()

hasSystemAdminAccountID

public static boolean hasSystemAdminAccountID()

isSystemAdminAccountID

public static boolean isSystemAdminAccountID(java.lang.String acctID)

isSystemAdmin

public static boolean isSystemAdmin(Account account)

getSystemAdminAccount

public static Account getSystemAdminAccount()
                                     throws DBException
Throws:
DBException

createSystemAdminAccount

public static Account createSystemAdminAccount(java.lang.String password)
                                        throws DBException
Throws:
DBException

isAccountManager

public static boolean isAccountManager(Account account)

getIsActive

public boolean getIsActive()

setIsActive

public final void setIsActive(boolean v)

isActive

public final boolean isActive()

getDisplayName

public final java.lang.String getDisplayName()

setDisplayName

public final void setDisplayName(java.lang.String v)

getNotes

public java.lang.String getNotes()

setNotes

public void setNotes(java.lang.String v)

hasAccount

public final boolean hasAccount()

getAccount

public final Account getAccount()

setAccount

public final void setAccount(Account acct)

getAccountDescription

public final java.lang.String getAccountDescription()
Return the description for this DBRecord's Account

Returns:
The Account description

setRuntimeDefaultValues

public void setRuntimeDefaultValues()
Sets the runtime default values. This method will attempt to first look up the property value from the PrivateLabel file.

Overrides:
setRuntimeDefaultValues in class DBRecord<RT extends DBRecord>