|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.dbtools.DBRecord<RT> org.opengts.db.AccountRecord<Driver> org.opengts.db.tables.Driver
public class Driver
Nested Class Summary | |
---|---|
static class |
Driver.DutyStatus
|
static class |
Driver.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 long |
DutyStatus_DRIVING
|
static long |
DutyStatus_INVALID
|
static long |
DutyStatus_OFF_DUTY
|
static long |
DutyStatus_ON_DUTY
|
static long |
DutyStatus_SLEEPING
|
static long |
DutyStatus_UNKNOWN
|
static java.lang.String |
FLD_address
|
static java.lang.String |
FLD_badgeID
|
static java.lang.String |
FLD_birthdate
|
static java.lang.String |
FLD_contactEmail
|
static java.lang.String |
FLD_contactPhone
|
static java.lang.String |
FLD_deviceID
|
static java.lang.String |
FLD_driverID
|
static java.lang.String |
FLD_driverStatus
|
static java.lang.String |
FLD_dutyStatus
|
static java.lang.String |
FLD_licenseExpire
|
static java.lang.String |
FLD_licenseNumber
|
static java.lang.String |
FLD_licenseType
|
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 | |
---|---|
Driver()
|
|
Driver(Driver.Key key)
|
Method Summary | |
---|---|
static Driver |
createNewDriver(Account account,
java.lang.String drvID)
|
static void |
cron(java.lang.String[] args)
|
static boolean |
exists(java.lang.String acctID,
java.lang.String drvID)
Returns true if the specified driver exists |
java.lang.String |
getAddress()
Gets the driver address |
java.lang.String |
getBadgeID()
Gets the driver badge ID |
long |
getBirthdate()
Gets the driver birthdate as a DayNumber value |
java.lang.String |
getContactEmail()
|
java.lang.String |
getContactPhone()
|
Device |
getDevice()
Returns the Device instance for the defined device-id |
java.lang.String |
getDeviceDescription()
Returns the description for the assigned DeviceID |
java.lang.String |
getDeviceID()
Gets the driver associated device ID (if available) |
static Driver |
getDriver(Account account,
java.lang.String drvID)
Get Driver record instance for the specified account/driverID |
static Driver |
getDriver(Account account,
java.lang.String drvID,
boolean create)
|
java.lang.String |
getDriverID()
|
static OrderedSet<java.lang.String> |
getDriverIDsForAccount(java.lang.String acctId)
|
static OrderedSet<java.lang.String> |
getDriverIDsForAccount(java.lang.String acctId,
long limit)
|
long |
getDriverStatus()
Gets the driver/duty status |
long |
getDutyStatus()
Gets the duty status |
static Driver.DutyStatus |
getDutyStatus(Driver d)
Returns the defined DutyStatus for the specified driver. |
static Driver.DutyStatus |
getDutyStatus(long ds)
Returns the DutyStatus for the specified code. |
static java.lang.String |
getDutyStatusDescription(Driver.DutyStatus ds,
java.util.Locale loc)
Returns the short text description of the specified DutyStatus |
static DBFactory<Driver> |
getFactory()
|
long |
getLicenseExpire()
Gets the license expiration date as a DayNumber value |
java.lang.String |
getLicenseNumber()
|
java.lang.String |
getLicenseType()
|
static void |
getRecordCallback(Account account,
DBRecordHandler<Driver> rcdHandler)
Callback for returning all drivers for an Account |
static java.lang.String |
getTableDescription(java.util.Locale loc)
|
boolean |
hasDriverStatus()
Returns true if this driver has a defined driver-status (value > 0) |
boolean |
hasDutyStatus()
Returns true if this driver has a defined duty-status (value > 0) |
boolean |
isLicenseExpired(DayNumber asof)
Returns true if the license is expired as-of the specified date |
boolean |
isLicenseExpired(long asofDay)
Returns true if the license is expired as-of the specified date |
static void |
main(java.lang.String[] args)
|
void |
setAddress(java.lang.String v)
Sets the driver address |
void |
setBadgeID(java.lang.String v)
Sets the driver badge ID |
void |
setBirthdate(DayNumber dn)
Sets the driver birthdate as a DayNumber instance |
void |
setBirthdate(int year,
int month1,
int day)
Sets the driver birthdate |
void |
setBirthdate(long v)
Sets the driver birthdate as a DayNumber value |
void |
setContactEmail(java.lang.String v)
|
void |
setContactPhone(java.lang.String v)
|
void |
setCreationDefaultValues()
Override to set default values |
void |
setDeviceID(java.lang.String v)
Sets the driver associated device ID |
void |
setDriverID(java.lang.String v)
|
void |
setDriverStatus(long v)
Sets the driver/duty status |
void |
setDutyStatus(long v)
Sets the duty status |
void |
setLicenseExpire(DayNumber dn)
Sets the license expiration date as a DayNumber instance |
void |
setLicenseExpire(int year,
int month1,
int day)
Sets the license expiration date |
void |
setLicenseExpire(long v)
Sets the license expiration date as a DayNumber value |
void |
setLicenseNumber(java.lang.String v)
|
void |
setLicenseType(java.lang.String v)
|
static java.lang.String |
TABLE_NAME()
|
static boolean |
updateDriverStatus(Account acct,
java.lang.String drvID,
long status)
Sets/Updates the driver-status for the specified DriverID |
static boolean |
updateDutyStatus(Account acct,
java.lang.String drvID,
long status)
Sets/Updates the duty-status for the specified DriverID |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long DutyStatus_INVALID
public static final long DutyStatus_UNKNOWN
public static final long DutyStatus_OFF_DUTY
public static final long DutyStatus_SLEEPING
public static final long DutyStatus_DRIVING
public static final long DutyStatus_ON_DUTY
public static final java.lang.String _TABLE_NAME
public static final java.lang.String FLD_driverID
public static final java.lang.String FLD_contactPhone
public static final java.lang.String FLD_contactEmail
public static final java.lang.String FLD_licenseType
public static final java.lang.String FLD_licenseNumber
public static final java.lang.String FLD_licenseExpire
public static final java.lang.String FLD_badgeID
public static final java.lang.String FLD_address
public static final java.lang.String FLD_birthdate
public static final java.lang.String FLD_deviceID
public static final java.lang.String FLD_driverStatus
public static final java.lang.String FLD_dutyStatus
Constructor Detail |
---|
public Driver()
public Driver(Driver.Key key)
Method Detail |
---|
public static Driver.DutyStatus getDutyStatus(long ds)
ds
- The duty code
public static Driver.DutyStatus getDutyStatus(Driver d)
d
- The driver from which the DutyStatus will be obtained.
If null, the default DutyStatus will be returned.
public static java.lang.String getDutyStatusDescription(Driver.DutyStatus ds, java.util.Locale loc)
ds
- The DutyStatusloc
- The desired Locale
public static java.lang.String TABLE_NAME()
public static DBFactory<Driver> getFactory()
public static java.lang.String getTableDescription(java.util.Locale loc)
public java.lang.String getDriverID()
public void setDriverID(java.lang.String v)
public boolean hasDriverStatus()
public long getDriverStatus()
public void setDriverStatus(long v)
v
- The driver/duty statuspublic static boolean updateDriverStatus(Account acct, java.lang.String drvID, long status) throws DBException
acct
- The AccountdrvID
- The driver-idstatus
- The driver status
DBException
public boolean hasDutyStatus()
public long getDutyStatus()
public void setDutyStatus(long v)
v
- The duty statuspublic static boolean updateDutyStatus(Account acct, java.lang.String drvID, long status) throws DBException
acct
- The AccountdrvID
- The driver-idstatus
- The duty status
DBException
public java.lang.String getContactPhone()
public void setContactPhone(java.lang.String v)
public java.lang.String getContactEmail()
public void setContactEmail(java.lang.String v)
public java.lang.String getLicenseType()
public void setLicenseType(java.lang.String v)
public java.lang.String getLicenseNumber()
public void setLicenseNumber(java.lang.String v)
public long getLicenseExpire()
public void setLicenseExpire(long v)
v
- The license expiration date as a DayNumber valuepublic void setLicenseExpire(int year, int month1, int day)
year
- The expiration yearmonth1
- The expiration monthday
- The expiration daypublic void setLicenseExpire(DayNumber dn)
dn
- The license expiration date as a DayNumber instancepublic boolean isLicenseExpired(long asofDay)
asofDay
- The as-of expiration test DayNumberpublic boolean isLicenseExpired(DayNumber asof)
asof
- The as-of expiration test DayNumberpublic java.lang.String getBadgeID()
public void setBadgeID(java.lang.String v)
v
- The driver badge IDpublic java.lang.String getAddress()
public void setAddress(java.lang.String v)
v
- The driver addresspublic long getBirthdate()
public void setBirthdate(long v)
v
- The driver birthdate as a DayNumber valuepublic void setBirthdate(int year, int month1, int day)
year
- The driver birthdate yearmonth1
- The driver birthdate monthday
- The driver birthdate daypublic void setBirthdate(DayNumber dn)
dn
- The driver birthdate as a DayNumber instancepublic java.lang.String getDeviceID()
public void setDeviceID(java.lang.String v)
v
- The driver associated device IDpublic Device getDevice()
public java.lang.String getDeviceDescription()
public void setCreationDefaultValues()
DBRecord
setCreationDefaultValues
in class DBRecord<Driver>
public static boolean exists(java.lang.String acctID, java.lang.String drvID) throws DBException
acctID
- The Account IDdrvID
- The driver ID
DBException
public static Driver getDriver(Account account, java.lang.String drvID) throws DBException
account
- The Account instancedrvID
- The driver ID
DBException
public static Driver getDriver(Account account, java.lang.String drvID, boolean create) throws DBException
DBException
public static Driver createNewDriver(Account account, java.lang.String drvID) throws DBException
DBException
public static OrderedSet<java.lang.String> getDriverIDsForAccount(java.lang.String acctId) throws DBException
DBException
public static OrderedSet<java.lang.String> getDriverIDsForAccount(java.lang.String acctId, long limit) throws DBException
DBException
public static void getRecordCallback(Account account, DBRecordHandler<Driver> rcdHandler) throws DBException
account
- The accountrcdHandler
- The DBRecordHandler
DBException
public static void cron(java.lang.String[] args)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |