org.opengts.extra.tables
Class Entity

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

public class Entity
extends AccountRecord<Entity>


Nested Class Summary
static class Entity.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 int AddressColumnLength
           
static java.lang.String FLD_address
           
static java.lang.String FLD_altitude
           
static java.lang.String FLD_deviceID
           
static java.lang.String FLD_deviceOdomKM
           
static java.lang.String FLD_entityID
           
static java.lang.String FLD_entityType
           
static java.lang.String FLD_isAttached
           
static java.lang.String FLD_latitude
           
static java.lang.String FLD_longitude
           
static java.lang.String FLD_odometerKM
           
static java.lang.String FLD_statusCode
           
static java.lang.String FLD_timestamp
           
static double MAX_ENTITY_ODOM_KM
           
 
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
Entity()
           
Entity(Entity.Key key)
           
 
Method Summary
 void addDeltaOdometerKM(double deltaKM)
           
static Entity createNewEntity(Account account, java.lang.String entityID, long entityType, java.lang.String description)
           
static boolean exists(java.lang.String accountID, java.lang.String entityID, long entityType)
           
 java.lang.String getAddress()
           
 double getAltitude()
           
static Entity[] getAttachedEntities(java.lang.String accountID, java.lang.String deviceID, long entityType)
           
static Entity[] getAttachedEntities(java.lang.String accountID, java.lang.String deviceID, long entityType, DBRecordHandler<Entity> handler)
           
static java.lang.String[] getAttachedEntityDescriptions(java.lang.String accountID, java.lang.String deviceID, long entityType)
           
static java.lang.String[] getAttachedEntityIDs(java.lang.String accountID, java.lang.String deviceID, long entityType)
           
 java.lang.String getDeviceID()
           
 double getDeviceOdomKM()
           
static Entity[] getEntitiesForAccount(java.lang.String accountID)
           
static Entity[] getEntitiesForAccount(java.lang.String accountID, long limit)
           
static Entity[] getEntitiesForAccount(java.lang.String accountID, long limit, DBRecordHandler<Entity> handler)
           
static Entity getEntity(Account account, java.lang.String entityID, long entityType)
           
static Entity getEntity(Account account, java.lang.String entityID, long entityType, boolean createOK)
           
static Entity getEntity(java.lang.String accountID, java.lang.String entityID, long entityType)
           
static java.lang.String getEntityDescription(java.lang.String accountID, java.lang.String entityID, long entityType)
           
 java.lang.String getEntityID()
           
static OrderedSet<java.lang.String> getEntityIDsForAccount(java.lang.String accountID)
           
static OrderedSet<java.lang.String> getEntityIDsForAccount(java.lang.String accountID, long limit)
           
static OrderedSet<java.lang.String> getEntityIDsForAccount(java.lang.String accountID, long limit, DBRecordHandler<Entity> handler)
           
 long getEntityType()
           
static DBFactory<Entity> getFactory()
           
 GeoPoint getGeoPoint()
           
 boolean getIsAttached()
           
 double getLatitude()
           
 double getLongitude()
           
 double getOdometerKM()
           
 int getStatusCode()
          Gets the last event status code for this entity
static java.lang.String getTableDescription(java.util.Locale loc)
           
 long getTimestamp()
           
 java.lang.String getTimestampString()
           
static java.lang.String[] GetTitles(java.util.Locale loc)
           
static boolean insertEntityChange(EventData event)
           
 boolean isAttached()
           
static boolean isEntityAttached(java.lang.String accountID, java.lang.String deviceID, java.lang.String entityID, long entityType)
           
static void main(java.lang.String[] argv)
           
 void setAddress(java.lang.String v)
           
 void setAltitude(double v)
           
 void setCreationDefaultValues()
          Override to set default values
 void setDeviceOdomKM(double v)
           
 void setEntityType(EntityManager.EntityType v)
           
 void setEntityType(long v)
           
 void setEntityType(java.lang.String v, java.util.Locale locale)
           
 void setGeoPoint(double lat, double lng)
           
 void setGeoPoint(GeoPoint gp)
           
 void setIsAttached(boolean v)
           
 void setLatitude(double v)
           
 void setLongitude(double v)
           
 void setOdometerKM(double v)
           
 void setStatusCode(int v)
          Sets the last event status code for this entity
 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.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

MAX_ENTITY_ODOM_KM

public static final double MAX_ENTITY_ODOM_KM
See Also:
Constant Field Values

AddressColumnLength

public static int AddressColumnLength

_TABLE_NAME

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

FLD_entityID

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

FLD_entityType

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

FLD_timestamp

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

FLD_statusCode

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

FLD_isAttached

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

FLD_deviceID

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

FLD_deviceOdomKM

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

FLD_latitude

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

FLD_longitude

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

FLD_altitude

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

FLD_address

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

FLD_odometerKM

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

Entity

public Entity()

Entity

public Entity(Entity.Key key)
Method Detail

GetTitles

public static java.lang.String[] GetTitles(java.util.Locale loc)

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<Entity> getFactory()

getTableDescription

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

getEntityID

public java.lang.String getEntityID()

getEntityType

public long getEntityType()

setEntityType

public void setEntityType(long v)

setEntityType

public void setEntityType(EntityManager.EntityType v)

setEntityType

public void setEntityType(java.lang.String v,
                          java.util.Locale locale)

getTimestamp

public long getTimestamp()

setTimestamp

public void setTimestamp(long v)

getTimestampString

public java.lang.String getTimestampString()

getStatusCode

public int getStatusCode()
Gets the last event status code for this entity

Returns:
The last event status code for this entity

setStatusCode

public void setStatusCode(int v)
Sets the last event status code for this entity

Parameters:
v - The last event status code for this entity

getIsAttached

public boolean getIsAttached()

setIsAttached

public void setIsAttached(boolean v)

isAttached

public boolean isAttached()

getDeviceID

public java.lang.String getDeviceID()

getLatitude

public double getLatitude()

setLatitude

public void setLatitude(double v)

getLongitude

public double getLongitude()

setLongitude

public void setLongitude(double v)

getGeoPoint

public GeoPoint getGeoPoint()

setGeoPoint

public void setGeoPoint(double lat,
                        double lng)

setGeoPoint

public void setGeoPoint(GeoPoint gp)

getAltitude

public double getAltitude()

setAltitude

public void setAltitude(double v)

getAddress

public java.lang.String getAddress()

setAddress

public void setAddress(java.lang.String v)

getDeviceOdomKM

public double getDeviceOdomKM()

setDeviceOdomKM

public void setDeviceOdomKM(double v)

getOdometerKM

public double getOdometerKM()

setOdometerKM

public void setOdometerKM(double v)

addDeltaOdometerKM

public void addDeltaOdometerKM(double deltaKM)

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<Entity>
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<Entity>

getAttachedEntityIDs

public static java.lang.String[] getAttachedEntityIDs(java.lang.String accountID,
                                                      java.lang.String deviceID,
                                                      long entityType)
                                               throws DBException
Throws:
DBException

getAttachedEntityDescriptions

public static java.lang.String[] getAttachedEntityDescriptions(java.lang.String accountID,
                                                               java.lang.String deviceID,
                                                               long entityType)
                                                        throws DBException
Throws:
DBException

getAttachedEntities

public static Entity[] getAttachedEntities(java.lang.String accountID,
                                           java.lang.String deviceID,
                                           long entityType)
                                    throws DBException
Throws:
DBException

getAttachedEntities

public static Entity[] getAttachedEntities(java.lang.String accountID,
                                           java.lang.String deviceID,
                                           long entityType,
                                           DBRecordHandler<Entity> handler)
                                    throws DBException
Throws:
DBException

insertEntityChange

public static boolean insertEntityChange(EventData event)

getEntityDescription

public static java.lang.String getEntityDescription(java.lang.String accountID,
                                                    java.lang.String entityID,
                                                    long entityType)

isEntityAttached

public static boolean isEntityAttached(java.lang.String accountID,
                                       java.lang.String deviceID,
                                       java.lang.String entityID,
                                       long entityType)

getEntity

public static Entity getEntity(java.lang.String accountID,
                               java.lang.String entityID,
                               long entityType)
                        throws DBException
Throws:
DBException

getEntity

public static Entity getEntity(Account account,
                               java.lang.String entityID,
                               long entityType)
                        throws DBException
Throws:
DBException

getEntity

public static Entity getEntity(Account account,
                               java.lang.String entityID,
                               long entityType,
                               boolean createOK)
                        throws DBException
Throws:
DBException

getEntitiesForAccount

public static Entity[] getEntitiesForAccount(java.lang.String accountID)
                                      throws DBException
Throws:
DBException

getEntitiesForAccount

public static Entity[] getEntitiesForAccount(java.lang.String accountID,
                                             long limit)
                                      throws DBException
Throws:
DBException

getEntitiesForAccount

public static Entity[] getEntitiesForAccount(java.lang.String accountID,
                                             long limit,
                                             DBRecordHandler<Entity> handler)
                                      throws DBException
Throws:
DBException

getEntityIDsForAccount

public static OrderedSet<java.lang.String> getEntityIDsForAccount(java.lang.String accountID)
                                                           throws DBException
Throws:
DBException

getEntityIDsForAccount

public static OrderedSet<java.lang.String> getEntityIDsForAccount(java.lang.String accountID,
                                                                  long limit)
                                                           throws DBException
Throws:
DBException

getEntityIDsForAccount

public static OrderedSet<java.lang.String> getEntityIDsForAccount(java.lang.String accountID,
                                                                  long limit,
                                                                  DBRecordHandler<Entity> handler)
                                                           throws DBException
Throws:
DBException

exists

public static boolean exists(java.lang.String accountID,
                             java.lang.String entityID,
                             long entityType)
                      throws DBException
Throws:
DBException

createNewEntity

public static Entity createNewEntity(Account account,
                                     java.lang.String entityID,
                                     long entityType,
                                     java.lang.String description)
                              throws DBException
Throws:
DBException

main

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