org.opengts.db.tables
Class Device

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

public class Device
extends DeviceRecord<Device>
implements DataTransport

This class represents a tracked asset (ie. something that is being tracked). Currently, this DBRecord also represents the tracking hardware device as well.


Nested Class Summary
static class Device.BorderCrossingState
          BorderCrossing enabled state enumeration
static class Device.DeviceDescriptionComparator
          Comparator optimized for EventData device description
static interface Device.EventDataHandler
          EventDataHandler interface
static class Device.FuelEconomyType
          FuelEconomy Type enumeration
static class Device.GeozoneTransition
          Geozone transition container for providing arrive/depart events
static class Device.Key
          Device record key
static class Device.NearbyDevice
          Container class for a detected nearby device
static class Device.ReminderType
          Reminder Type enumeration
 
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 boolean ALLOW_USE_EMAIL_WRAPPER
           
static DBField[] AttributeInfo
           
static boolean AUTO_GENERATE_NON_MOVING_EVENT
           
static DBField[] BorderCrossingFieldInfo
           
static boolean CACHE_STATUS_CODE_DESCRIPTIONS
           
static boolean CHECK_LAST_ODOMETER
           
static DBField[] DataPushInfo
           
static WorkHours DefaultWorkHours
           
static boolean DEFERRED_RULE_CHECK
           
static DBField[] ELogHOSInfo
           
static Device[] EMPTY_ARRAY
           
static double EPS_ALPHA
           
static long EPS_RANGE_MS
           
static long EPS_RANGE_SECONDS
           
static double EPS_WEIGHT
           
static double EVENT_START_MOTION_RADIUS_M
           
static DBField[] FixedLocationFieldInfo
           
static java.lang.String FLD_activeCorridor
           
static java.lang.String FLD_allowNotify
           
static java.lang.String FLD_assignedUserID
           
static java.lang.String FLD_borderCrossing
           
static java.lang.String FLD_codeVersion
           
static java.lang.String FLD_commandStateMask
           
static java.lang.String FLD_customAttributes
           
static java.lang.String FLD_dataKey
           
static java.lang.String FLD_dcsCommandHost
           
static java.lang.String FLD_dcsConfigMask
           
static java.lang.String FLD_dcsConfigString
           
static java.lang.String FLD_dcsPropertiesID
           
static java.lang.String FLD_deviceCode
           
static java.lang.String FLD_deviceType
           
static java.lang.String FLD_displayColor
           
static java.lang.String FLD_driverID
           
static java.lang.String FLD_driverStatus
           
static java.lang.String FLD_duplexMaxConn
           
static java.lang.String FLD_duplexMaxConnPerMin
           
static java.lang.String FLD_duplexProfileMask
           
static java.lang.String FLD_eLogEnabled
           
static java.lang.String FLD_engineHoursOffset
           
static java.lang.String FLD_equipmentStatus
           
static java.lang.String FLD_equipmentType
           
static java.lang.String FLD_expectAck
           
static java.lang.String FLD_expectAckCode
           
static java.lang.String FLD_expirationTime
           
static java.lang.String FLD_featureSet
           
static java.lang.String FLD_fixedAddress
           
static java.lang.String FLD_fixedContactPhone
           
static java.lang.String FLD_fixedLatitude
           
static java.lang.String FLD_fixedLongitude
           
static java.lang.String FLD_fixedServiceTime
           
static java.lang.String FLD_fuelCapacity
           
static java.lang.String FLD_fuelCostPerLiter
           
static java.lang.String FLD_fuelEconomy
           
static java.lang.String FLD_fuelRatePerHour
           
static java.lang.String FLD_fuelTankProfile
           
static java.lang.String FLD_groupID
           
static java.lang.String FLD_hoursOfOperation
           
static java.lang.String FLD_ignitionIndex
           
static java.lang.String FLD_imeiNumber
           
static java.lang.String FLD_installTime
           
static java.lang.String FLD_insuranceExpire
           
static java.lang.String FLD_ipAddressCurrent
           
static java.lang.String FLD_ipAddressLocal
           
static java.lang.String FLD_ipAddressValid
           
static java.lang.String FLD_jobLatitude
           
static java.lang.String FLD_jobLongitude
           
static java.lang.String FLD_jobNumber
           
static java.lang.String FLD_jobRadius
           
static java.lang.String FLD_lastAckCommand
           
static java.lang.String FLD_lastAckResponse
           
static java.lang.String FLD_lastAckTime
           
static java.lang.String FLD_lastBatteryLevel
           
static java.lang.String FLD_lastBorderCrossTime
           
static java.lang.String FLD_lastCellServingInfo
           
static java.lang.String FLD_lastDataPushTime
           
static java.lang.String FLD_lastDistanceKM
           
static java.lang.String FLD_lastDuplexConnectTime
           
static java.lang.String FLD_lastELogState
           
static java.lang.String FLD_lastEngineHours
           
static java.lang.String FLD_lastEngineOffTime
           
static java.lang.String FLD_lastEngineOnHours
           
static java.lang.String FLD_lastEngineOnTime
           
static java.lang.String FLD_lastEventCreateMillis
           
static java.lang.String FLD_lastEventsPerSecond
           
static java.lang.String FLD_lastEventsPerSecondMS
           
static java.lang.String FLD_lastEventTimestamp
           
static java.lang.String FLD_lastFaultCode
           
static java.lang.String FLD_lastFuelLevel
           
static java.lang.String FLD_lastFuelTotal
           
static java.lang.String FLD_lastGPSTimestamp
           
static java.lang.String FLD_lastIgnitionHours
           
static java.lang.String FLD_lastIgnitionOffTime
           
static java.lang.String FLD_lastIgnitionOnHours
           
static java.lang.String FLD_lastIgnitionOnTime
           
static java.lang.String FLD_lastInputState
           
static java.lang.String FLD_lastMalfunctionLamp
           
static java.lang.String FLD_lastNotifyCode
           
static java.lang.String FLD_lastNotifyRule
           
static java.lang.String FLD_lastNotifyTime
           
static java.lang.String FLD_lastOdometerKM
           
static java.lang.String FLD_lastOilLevel
           
static java.lang.String FLD_lastOutputState
           
static java.lang.String FLD_lastPingTime
           
static java.lang.String FLD_lastServiceTime
           
static java.lang.String FLD_lastStartTime
           
static java.lang.String FLD_lastStopTime
           
static java.lang.String FLD_lastSubdivision
           
static java.lang.String FLD_lastTcpSessionID
           
static java.lang.String FLD_lastTotalConnectTime
           
static java.lang.String FLD_lastValidHeading
           
static java.lang.String FLD_lastValidLatitude
           
static java.lang.String FLD_lastValidLongitude
           
static java.lang.String FLD_lastValidSpeedKPH
           
static java.lang.String FLD_licenseExpire
           
static java.lang.String FLD_licensePlate
           
static java.lang.String FLD_linkDescription
           
static java.lang.String FLD_linkURL
           
static java.lang.String FLD_listenPortCurrent
           
static java.lang.String FLD_maintEngHoursHR0
           
static java.lang.String FLD_maintIntervalHR0
           
static java.lang.String FLD_maintIntervalKM0
           
static java.lang.String FLD_maintIntervalKM1
           
static java.lang.String FLD_maintNotes
           
static java.lang.String FLD_maintOdometerKM0
           
static java.lang.String FLD_maintOdometerKM1
           
static java.lang.String FLD_maxAllowedEvents
           
static java.lang.String FLD_maxPassengers
           
static java.lang.String FLD_maxPingCount
           
static java.lang.String FLD_nextServiceTime
           
static java.lang.String FLD_notifyAction
           
static java.lang.String FLD_notifyDescription
           
static java.lang.String FLD_notifyEmail
           
static java.lang.String FLD_notifyPriority
           
static java.lang.String FLD_notifySelector
           
static java.lang.String FLD_notifySubject
           
static java.lang.String FLD_notifyText
           
static java.lang.String FLD_notifyUseWrapper
           
static java.lang.String FLD_odometerOffsetKM
           
static java.lang.String FLD_parkedLatitude
           
static java.lang.String FLD_parkedLongitude
           
static java.lang.String FLD_parkedMaxSpeedKPH
           
static java.lang.String FLD_parkedRadius
           
static java.lang.String FLD_pendingMessage
           
static java.lang.String FLD_pendingMessageACK
           
static java.lang.String FLD_pendingPingCommand
           
static java.lang.String FLD_pingCommandURI
           
static java.lang.String FLD_planDistanceKM
           
static java.lang.String FLD_proximityGroupID
           
static java.lang.String FLD_proximityMaximumAge
           
static java.lang.String FLD_proximityRadius
           
static java.lang.String FLD_pushpinID
           
static java.lang.String FLD_reminderInterval
           
static java.lang.String FLD_reminderMessage
           
static java.lang.String FLD_reminderTime
           
static java.lang.String FLD_reminderType
           
static java.lang.String FLD_remotePortCurrent
           
static java.lang.String FLD_resetTime
           
static java.lang.String FLD_serialNumber
           
static java.lang.String FLD_simID
           
static java.lang.String FLD_simPhoneNumber
           
static java.lang.String FLD_smsEmail
           
static java.lang.String FLD_speedLimitKPH
           
static java.lang.String FLD_statusCodeState
           
static java.lang.String FLD_supportedEncodings
           
static java.lang.String FLD_supportsDMTP
           
static java.lang.String FLD_thermalProfile
           
static java.lang.String FLD_totalMaxConn
           
static java.lang.String FLD_totalMaxConnPerMin
           
static java.lang.String FLD_totalPingCount
           
static java.lang.String FLD_totalProfileMask
           
static java.lang.String FLD_uniqueID
           
static java.lang.String FLD_unitLimitInterval
           
static java.lang.String FLD_vehicleID
           
static java.lang.String FLD_vehicleMake
           
static java.lang.String FLD_vehicleModel
           
static java.lang.String FLD_vehicleYear
           
static java.lang.String FLD_workOrderID
           
static int FUTURE_DATE_DISABLED
           
static int FUTURE_DATE_IGNORE
           
static int FUTURE_DATE_TRUNCATE
           
static int FUTURE_DATE_UNDEFINED
           
static DBField[] GeoCorridorFieldInfo
           
static boolean INSERT_REVERSEGEOCODE_REQUIRED
           
static int INVALID_SPEED_DISABLED
           
static int INVALID_SPEED_IGNORE
           
static int INVALID_SPEED_TRUNCATE
           
static int INVALID_SPEED_UNDEFINED
           
static int INVALID_SPEED_ZERO
           
static java.lang.String[] KEY_DRIVER_BADGE
           
static java.lang.String[] KEY_DRIVER_LICENSE
           
static java.lang.String[] KEY_DRIVER_PHONE
           
static java.lang.String[] KEY_LICENSE_PLATE
           
static DBField[] LinkFieldInfo
           
static DBField[] MaintOdometerFieldInfo
           
static double MAX_DEVICE_ODOM_KM
           
static long MAX_STOPPED_DELTA_SEC
           
static DBField[] NotificationFieldInfo
           
static java.lang.String OPTCOLS_AttributeInfo
           
static java.lang.String OPTCOLS_BorderCrossingFieldInfo
           
static java.lang.String OPTCOLS_DataPushInfo
           
static java.lang.String OPTCOLS_ELogHOSInfo
           
static java.lang.String OPTCOLS_FixedLocationFieldInfo
           
static java.lang.String OPTCOLS_GeoCorridorFieldInfo
           
static java.lang.String OPTCOLS_LinkFieldInfo
           
static java.lang.String OPTCOLS_MaintOdometerFieldInfo
           
static java.lang.String OPTCOLS_NotificationFieldInfo
           
static java.lang.String OPTCOLS_WorkOrderInfo
           
static int PAST_DATE_DISABLED
           
static int PAST_DATE_IGNORE
           
static int PAST_DATE_TRUNCATE
           
static int PAST_DATE_UNDEFINED
           
static boolean SAVE_EVENT_DRIVER_ID
           
static boolean SIMULATE_ENGINE_HOURS
           
static boolean UPDATE_EVENT_WITH_GEOZONE_LOC
           
static DBField[] WorkOrderInfo
           
 
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
Device()
           
Device(Device.Key key)
           
 
Method Summary
 java.util.Set<java.lang.String> _createChangedFieldsSet(java.util.Set<java.lang.String> flds)
          Creates a list of fields that should be updated for this device
 java.util.Set<java.lang.String> _createChangedFieldsSet(java.lang.String... flds)
          Creates a list of fields that should be updated for this device
static Device _getDevice(Account account, java.lang.String devID)
          Gets the specified Device record.
This method should only be used when relatively sure that the specified deviceID exists.
static Device _getDevice(Account account, java.lang.String devID, java.lang.String... fieldNames)
          Gets the specified Device record.
This method should only be used when relatively sure that the specified deviceID exists.
static java.lang.String _getKeyFieldString(boolean getTitle, java.lang.String key, java.lang.String arg, java.util.Locale locale, BasicPrivateLabel bpl, Device dev)
          Gets the field title/value for the specified key
protected  boolean _insertEventData(EventData evdb)
          Insert event into EventData table
 Device _reload(java.lang.String... fldNames)
          Reload the contents of this record from the DB
 void _setExpectAck(boolean v)
          Sets the expected ACK state
 void _setLastAckTime(long v)
          Sets the last ACK time (if supported)
 void _setLastDuplexConnectTime(long v)
          Sets the last Duplex/TCP connection time
 void _setLastPingTime(long v)
          Sets the time of the last command sent to the device
 void _setLastTotalConnectTime(long v)
          Sets the last UDP/TCP connection time
 void _setMaxPingCount(int v)
          Sets the maximum number of commands that can be sent to the device
 void _setTotalPingCount(int v)
          Sets the total number of commands sent to the device, since last reset
 void addOtherChangedFieldNames(java.util.Set<java.lang.String> flds)
          Adds the specified list of update fields to the internal set
 void addOtherChangedFieldNames(java.lang.String... flds)
          Adds the specified list of update fields to the internal set
 boolean addWorkOrderID(java.lang.String woid)
          Adds the specified Work Order ID to the current list
 double adjustOdometerKM(double odomKM)
          Adjusts the specified odometer value to the maximum allow value
 double adjustOdometerKM(double odomKM, boolean checkLast)
          Adjusts the specified odometer value to the maximum allow value
 void appendLastFaultCode(java.lang.String v)
          Appends the specified fault code to the current list of fault codes
static double CalculateFuelCost(Account a, Device d, double liters)
           
 double calculateOdometerKM(double odomKM, long fixtime, boolean validGPS, GeoPoint geoPoint, boolean estimate, boolean logInfo)
          Calculates an odometer value based on the specified attributes
protected  boolean checkEventRules(EventData event)
          Checks the rules which are applicable for the specified event Note: The EventData instance MUST already be set with the parent Device record!
 java.util.List<Device.GeozoneTransition> checkGeozoneTransitions(long eventTime, GeoPoint eventGP)
          Checks the new event time and GeoPoint to calculate and returns a set of Geozone arrive/depart events, which should be inserted into the EventData table.
static boolean CheckNotifySelector()
          True to test notify rule selector, false to ignore
static boolean CheckSelectorSyntax(java.lang.String selector)
          Validates the syntax of the specified Rule selector
 boolean clearExpectCommandAck(boolean didAck, boolean update)
          Clears the expect ACK state for the specified command
 void clearLastNotifyEvent(boolean update)
          Clears the last notification for this Device
 void clearOriginalLastValidGeoPoint()
          Clear original last valid GeoPoint
 void clearOtherChangedFieldNames()
          clear all fields specified in the internal update field set
 void clearParkedLocation(boolean update)
          Clears the parked location state
 boolean clearPendingCommand(boolean update)
           
 boolean clearPendingPingCommand(boolean update)
          Clears the device pending commands
 long countOldEvents(long oldTimeSec)
          Count the number of events prior to the specified time
Note: Will return -1 if EventData table is InnoDB.
static Device createNewDevice(Account account, java.lang.String devID, java.lang.String uniqueID)
          Create/Save Device record
static Device createVirtualDevice(java.lang.String acctID, java.lang.String devID)
          (EXPERIMENTAL) Creates a virtual Device record
 long deleteEventsPriorTo(long priorToTime)
          Deletes old events from EventData table.
 long deleteOldEvents(long oldTimeSec, java.lang.StringBuffer logMsg)
          Delete events prior to the specified time.
Note: Will return -1 if EventData table is InnoDB.
 boolean doesExpire()
          Returns true if this Device has an expiry date
protected  void eventDidInsert(EventData evdb)
          Callback indicating EventData instance has been inserted Note: "evdb.getDevice()" may be a copy of "this" Device instance, but made prior to any adjustments made from the EventData instance.
protected  void eventWillInsert(EventData evdb)
          Callback indicating EventData instance will be inserted Note: "evdb.getDevice()" may be a copy of "this" Device instance.
 boolean exceedsMaxPingCount()
          Returns true if the maximum number of commands sent to the server has been exceeded.
static boolean exists(java.lang.String acctID, java.lang.String devID)
          Returns true if the specified record exists
static int futureEventDateAction()
          Gets the action to perform when a future event date is detected
static long futureEventDateMaximumSec()
          Gets the maximum number of seconds an event is allowed to be into the future
 java.lang.String getActiveCorridor()
          Gets the active corridor for this device
 double getActualFuelLevel(double fuelLevel)
          Gets the FuelLevelProfile instance
 double getAgedEventsPerSecond(long ageMS)
          Gets the aged estimated events-per-second
 boolean getAllowNotify()
          Returns true if this device allows notifications
 boolean getAllowNotify(boolean checkAccount)
          Returns true if this device allows notifications
static boolean GetAllowSlowReverseGeocoding()
          Returns true is slow reverse-geocoding is allowed
 User getAssignedUser()
          Gets the assigned User
 java.lang.String getAssignedUserID()
          Gets the assigned User-ID
 java.util.TimeZone getAssignedUserTimeZone()
          Gets the TimeZone for the assigned user-id.
 java.lang.String getAssocAccountID()
          DataTransport Interface: Gets the Associated AccountID
 java.lang.String getAssocDeviceID()
          DataTransport Interface: Gets the Associated DeviceID
 java.lang.String[] getAttachedEntityDescriptions(EntityManager.EntityType etype)
          Gets and array of the attached Entity Descriptions which are attached to this Device
 java.lang.String[] getAttachedEntityDescriptions(int entityType)
          Gets and array of the attached Entity Descriptions which are attached to this Device
 java.lang.String[] getAttachedEntityIDs(EntityManager.EntityType etype)
          Gets and array of the attached Entity IDs which are attached to this Device
 java.lang.String[] getAttachedEntityIDs(int entityType)
          Gets and array of the attached Entity IDs which are attached to this Device
static OrderedSet<User> getAuthorizedUsers(Device device)
          Gets a list of authorised Users for this Device
 java.lang.String getAutoGeozoneID(EventData ev)
          Creates a unique Geozone ID which may be used by the ENRE predefined-actions
 int getBorderCrossing()
          Gets the Border-Crossing enabled state
static boolean GetCheckLastOdometer()
          Get configured maximum allowed odometer value
 java.lang.String getCodeVersion()
          Gets the code/firmware version of this Device
 long getCommandStateMask()
          Gets the command state mask as set by commands sent to the device
 boolean getCommandStateMaskBit(int bit)
          Gets the state for the specified bit from the command state mask
static java.lang.String[] getCorridorIDsForAccount(java.lang.String acctId)
          Gets a String array of all GeoCorridor ID for the specified account
(TODO: move to Account.java)
 int getCurrentIgnitionState()
          Returns the current ignition state
-1 = unknown
0 = off
1 = on
 int getCurrentIgnitionState(boolean checkSC, boolean update)
          Returns the current ignition state
-1 = unknown
0 = off
1 = on
 java.lang.String getCustomAttribute(java.lang.String key)
          Gets the value for a specific custom attribute key
 java.util.Collection<java.lang.String> getCustomAttributeKeys()
          Gets a Collection of custom attribute keys for this device
 java.lang.String getCustomAttributes()
          Gets the custom attributes for this device
 RTProperties getCustomAttributesRTP()
          Gets the custom attributes for this device as an RTProperties instance
 java.lang.String getDataKey()
          Gets the data key (PIN) for this device
 byte[] getDataKeyAsByteArray()
          Gets the data key (PIN) for this device, as a byte array
 DataTransport getDataTransport()
          Gets the DataTransport for this Device
 java.lang.String getDcsCommandHost()
          Gets the DCS Command Host assigned to this device (ie.
 long getDcsConfigMask()
          Gets the DCS configuration mask (usage defined by specific DCS)
 java.lang.String getDcsConfigString()
          Gets the DCS configuration String (usage defined by specific DCS)
 DCServerConfig getDCServerConfig()
          Gets the DCServerConfig instance for this Device
 java.lang.String getDcsPropertiesID()
          Gets the DCS Properties ID assigned to this device (DCS Property ID)
Used by some DCS modules to select specific device configurations
static java.lang.String GetDcsPropertiesID(Device device)
          Gets the DCS Property ID for the specified device
static Device getDevice(Account account, java.lang.String devID)
          Gets the specified Device record
static Device getDevice(Account account, java.lang.String devID, boolean create)
          Gets or Creates a Device record
static Device getDevice(Account account, java.lang.String devID, java.lang.String... fieldNames)
          Gets the specified Device record
 java.lang.String getDeviceCode()
          Gets the Device-Code (also called Server-ID) for this Device
static java.util.Comparator<Device> getDeviceDescriptionComparator()
          Gets the Device Description Sort Comparator
static OrderedSet<java.lang.String> getDeviceIDsForAccount(java.lang.String acctId, User userAuth, boolean inclInactv)
          Gets a set of Device IDs for the specified Account (oes not return null)
static OrderedSet<java.lang.String> getDeviceIDsForAccount(java.lang.String acctId, User userAuth, boolean inclInactv, long limit)
          Gets a set of Device IDs for the specified Account (oes not return null)
static java.util.List<java.lang.String> getDeviceIDsForSimPhoneNumber(java.lang.String simPhone)
          Returns an array of Device-IDs for the specified SIM phone number
static java.util.List<java.lang.String> getDeviceIDsForSimPhoneNumber(java.lang.String simPhone, char sepCH)
          Returns an array of Device-IDs for the specified SIM phone number
 java.lang.String getDeviceType()
          Gets the Device-Type for this Device
 boolean getDigitalInputIgnitionState(long gpioInput)
          Returns the ignition state based on the specified digital input mask.
 java.lang.String getDisplayColor()
          Gets the defined display-color
 ColorTools.RGB getDisplayColor(ColorTools.RGB dft)
          Gets the defined display-color, or returns the specified default color if not display-color is defined.
 Driver getDriver()
          Gets the Driver record, or null if not defined
 java.lang.String getDriverID()
          Gets the Driver-ID, or blank if not defined
 long getDriverStatus()
          Gets the driver status
 int getDuplexMaxConn()
          OpenDMTP: Gets the maximum Duplex/TCP connections per Interval Note: The effective maximum value for this field is defined by the following: (org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK * this.getUnitLimitIntervalMinutes())
 int getDuplexMaxConnPerMin()
          OpenDMTP: Gets the maximum Duplex/TCP connections per Minute Note: The effective maximum value for this field is defined by the constant: "org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK"
 DTProfileMask getDuplexProfileMask()
          OpenDMTP: Gets the Duplex/TCP connection profile mask
 boolean getELogEnabled()
          Returns true if ELog/HOS is enabled for this Device
 double getEngineHoursOffset()
          Gets the displayed engine-hours offset
static java.lang.String getEntityDescription(java.lang.String accountID, java.lang.String entityID, EntityManager.EntityType etype)
          Gets the Description for the specified Entity ID
static java.lang.String getEntityDescription(java.lang.String accountID, java.lang.String entityID, int etype)
          Gets the Description for the specified Entity ID
static EntityManager getEntityManager()
          Gets the defined EntityManager
 java.lang.String getEquipmentStatus()
          Gets the equipment status
static OrderedMap<java.lang.String,java.lang.String> GetEquipmentStatusMap(java.util.Locale locale)
          Return a map of EquipmentStatus keys to description
 java.lang.String getEquipmentType()
          Gets the equipment type
 long getEventCount()
          Gets the total number of events for this Device/Vehicle
 long getEventCount(long timeStart, long timeEnd)
          Gets the number of events between the specified timestamps (inclusive)
Note: will return -1 if EventData table is InnoDB
 int getEventIgnitionState(EventData ev)
          Returns the ignition state change of the specified Event
-1 = no change
0 = changed to off
1 = changed to on
 boolean getExpectAck()
          Returns true if an ACK is expected from the device
 int getExpectAckCode()
          Gets the expected ACK status code, or '0' if any code should match
 long getExpirationTime()
          Gets the expiration time of this Device (in Unix Epoch time format)
static DBFactory<Device> getFactory()
          Gets the Device DBFactory
 java.lang.String getFeatureSet()
          Gets the feature set of this Device
 EventData getFirstEvent(long startTime, boolean validGPS)
          Gets the first EventData record greater-than or equal-to the specified start time
 java.lang.String getFixedAddress()
          Gets the address for the fixed location for this device
 java.lang.String getFixedContactPhone()
          Gets the phone number for the fixed location for this device
 double getFixedLatitude()
          Gets the fixed latitude for this device
 GeoPoint getFixedLocation()
          Gets the fixed location for this device
 double getFixedLongitude()
          Gets the fixed longitude for this device
 long getFixedServiceTime()
          Gets the last time this fixed location was serviced
 double getFuelCapacity()
          Gets the tank Fuel Capacity, in Liters
 double getFuelCostPerLiter()
          Gets the Fuel cost per Liter
 double getFuelEconomy()
          Gets the approximate Fuel Economy, in Km/Liter
 FuelLevelProfile getFuelLevelProfile()
          Gets the FuelLevelProfile instance.
 FuelLevelProfile getFuelLevelProfile(FuelLevelProfile dft)
          Gets the FuelLevelProfile instance.
static FuelManager getFuelManager()
          Gets the FuelManager
 double getFuelRatePerHour()
          Gets the approximate Fuel Consumption Rate in Litres/Hour
 java.lang.String getFuelTankProfile()
          Gets the Fuel tank profile
 double getFuelUsedInRange(long startTime, long endTime)
          Gets the fuel used within the specified time range
 java.lang.String getGroupID()
          Gets the user informational Group ID
(user informational only, not used by DeviceGroup)
(currently used in various ReportLayout subclasses)
 java.lang.String getHoursOfOperation()
          Gets the HoursOfOperation for this device (as a String)
 int getIgnitionIndex()
          Returns the bit index within the input mask which indicates the ignition state.
 int getIgnitionStateAsOfEvent(EventData ev)
          Returns the ignition state as-of the specified Event
-1 = unknown
0 = off
1 = on
 int getIgnitionStateAsOfEvent(EventData ev, boolean checkSC)
          Returns the ignition state as-of the specified Event
-1 = unknown
0 = off
1 = on
 int[] getIgnitionStatusCodes()
          Returns a 2 element array indicating the status codes which indicate the ignition state.
 java.lang.String getImeiNumber()
          Gets the IMEI# (or ESN) for this device.
 long getInstallTime()
          Gets the install time of this Device (in Unix Epoch time format)
 long getInsuranceExpire()
          Gets the insurance expiration date as a DayNumber value
 DTIPAddress getIpAddressCurrent()
          Gets the last known IP address used by the Device
 DTIPAddress getIpAddressLocal()
          Gets the local IP address to which this device sent its latest packet
 DTIPAddrList getIpAddressValid()
          Gets the valid assigned IP address/mask for this Device
(used for validating incoming IP addresses used by this Device)
 boolean getIsActive()
          Gets the active state of this Device record
 double getJobLatitude()
          Gets the Job latitude
 double getJobLongitude()
          Gets the Job longitude
 java.lang.String getJobNumber()
          Gets the Job number
 double getJobRadius()
          Gets the Job radius, in meters
static java.lang.String getKeyFieldTitle(java.lang.String key, java.lang.String arg, java.util.Locale locale)
          Gets the field title for the specified key
 java.lang.String getKeyFieldValue(java.lang.String key, java.lang.String arg, BasicPrivateLabel bpl)
          Gets the field value for the specified key
 java.lang.String getLastAckCommand()
          Gets the last ACK command sent to the device (if supported)
 java.lang.String getLastAckResponse()
          Gets the last ACK response (if supported)
 long getLastAckTime()
          Gets the last ACK time (if supported)
 double getLastBatteryLevel()
          Gets the last battery level recieved
 long getLastBorderCrossTime()
          Gets the last calculated Border-Crossing time (Unix Epoch format)
 java.lang.String getLastCellServingInfo()
          Gets the last received serving cell-tower information
 long getLastConnectTime()
          Gets the last UDP/TCP connection time
 long getLastDataPushTime()
          Gets the last data push time
 double getLastDistanceKM()
          Gets the last distance value
 long getLastDuplexConnectTime()
          Gets the last Duplex/TCP connection time
 DTELogState getLastELogState()
          Gets the last ELog/HOS state
RTP:"enabled=true lastTS=123456789 lastSC=0xF010 isDriving=true|false distKM=1234.5"
 double getLastEngineHours()
          Gets the last engine-hours received
 long getLastEngineOffTime()
          Gets the last engine off time received
 double getLastEngineOnHours()
          Gets the engine-hours at the last engine-on time
 long getLastEngineOnTime()
          Gets the last engine on time received
 EventData getLastEvent(boolean validGPS)
          Gets the last EventData record in the EventData table for this Device
 EventData getLastEvent(int[] statusCodes)
          Gets the last EventData record in the EventData table for this Device
 EventData getLastEvent(int[] statusCodes, long endTime, boolean validGPS)
          Gets the last EventData record in the EventData table for this Device
 EventData getLastEvent(long endTime, boolean validGPS)
          Gets the last EventData record in the EventData table for this Device
 long getLastEventCreateMillis()
          Gets the Last Event Creation time, in milliseconds
 double getLastEventsPerSecond()
          Gets the last estimated events-per-second
 long getLastEventsPerSecondMS()
          Gets the last event-per-second timestamp (milliseconds)
 long getLastEventTimestamp()
          Gets the last event timestamp
 java.lang.String getLastFaultCode()
          Gets the last fault codes
 double getLastFuelLevel()
          Gets the last fuel level recieved
 double getLastFuelTotal()
          Gets the last fuel total recieved
 long getLastGPSTimestamp()
          Gets the last valid GPS timestamp
 double getLastIgnitionHours()
          Gets the last ignition hours received.
 long getLastIgnitionOffTime()
          Gets the last ignition off time received
 double getLastIgnitionOnHours()
          Gets the ignition hours at the last ignition-on.
 long getLastIgnitionOnTime()
          Gets the last ignition on time received
 long getLastInputState()
          Gets the bit mask of the last digital input received
see also EventData.getInputMask()
 boolean getLastInputState(int bit)
          Gets the specified bit state of the last digital input received
 boolean getLastMalfunctionLamp()
          Gets the last Malfuntion Indicator Lamp (MIL) state
 int getLastNotifyCode()
          Gets the Last Notification Status-Code for this Device
 EventData getLastNotifyEvent()
          Gets the EventData record for the last notification
 java.lang.String getLastNotifyRule()
          Gets the Rule-ID which triggered the Last Notification for this Device
 long getLastNotifyTime()
          Gets the Last Notification time for this Device (in Unix Epoch time format)
 double getLastOdometerKM()
          Gets the last odometer value
 double getLastOilLevel()
          Gets the last oil level recieved
 long getLastOutputState()
          Gets the bit mask of the last digital output received
see also EventData.getOutputMask()
 boolean getLastOutputState(int bit)
          Gets the specified bit state of the last digital output received
 long getLastPingTime()
          Gets the time of the last command sent to the device
 long getLastServiceDayNumber()
          Gets the day of the last service
 long getLastServiceTime()
          Gets the last service time
 org.opengts.cellid.CellTower getLastServingCellTower()
          Gets the last received serving cell-tower information
 long getLastStartTime()
          Gets the last Start time
 EventData getLastStopEvent()
          Gets the last Stop event
 long getLastStopTime()
          Gets the last stopped time received.
 java.lang.String getLastSubdivision()
          Gets the last valid subdivision/state
 java.lang.String getLastTcpSessionID()
          Gets the last TCP session ID
 long getLastTotalConnectTime()
          Gets the last UDP/TCP connection time
 java.lang.String getLastValidAddress()
          Returns the last valid street address, based on the last know location (not currently supported)
 double getLastValidHeading()
          Gets the last valid heading
 double getLastValidLatitude()
          Gets the last known valid latitude for this Device
 GeoPoint getLastValidLocation()
          Gets the last known valid GeoPoint for this Device
 GeoPoint getLastValidLocation(boolean tryLastEvent)
          Gets the last known valid GeoPoint for this Device
 double getLastValidLongitude()
          Gets the last known valid longitude for this Device
 double getLastValidSpeedKPH()
          Gets the last valid speed
 java.lang.String getLastVehicleID()
          Gets the previous value for the VIN.
 EventData[] getLatestEvents(long limit, boolean validGPS)
          Gets an array of EventData records
 long getLicenseExpire()
          Gets the license/registration expiration date as a DayNumber value
 java.lang.String getLicensePlate()
          Gets the Vehicle License Plate
 java.lang.String getLinkDescription()
          Gets the Link-Description for this Device
 java.lang.String getLinkURL()
          Gets the Link-URL for this Device
 int getListenPortCurrent()
          Gets the last known listen port used by the Device
 java.lang.String getMaintDescriptionKM(int ndx)
          Gets the maintenance descrption for the specified index
 java.lang.String getMaintDescriptionKM0()
          Gets the maintenance descrption for index #0
 java.lang.String getMaintDescriptionKM1()
          Gets the maintenance descrption for index #1
 double getMaintEngHoursHR(int ndx)
          Gets the Maintenance Engine Hours for the specified index
 double getMaintEngHoursHR0()
          Gets the maintenance engine-hours elapsed for index #0
 double getMaintIntervalHR(int ndx)
          Gets the maintenance engine-hours interval for the specified index
 double getMaintIntervalHR0()
          Gets the maintenance engine-hours interval for index #0
 double getMaintIntervalKM(int ndx)
          Gets the last maintenance interval for the specified index
 double getMaintIntervalKM0()
          Gets the maintenance interval for index #0
 double getMaintIntervalKM1()
          Gets the maintenance interval for index #1
 java.lang.String getMaintNotes()
          Gets the maintenance notes
 double getMaintOdometerKM(int ndx)
          Gets the last maintenance odometer for the specified index
 double getMaintOdometerKM0()
          Gets the maintenance odometer for index #0
 double getMaintOdometerKM1()
          Gets the maintenance odometer for index #1
 int getMaintTriggeredKM()
          Gets the index of the first triggered device maintenance.
Returns '-1' if not defined.
 java.lang.String getMapLegend()
          Gets the map legend (currently not used)
 int getMaxAllowedEvents()
          OpenDMTP: Gets the maximum allowed OpenDMTP events
static int getMaximumNotifyEmailLength()
          Gets the maximum Notify Email length
static double GetMaximumOdometerKM()
          Get configured maximum allowed odometer value
static double GetMaximumRuntimeHours()
          Get configured maximum allowed engine-hours value
 double getMaxOdometerKM()
          Gets the maximum allowed odometer value
 int getMaxPassengers()
          Gets the maximum number of passengers
 int getMaxPingCount()
          Gets the maximum number of commands that can be sent to the device
 double getMaxRuntimeHours()
          Gets the maximum allowed engine-hours value
 double getMetersToLastValidLocation(GeoPoint gp)
          Calculates and returns the number of meters from the last valid GPS location to the specified GeoPoint.
static org.opengts.cellid.MobileLocationProvider getMobileLocationProvider()
          Gets the MobileLocationProvider
 java.lang.String getModemID()
          Extracts the Mobile-ID from the IMEI# or Unique-ID
This method relies on the unique-id prefix to end with "_" or "-".
static java.util.Map<java.lang.String,Device.NearbyDevice> GetNearbyDeviceMap(Account account, java.lang.String targetDevID, boolean inclTargetID, long startTime, long endTime, GeoPoint gp, double radiusM, boolean activeOnly, User userAuth, boolean sortByDist)
          Return Device.NearbyDevice list of Devices near specified location
 java.util.Map<java.lang.String,Device.NearbyDevice> getNearbyDevices(double radiusM, long maxAgeSec, User userAuth)
          Return Device.NearbyDevice list of Devices near this Device Active only, this device excluded from list.
 double getNextOdometerKM(GeoPoint geoPoint)
          Calculates the next odometer value based on the specified GeoPoint
 long getNextServiceDayNumber()
          Gets the day of the next service
 long getNextServiceTime()
          Gets the next service time
 int getNotifyAction()
          Gets the Notify Actions to be executed if the Notify Rule-Selector is triggered.
This notify action is currently only used by default with the "RuleFactoryLite" module.
 java.lang.String getNotifyDescription()
          Gets the Notify Description for the rule-selector specified.
This notify description is currently only used by default with the "RuleFactoryLite" module.
 java.lang.String getNotifyEmail()
          Gets the Notification Email address
 java.lang.String getNotifyEmail(boolean inclAccount, boolean inclUser)
          Deprecated. 
 java.lang.String getNotifyEmail(boolean inclAccount, boolean inclUser, boolean inclGroup)
          Returns a String containing all email address that should be notified for this Device
 int getNotifyPriority()
          (OBSOLETE) Gets the notification priority.
The method is obsolete and should not be used.
 java.lang.String getNotifySelector()
          Gets the Rule Selector to be evaluated by the installed RuleFactory.
This rule-selector is currently only used by default with the "RuleFactoryLite" module.
 java.lang.String getNotifySubject()
          Gets the Email Subject for the triggered notification email .
This email subject is currently only used by default with the "RuleFactoryLite" module.
 java.lang.String getNotifyText()
          Gets the Email Body/Text for the triggered notification email .
This email body/text is currently only used by default with the "RuleFactoryLite" module.
 boolean getNotifyUseWrapper()
          (OBSOLETE) Gets the configuration state indicating whether the email wrapper from the "private.xml" file should be used.
The method is obsolete and should not be used.
 double getOdometerOffsetKM()
          Gets the displayed odometer offset in kilometers.
 GeoPoint getOriginalLastValidGeoPoint()
          Get Original last valid GeoPoint
 java.util.Set<java.lang.String> getOtherChangedFieldNames()
          Returns the set of fields to update (may be null)
 java.lang.String getParkedAddress()
          Gets the parked address, if parked
 double getParkedLatitude()
          Gets the Parked Latitude
 GeoPoint getParkedLocation()
          Gets the Parked GeoPoint
 double getParkedLongitude()
          Gets the Parked Longitude
 double getParkedMaxSpeedKPH()
          Gets the parked maximum speed km/h
 double getParkedRadius()
          Gets the parked radius, in meters
 java.lang.String getPendingCommand()
           
 java.lang.String getPendingMessage()
          Gets the pending message for this device
 java.lang.String getPendingMessageACK()
          Gets the pending message acknowledgement for this device
 java.lang.String getPendingPingCommand()
          Gets the currently pending commands which should be sent to the device
static int getPeriodicMaintEngHoursCount()
          Gets the number of supported maintenance engine-hour fields
static int getPeriodicMaintOdometerCount()
          Gets the number of maintenance fields to support (current maximum value is 2)
 java.lang.String getPingCommandURI()
          (NOT FULLY IMPLEMENTED) Gets the Ping command URI/URL
static PingDispatcher getPingDispatcher()
          Gets the PingDispatcher
 double getPlanDistanceKM()
          Gets the assigned "Plan Distance" for this device, in kilometers
 GeoBounds getProximityBoundingBox(long asOfTime)
          Gets the proximity bounding box.
 java.lang.String getProximityGroupID()
          Gets the nearby proximity Group ID
 long getProximityMaximumAge()
          Gets the nearby proximity location maximum age (in seconds)
 double getProximityRadius()
          Gets the nearby proximity radius, in meters
 java.lang.String getPushpinID()
          Gets the defined pushpin-id, or blank if no pushpin-id is defined
 EventData[] getRangeEvents(long timeStart, long timeEnd, boolean validGPS, EventData.LimitType limitType, long limit)
          Gets an array of events for the specified range and attributes
 EventData[] getRangeEvents(long timeStart, long timeEnd, int[] statusCodes, boolean validGPS, EventData.LimitType limitType, long limit)
          Gets an array of events for the specified range and attributes
 java.lang.String getReminderInterval()
          Gets the maintenance reminder interval
 java.lang.String getReminderMessage()
          Gets the maintenance reminder message
 long getReminderTime()
          Gets the maintenance reminder time
 int getReminderType()
          Gets the maintenance reminder type (currently always returns '0')
static Device.ReminderType getReminderType(Device d)
          Returns the defined ReminderType for the specified device.
 int getRemotePortCurrent()
          Gets the last known remote port used by the Device
 long getResetTime()
          Gets the reset time of this Device (in Unix Epoch time format)
static RuleFactory getRuleFactory()
          Gets the RuleFactory
static RuleFactory getRuleFactory(boolean checkRuntime)
          Gets the RuleFactory
 EventData[] getSavedRangeEvents()
          Gets the saved list of cached events
static boolean GetSaveEventDriverID()
          Returns true if configured to save the EventData "driverID" into the Device record
 java.lang.String getSerialNumber()
          Gets the assigned device serial number
static SessionStatsFactory getSessionStatsFactory()
          Gets the SessionStatsFactory
 java.lang.String getSimID()
          Gets the SIM-ID
 java.lang.String getSimPhoneNumber()
          Gets the SIM phone number
static boolean GetSimulateEngineHours(Device dev)
          Get configured state of estimating engine hours based on ignition state
 java.lang.String getSmsEmail()
          Gets the SMS email address for this device.
Used for sending commands to the device using email-to-SMS.
 double getSpeedLimitKPH()
          Gets the assigned speed limit for this device, in km/h
 int[] getStartStopStatusCodes()
          Returns the start/stop status codes defined in the Device record
 boolean getStartStopSupported()
          Gets the "Start/Stop StatusCode supported" config
 StatusCode getStatusCode(int code)
          Gets the StatusCode instance for the specified code
 long getStatusCodeState()
          Gets the bit mask of the StatusCode on/off state
 boolean getStatusCodeStateBit(int bit)
          Gets the StatusCode state for the specified bit
 java.util.Map<java.lang.String,java.lang.String> getSupportedCommands(BasicPrivateLabel privLabel, User user, java.lang.String type)
          Return a list of supported commands
 int getSupportedEncodings()
          OpenDMTP: Gets the supported OpenDMTP encodings
 boolean getSupportsDMTP()
          OpenDMTP: Returns true if this device supports the OpenDMTP protocol
static java.lang.String getTableDescription(java.util.Locale loc)
           
 java.lang.String getThermalProfile()
          Gets the temperature profile for this device
static java.lang.String[] GetTitles(java.util.Locale loc)
           
 int getTotalMaxConn()
          OpenDMTP: Gets the maximum total connections allowed per interval
Note: The effective maximum value for this field is defined by the following:
(org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK * this.getUnitLimitIntervalMinutes())
 int getTotalMaxConnPerMin()
          OpenDMTP: Gets the maximum total connections allowed per minute
Note: The effective maximum value for this field is defined by the constant:
"org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK"
 int getTotalPingCount()
          Gets the total number of commands sent to the device, since last reset
 DTProfileMask getTotalProfileMask()
          OpenDMTP: Gets the total (UDP/TCP) connection profile mask
 java.lang.String getTransportID()
          Gets the Transport-ID for this Device (if any)
 java.lang.String getUniqueID()
          Gets the Unique-ID for this Device
 int getUnitLimitInterval()
          OpenDMTP: Gets the OpenDMTP unit limit interval
 java.lang.String getVehicleID()
          Gets the Vehicle Identification Number (VIN)
 java.lang.String getVehicleMake()
          Gets the vehicle make
 java.lang.String getVehicleModel()
          Gets the vehicle model
 int getVehicleYear()
          Gets the vehicle year
 WorkHours getWorkHours(WorkHours dft)
          Gets a WorkHours instance, based on the HoursOfOperation of this Device
 java.lang.String getWorkOrderID()
          Gets the Work Order ID
 java.lang.String[] getWorkOrderIDs()
          Gets the Work Order IDs as an array
 boolean hasActiveCorridor()
          Returns true if this device has an active corridor
static boolean hasCellTowerGetLocation()
          Returns true if a MobileLocationProvider is defined
 boolean hasChangedFieldNames()
          Returns true if the changed field set has been initialized
 boolean hasCurrentJob()
          Returns true if there is a current job defined
 boolean hasDataKey()
          Returns true if this device defines a data-key
 boolean hasDcsCommandHost()
          Returns true if this device defines a custom command host.
 boolean hasDcsPropertiesID()
          Returns true if this device has a non-default DCS Properties ID
 boolean hasDisplayColor()
          Returns true if this Device has a specific defined display color
 boolean hasDriverID()
          Returns true if a driver-id is defined for this Device
 boolean hasDriverStatus()
          Returns true if a driver-status is defined for this Device
static boolean hasENRE()
          Returns true if the defined RuleFactory is the ENRE
static boolean hasEntityManager()
          Returns true if an EntityManager has been defined
 boolean hasEquipmentStatus()
          Returns true if an equipment-status is defined for this Device
 boolean hasFixedLocation()
          Returns true if this device supports fixed locations
static boolean hasFuelManager()
          Returns true if a FuelManager has been defined
 boolean hasFuelTankProfile()
          Returns true if a Fuel tank profile is defined
 boolean hasHoursOfOperation()
          Returns true if this device has a defined HoursOfOperation (ie.
 boolean hasJobNumber()
          Returns true if Job number is defined
 boolean hasLastTcpSessionID()
          Returns true if this device has an assigned TCP session-id
 boolean hasLastValidLocation()
          Returns true if this device has a last known valid GeoPoint
 boolean hasLink()
          Returns true if this Device record defines a non-blank Link-URL value
 boolean hasPendingCommand()
           
 boolean hasPendingMessage()
          Returns true if this device has a pending message
 boolean hasPendingPingCommand()
          Returns true if this device contains any pending commands
static boolean hasPingDispatcher()
          Returns true if a PingDispatcher has been defined
 boolean hasPushpinID()
          Returns true if this Device has a specific defined pushpin-id
static boolean hasRuleFactory()
          Returns true if a RuleFactory is defined
static boolean hasSessionStatsFactory()
          Returns true if a SessionStatsFactory has been defined
 boolean hasVehicleID()
          Returns true if the Vehicle Identification Number (VIN) is defined
 boolean hasVinChanged()
          Returns true if the VIN has changed
 boolean incrementPingCount(long pingTime, boolean reload, boolean update)
          Increments the command count for this device
static void initEventsPerSecond()
           
 boolean insertEventData(EventData evdb)
          Insert event into EventData table
 void insertSessionStatistic(long startTime, java.lang.String ipAddr, boolean isDuplex, long bytesRead, long bytesWritten, long evtsRecv)
          Insert connection session statistics into the SessionStats table
static int invalidSpeedAction()
           
static double invalidSpeedMaximumKPH()
           
 boolean isAckStatusCode(int statusCode)
          Returns true if the device is expecting an ACK and the specified status code matched the expected ACK status code.
 boolean isBorderCrossing()
          Returns true if Border-Crossing is enabled
 boolean isDriverID(java.lang.String drvID)
          Returns true if the specified driver-id matches the current driver-id.
static boolean isEntityAttached(java.lang.String accountID, java.lang.String deviceID, java.lang.String entityID, EntityManager.EntityType etype)
          Returns true if the specified Entity is attached to the specified Device ID
static boolean isEntityAttached(java.lang.String accountID, java.lang.String deviceID, java.lang.String entityID, int etype)
          Returns true if the specified Entity is attached to the specified Device ID
 boolean isExpectingCommandAck()
          Returns true if an ACK is expected from the device
 boolean isExpired()
          Returns true if this Device has expired
 boolean isHoursOfOperation(DateTime dt, java.util.TimeZone tz)
          Returns true if the specified time is within the HoursOfOperation.
 boolean isHoursOfOperation(long ts)
          Returns true if the specified time is within the HoursOfOperation relative to the Account timezone.
 boolean isIgnitionOff(int code)
          Returns true if the specified status code represents an Ignition-Off for this device
 boolean isIgnitionOn(int code)
          Returns true if the specified status code represents an Ignition-On for this device
 boolean isImplicitJobDepart(GeoPoint gp)
          Returns true if the specified location would represent a job depart
 boolean isInsuranceExpired(DayNumber asof)
          Returns true if the insurance is expired as-of the specified date
 boolean isInsuranceExpired(long asofDay)
          Returns true if the insurance is expired as-of the specified date
 boolean isLicenseExpired(DayNumber asof)
          Returns true if the license/registration is expired as-of the specified date
 boolean isLicenseExpired(long asofDay)
          Returns true if the license/registration is expired as-of the specified date
 boolean isMaintenanceDueHR(int ndx, double deltaHR)
          Returns true if the maintenance engine hours for the specified index is due
 boolean isMaintenanceDueKM(int ndx, double deltaKM)
          Returns true if the maintenance interval is due for the specified index and specified number of delta kilometers.
 boolean isNearLastValidLocation(GeoPoint gp, double meters)
          Returns true if the last know location of this device is is within the specified number of meters to the specified GeoPoint.
 boolean isNearLastValidLocation(GeoPoint gp, double meters, long maxFixAge)
          Returns true if the last know location of this device is is within the specified number of meters to the specified GeoPoint.
 boolean isOldEventTimestamp(long timestamp)
          Returns true if the specified timestamp is prior to the last received event timestamp
 boolean isParked()
          Returns true if this Device is parked
 boolean isParkedViolation(GeoPoint gp, double speedKPH)
          Returns true if the specified GeoPoint location indicates a "Park" violation
 boolean isPingSupported(BasicPrivateLabel privLabel, User user)
          Returns true if sending commands is supported for the specified private-label and user
 boolean isReminderExpired(java.util.TimeZone tz)
          Returns true if the reminder time has expired
 boolean isReminderExpired(java.util.TimeZone tz, long nowTime)
          Returns true if the maintenance reminder has expired
 boolean isStopped()
          Returns true if the device is currently stopped, based on the start/stop configuration calculated as each event arrives.
 boolean isValidFixedLocation()
          Returns true if this device defines a valid fixed location
 boolean isValidIPAddress(java.lang.String ipAddr)
          Returns true if the specified IP address matches the IP address/mask assigned to this Device.
static Device loadDeviceByName(Account account, java.lang.String devID)
          This method is called by "Transport.loadDeviceByTransportID(...)" to load a Device within a Device Communication Server, based on the Account and Device IDs.
static Device loadDeviceBySimPhoneNumber(java.lang.String simPhone)
          This method is used to load a Device record based on the SIM phone number.
static Device loadDeviceByUniqueID(java.lang.String uniqId)
          This method is called by "Transport.loadDeviceByUniqueID(String)" to load a Device within a Device Communication Server, based on a Unique-ID.
 void log_EventData(int logLevel, EventData ev)
          Prints the event information to the log file
static void main(java.lang.String[] args)
          Main entry point for Device command-line tools
static double MinMax(double val, double min, double max)
           
static long MinMax(long val, long min, long max)
           
static int pastEventDateAction()
          Gets the action to perform when a past event date is detected
static long pastEventDateMaximumSec()
          Gets the maximum number of seconds an event is allowed to be into the past
 boolean postCommandHandling(DCServerConfig.Command command, java.lang.String cmdStr, boolean update)
          Post command handling (called by "DCServerConfig.Command.setDeviceCommandAttributes" after a successful command)
 boolean removeWorkOrderID(java.lang.String woid)
          Removes the specified Work Order ID from the current list
 void reprocessEventDataRecords(long timeStart, long timeEnd, Device.EventDataHandler edh)
          Reprocesses a range of EventData reocrds
 void resetMaintEngHoursHR(int ndx)
          Resets the maintenance engine hours for the specified index
 void resetMaintEngHoursHR0()
          Resets the maintenance engine-hours for index #0
 void resetMaintOdometerKM(int ndx)
          Resets the last maintenance odometer for the specified index
 void resetMaintOdometerKM0()
          Resets the maintenance odometer for index #0
 void resetMaintOdometerKM1()
          Resets the maintenance odometer for index #1
 void resetReminder()
          Reset the reminder time (to current time)
 void resetReminder(long currentTime)
          Reset the reminder time
 void save()
          Save this Device to db storage
 boolean saveOriginalLastValidGeoPoint()
          Save last valid GeoPoint
 void saveParkedLocation()
          Saves the set parked location back to the Device table
 boolean sendDeviceCommand(java.lang.String cmdType, java.lang.String cmdName, java.lang.String[] cmdArgs)
          Sends the specified command to this device
 void setActiveCorridor(java.lang.String v)
          Sets the active corridor for this device
 void setAllowNotify(boolean v)
          Sets the "Allow Notification" state for this Device
static void SetAllowSlowReverseGeocoding(boolean allow)
          Enabled/Disabled slow reverse-geocoding (default is to allow)
 void setAssignedUserID(java.lang.String v)
          Sets the assigned User-ID
 void setBorderCrossing(Device.BorderCrossingState bcs)
          Sets the Border-Crossing enabled state
 void setBorderCrossing(int flags)
          Sets the Border-Crossing enabled state
static void setCellTowerGetLocation(org.opengts.cellid.MobileLocationProvider ctgl)
          Sets the MobileLocationProvider
 void setCodeVersion(java.lang.String v)
          Sets the code/firmware version of this Device
 void setCommandStateBit(int bit, boolean state)
          Sets the state for the specified bit from the command state mask
 void setCommandStateMask(long v)
          Sets the command state mask as set by commands sent to the device
 void setCreationDefaultValues()
          Sets the record creation default values
 java.lang.String setCustomAttribute(java.lang.String key, java.lang.String value)
          Sets a specific custom attribute value
 void setCustomAttributes(java.lang.String v)
          Sets the custom attributes for this device
 void setDataKey(java.lang.String v)
          Gets the data key (PIN) for this device
 void setDcsCommandHost(java.lang.String v)
          Sets the DCS Command Host assigned to this device (ie.
 void setDcsConfigMask(long v)
          Sets the DCS configuration mask (usage defined by specific DCS)
 void setDcsConfigString(java.lang.String v)
          Sets the DCS configuration String (usage defined by specific DCS)
 void setDcsPropertiesID(java.lang.String v)
          Sets the DCS Properties ID assigned to this device (DCS Property ID)
Used by some DCS modules to select specific device configurations
 void setDeviceCode(java.lang.String v)
          Sets the Device-Code (also called Server-ID) for this Device
 void setDeviceType(java.lang.String v)
          Sets the Device-Type for this Device
 void setDisplayColor(ColorTools.RGB v)
          Sets the display color
 void setDisplayColor(java.lang.String v)
          Sets the display color
 void setDriverID(java.lang.String v)
          Sets the Driver-ID
 void setDriverStatus(long v)
          Sets the driver status
 void setDuplexMaxConn(int v)
          OpenDMTP: Sets the maximum Duplex/TCP connections per Interval
 void setDuplexMaxConnPerMin(int v)
          OpenDMTP: Sets the maximum Duplex/TCP connections per Minute
 void setDuplexProfileMask(DTProfileMask v)
          OpenDMTP: Sets the Duplex/TCP connection profile mask
 void setELogEnabled(boolean v)
          Sets the "ELog/HOS Enabled" state for this Device
 void setEngineHoursOffset(double v)
          Sets the displayed engine-hours offset
static void setEntityManager(EntityManager ef)
          Sets the EntityManager
 void setEquipmentStatus(java.lang.String v)
          Sets the equipment status
 void setEquipmentType(java.lang.String v)
          Sets the equipment type
 void setExpectAck(boolean v)
          Sets the expected ACK state
 void setExpectAckCode(int v)
          Sets the expected ACK status code, or '0' if any code should match
 void setExpirationTime(long v)
          Sets the expiration time of this Device (in Unix Epoch time format)
 void setFeatureSet(java.lang.String v)
          Sets the feature set of this Device
 void setFixedAddress(java.lang.String v)
          Sets the address for the fixed location for this device
 void setFixedContactPhone(java.lang.String v)
          Sets the phone number for the fixed location for this device
 void setFixedLatitude(double v)
          Sets the fixed latitude for this device
 void setFixedLongitude(double v)
          Sets the fixed longitude for this device
 void setFixedServiceTime(long v)
          Sets the last time this fixed location was serviced
 void setFuelCapacity(double v)
          Sets the tank Fuel Capacity, in Liters
 void setFuelCostPerLiter(double v)
          Sets the Fuel cost per Liter
 void setFuelEconomy(double v)
          Sets the approximate Fuel Economy, in Km/Liter
static void setFuelManager(FuelManager fm)
          Sets the FuelManager
 void setFuelRatePerHour(double v)
          Sets the approximate Fuel Consumption Rate in Litres/Hour
 void setFuelTankProfile(java.lang.String v)
          Sets the Fuel tank profile
 void setGroupID(java.lang.String v)
          Sets the user informational Group ID
(user informational only, not used by DeviceGroup)
(currently used in various ReportLayout subclasses)
 void setHoursOfOperation(RTProperties rtp)
          Sets the HoursOfOperation for this device
 void setHoursOfOperation(java.lang.String v)
          Sets the HoursOfOperation for this device
 void setHoursOfOperation(WorkHours wh)
          Sets the HoursOfOperation for this device
 void setIgnitionIndex(int v)
          Sets the bit index for the inputMask ignition state indicator.
 void setImeiNumber(java.lang.String v)
          Gets the IMEI# (or ESN) for this device.
 void setInstallTime(long v)
          Sets the install time of this Device (in Unix Epoch time format)
 void setInsuranceExpire(DayNumber dn)
          Sets the insurance expiration date as a DayNumber instance
 void setInsuranceExpire(int year, int month1, int day)
          Sets the insurance expiration date
 void setInsuranceExpire(long v)
          Sets the insurance expiration date as a DayNumber value
 void setIpAddressCurrent(DTIPAddress v)
          Sets the last known IP address used by the Device
 void setIpAddressCurrent(java.lang.String v)
          Sets the last known IP address used by the Device
 void setIpAddressLocal(DTIPAddress v)
          Sets the local IP address to which this device sent its latest packet
 void setIpAddressLocal(java.lang.String v)
          Sets the local IP address to which this device sent its latest packet
 void setIpAddressValid(DTIPAddrList v)
          Sets the valid assigned IP address/mask for this Device
(used for validating incoming IP addresses used by this Device)
 void setIpAddressValid(java.lang.String v)
          Sets the valid assigned IP address/mask for this Device
(used for validating incoming IP addresses used by this Device)
 void setJobLatitude(double v)
          Sets the Job latitude
 void setJobLocation(GeoPoint jobLoc, double jobRadM)
          Sets the Job location
 void setJobLongitude(double v)
          Sets the Job longitude
 void setJobNumber(java.lang.String v)
          Sets the Job number
 void setJobRadius(double v)
          Sets the Job radius, in meters
 void setLastAckCommand(java.lang.String v)
          Sets the last ACK command sent to the device
 void setLastAckResponse(java.lang.String v)
          Sets the last ACK response
 void setLastAckTime(long v)
          Sets the last ACK time (if supported)
 void setLastBatteryLevel(double v)
          Sets the last battery level recieved
 void setLastBorderCrossTime(long v)
          Sets the last calculated Border-Crossing time (Unix Epoch format)
 void setLastCellServingInfo(java.lang.String v)
          Sets the last received serving cell-tower information
 void setLastConnectTime(long v, boolean isDuplex)
          Sets the last UDP/TCP connection time
 void setLastDataPushTime(long v)
          Sets the last data push time
 void setLastDistanceKM(double distKM)
          Sets the last distance value
 void setLastDuplexConnectTime(long v)
          Sets the last Duplex/TCP connection time
 void setLastELogState(DTELogState v)
          Sets the last HOS pata push time
 void setLastEngineHours(double v)
          Sets the last engine-hours received
 void setLastEngineOffTime(long v)
          Sets the last engine off time received
 void setLastEngineOnHours(double v)
          Sets the engine-hours at the last engine-on time
 void setLastEngineOnTime(long v)
          Sets the last engine on time received
 void setLastEventCreateMillis(long v)
          Sets the Last Event Creation time, in milliseconds
 void setLastEventsPerSecond(double v)
          Sets the last estimated events-per-second
 void setLastEventsPerSecondMS(long v)
          Sets the last event-per-second timestamp (milliseconds)
 void setLastEventTimestamp(long v)
          Sets the last event timestamp
 void setLastFaultCode(java.lang.String v)
          Sets the last fault codes
 void setLastFuelLevel(double v)
          Sets the last fuel level recieved
 void setLastFuelTotal(double v)
          Sets the last fuel total recieved
 void setLastGPSTimestamp(long v)
          Sets the last valid GPS timestamp
 void setLastIgnitionHours(double v)
          Sets the last ignition hours received.
 void setLastIgnitionOffTime(long v)
          Sets the last ignition off time received
 void setLastIgnitionOnHours(double v)
          Sets the ignition hours at the last ignition-on.
 void setLastIgnitionOnTime(long v)
          Sets the last ignition on time received
 void setLastInputState(long v)
          Sets the bit mask of the last digital input received
 void setLastMalfunctionLamp(boolean v)
          Sets the last Malfuntion Indicator Lamp (MIL) state
 void setLastNotifyCode(int v)
          Sets the Last Notification Status-Code for this Device
 void setLastNotifyEvent(EventData event, java.lang.String ruleID, boolean update)
          Sets the event information for the last rule-triggered notification
 void setLastNotifyEvent(long timestamp, java.lang.String ruleID, boolean update)
          Sets the event information for the last rule-triggered notification
 void setLastNotifyRule(java.lang.String v)
          Sets the Rule-ID which triggered the Last Notification for this Device
 void setLastNotifyTime(long v)
          Sets the Last Notification time for this Device (in Unix Epoch time format)
 void setLastOdometerKM(double odomKM)
          Sets the last odometer value
 void setLastOilLevel(double v)
          Sets the last oil level recieved
 void setLastOutputState(long v)
          Sets the bit mask of the last digital output received
 void setLastPingTime(long v)
          Sets the time of the last command sent to the device
 void setLastServiceTime(long v)
          Sets the last service time
 void setLastServingCellTower(org.opengts.cellid.CellTower sct)
          Sets the last received serving cell-tower information
 void setLastStartTime(long v)
          Sets the last Start time
 void setLastStopTime(long v)
          Sets the last stopped time received.
 void setLastSubdivision(java.lang.String v)
          Sets the last valid subdivision/state
 void setLastTcpSessionID(java.lang.String v)
          Sets the last TCP session ID
 void setLastTotalConnectTime(long v)
          Sets the last UDP/TCP connection time
 void setLastValidHeading(double v)
          Sets the last valid heading
 void setLastValidLatitude(double v)
          Gets the last known valid latitude for this Device
 void setLastValidLongitude(double v)
          Sets the last known valid longitude for this Device
 void setLastValidSpeedKPH(double v)
          Sets the last valid speed
 void setLicenseExpire(DayNumber dn)
          Sets the license/registration expiration date as a DayNumber instance
 void setLicenseExpire(int year, int month1, int day)
          Sets the license/registration expiration date
 void setLicenseExpire(long v)
          Sets the license/registration expiration date as a DayNumber value
 void setLicensePlate(java.lang.String v)
          Sets the Vehicle License Plate
 void setLinkDescription(java.lang.String v)
          Sets the Link-Description for this Device
 void setLinkURL(java.lang.String v)
          Sets the Link-URL for this Device
 void setListenPortCurrent(int v)
          Sets the last known listen port used by the Device
static void SetLogEventDataInsertion(int logLevel)
           
 void setMaintEngHoursHR0(double v)
          Sets the maintenance engine-hours elapsed for index #0
 void setMaintIntervalHR0(double v)
          Sets the maintenance engine-hours interval for index #0
 void setMaintIntervalKM0(double v)
          Sets the maintenance interval for index #0
 void setMaintIntervalKM1(double v)
          Sets the maintenance interval for index #1
 void setMaintNotes(java.lang.String v)
          Sets the maintenance notes
 void setMaintOdometerKM0(double v)
          Sets the maintenance odometer for index #0
 void setMaintOdometerKM1(double v)
          Sets the maintenance odometer for index #1
 void setMaintTriggeredKM(int ndx)
          Sets the index of the first triggered device maintenance.
(Used for Rule '$MAINTKM' trigger state caching)
 void setMapLegend(java.lang.String legend)
          Sets the map legend (currently not used)
 void setMaxAllowedEvents(int v)
          OpenDMTP: Sets the maximum allowed OpenDMTP events
 void setMaxPassengers(int v)
          Sets the maximum number of passengers
 void setMaxPingCount(int v)
          Sets the maximum number of commands that can be sent to the device
 void setModemID(java.lang.String mid)
          Sets the preextracted Mobile-ID for this device
 void setNextServiceTime(long v)
          Sets the next service time
 void setNotifyAction(int v)
          Sets the Notify Actions to be executed if the Notify Rule-Selector is triggered.
This notify action is currently only used by default with the "RuleFactoryLite" module.
 void setNotifyDescription(java.lang.String v)
          Sets the Notify Description for the rule-selector specified.
This notify description is currently only used by default with the "RuleFactoryLite" module.
 void setNotifyEmail(java.lang.String v)
          Sets the Notification Email address
 void setNotifyPriority(int v)
          (OBSOLETE) Sets the notification priority.
The method is obsolete and should not be used.
 void setNotifySelector(java.lang.String v)
          Sets the Rule Selector to be evaluated by the installed RuleFactory.
This rule-selector is currently only used by default with the "RuleFactoryLite" module.
 void setNotifySubject(java.lang.String v)
          Sets the Email Subject for the triggered notification email .
This email subject is currently only used by default with the "RuleFactoryLite" module.
 void setNotifyText(java.lang.String v)
          Sets the Email Body/Text for the triggered notification email .
This email body/text is currently only used by default with the "RuleFactoryLite" module.
 void setNotifyUseWrapper(boolean v)
          (OBSOLETE) Sets the configuration state indicating whether the email wrapper from the "private.xml" file should be used.
The method is obsolete and should not be used.
 void setOdometerOffsetKM(double v)
          Sets the displayed odometer offset in kilometers.
 void setParkedAddress(java.lang.String v)
          Sets the parked address, if parked
 void setParkedLatitude(double v)
          Sets the Parked Latitude
 void setParkedLocation(GeoPoint parkLoc, double parkRadM, double parkSpeed, boolean update)
          Sets the parked location state
 void setParkedLongitude(double v)
          Sets the Parked Longitude
 void setParkedMaxSpeedKPH(double v)
          Sets the parked maximum speed km/h
 void setParkedRadius(double v)
          Sets the parked radius, in meters
 void setPendingCommand(java.lang.String v)
           
 void setPendingMessage(java.lang.String v)
          Sets the pending message for this device
 void setPendingMessageACK(java.lang.String v)
          Sets the pending message acknowledgement for this device
 void setPendingPingCommand(java.lang.String v)
          Sets the currently pending commands which should be sent to the device
 void setPingCommandURI(java.lang.String v)
          (NOT FULLY IMPLEMENTED) Sets the Ping command URI/URL
static void setPingDispatcher(PingDispatcher pd)
          Sets the PingDispatcher
 void setPlanDistanceKM(double v)
          Sets the assigned "Plan Distance" for this device, in kilometers
 void setProximityGroupID(java.lang.String v)
          Sets the nearby proximity Group ID
 void setProximityMaximumAge(long v)
          Sets the nearby proximity location maximum age (in seconds)
 void setProximityRadius(double v)
          Sets the nearby proximity radius, in meters
 void setPushpinID(java.lang.String v)
          Sets the defined pushpin-id, or blank if no pushpin-id is defined
 void setReminderInterval(java.lang.String v)
          Sets the maintenance reminder interval
 void setReminderMessage(java.lang.String v)
          Sets the maintenance reminder message
 void setReminderTime(long v)
          Sets the maintenance reminder time
 void setReminderType(Device.ReminderType r)
          Sets the maintenance reminder type
 void setReminderType(int v)
          Sets the maintenance reminder type
 void setRemotePortCurrent(int v)
          Sets the last known remote port used by the Device
 void setResetTime(long v)
          Sets the reset time of this Device (in Unix Epoch time format)
static void setRuleFactory(RuleFactory rf)
          Sets the RuleFactory
 void setSavedRangeEvents(EventData[] events)
          Sets the saved list of cached events
 void setSerialNumber(java.lang.String v)
          Sets the assigned device serial number
static void setSessionStatsFactory(SessionStatsFactory rf)
          Sets the SessionStatsFactory
 void setSimID(java.lang.String v)
          Gets the SIM-ID
 void setSimPhoneNumber(java.lang.String v)
          Sets the SIM phone number
 void setSmsEmail(java.lang.String v)
          Sets the SMS email address for this device.
Used for sending commands to the device using email-to-SMS.
 void setSpeedLimitKPH(double v)
          Sets the assigned speed limit for this device, in km/h
 void setStatusCodeState(long v)
          Sets the bit mask of the StatusCode on/off state
 void setStatusCodeStateBit(int bit, boolean state)
          Sets the StatusCode state for the specified bit
 void setSupportedEncodings(int v)
          OpenDMTP: Sets the supported OpenDMTP encodings
 void setSupportsDMTP(boolean v)
          OpenDMTP: Sets the OpenDMTP protocol support state
 void setThermalProfile(java.lang.String v)
          Sets the temperature profile for this device
 void setTotalMaxConn(int v)
          OpenDMTP: Sets the maximum total connections allowed per interval
 void setTotalMaxConnPerMin(int v)
          OpenDMTP: Sets the maximum total connections allowed per minute
 void setTotalPingCount(int v)
          Sets the total number of commands sent to the device, since last reset
 void setTotalProfileMask(DTProfileMask v)
          OpenDMTP: Sets the total (UDP/TCP) connection profile mask
 void setTransport(Transport xport)
          Sets the Transport for this Device
 void setUniqueID(java.lang.String v)
          Sets the Unique-ID for this Device
 void setUnitLimitInterval(int v)
          OpenDMTP: Sets the OpenDMTP unit limit interval
 void setVehicleID(java.lang.String v)
          Sets the Vehicle Identification Number (VIN)
 void setVehicleMake(java.lang.String v)
          Sets the vehicle make
 void setVehicleModel(java.lang.String v)
          Sets the vehicle model
 void setVehicleYear(int v)
          Sets the vehicle year
 void setWorkOrderID(java.lang.String v)
          Sets the Work Order ID
 void setWorkOrderIDs(java.lang.String[] W)
          Sets the Work Order IDs as an array
static boolean supportsActiveCorridor()
          Returns true if active corridors are supported
static boolean supportsAssignedUserID()
          Returns true if assigned-userID is supported
static boolean supportsBorderCrossing()
          Returns true if this Device record supports Border-Crossing
 boolean supportsDataPushTime()
          Returns true if DataPushTime is supported
 boolean supportsDMTP()
          OpenDMTP: Returns true if this device supports the OpenDMTP protocol
 boolean supportsELogState()
          Returns true if ELogState is supported
static boolean supportsEventsPerSecond()
          Returns true if EventsPerSecond is supported/enabled
static boolean supportsFaultCodes()
          Returns true if Fault Codes are supported
static boolean supportsFixedLocation()
          Returns true if Fixed Locations are supported
static boolean supportsHoursOfOperation()
          Returns true if HoursOfOperation/WorkHours is supported
static boolean supportsLastEngineHours()
          Returns true if LastEngineHours is supported
static boolean supportsLastOdometer()
          Returns true if the Device record supports the last odometer fields
static boolean supportsLinkURL()
          Returns true if this Device record supports the "linkURL" field
static boolean supportsNotification()
          Returns true if this Device record supports the "allowNotify" field
static boolean supportsPendingMessage()
          Returns true if PendingMessage is supported
static boolean supportsPeriodicMaintenance()
          Returns true if Periodic Maintenance fields are supported
static boolean supportsThermalProfile()
          Returns true if ThermalProfile is supported
static java.lang.String TABLE_NAME()
           
 java.lang.String toString()
          Return a String representation of this Device
 void updateChangedEventFields()
          Updates all fields specified in the internal changed field set
 void updateChangedEventFields(java.util.Set<java.lang.String> flds)
          Updates the specified changed fields
 void updateChangedEventFields(java.lang.String... flds)
          Updates the specified changed fields
static boolean UpdateEventWithGeozoneLocation()
          Get configured state obtaining lat/lon from Geozone
 void updateOtherChangedEventFields()
          Updates all fields specified in the internal update field set
 boolean validateDataKey(java.lang.String pin)
          Returns true if the specified key matches the "dataKey" (also call PIN) for this device
protected  void vinDidChange(java.lang.String oldVIN, java.lang.String newVIN)
          Callback for VIN changed
 boolean willExpire(long withinSec)
          Returns true if this Device will expire within the specified number of seconds
 
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, 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, 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, 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
 
Methods inherited from interface org.opengts.db.DataTransport
getDescription, update, update
 

Field Detail

CACHE_STATUS_CODE_DESCRIPTIONS

public static boolean CACHE_STATUS_CODE_DESCRIPTIONS

INSERT_REVERSEGEOCODE_REQUIRED

public static boolean INSERT_REVERSEGEOCODE_REQUIRED

ALLOW_USE_EMAIL_WRAPPER

public static boolean ALLOW_USE_EMAIL_WRAPPER

AUTO_GENERATE_NON_MOVING_EVENT

public static boolean AUTO_GENERATE_NON_MOVING_EVENT

MAX_STOPPED_DELTA_SEC

public static long MAX_STOPPED_DELTA_SEC

EVENT_START_MOTION_RADIUS_M

public static double EVENT_START_MOTION_RADIUS_M

DEFERRED_RULE_CHECK

public static boolean DEFERRED_RULE_CHECK

EMPTY_ARRAY

public static final Device[] EMPTY_ARRAY

OPTCOLS_NotificationFieldInfo

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

OPTCOLS_BorderCrossingFieldInfo

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

OPTCOLS_LinkFieldInfo

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

OPTCOLS_FixedLocationFieldInfo

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

OPTCOLS_GeoCorridorFieldInfo

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

OPTCOLS_MaintOdometerFieldInfo

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

OPTCOLS_WorkOrderInfo

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

OPTCOLS_DataPushInfo

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

OPTCOLS_ELogHOSInfo

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

OPTCOLS_AttributeInfo

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

EPS_RANGE_SECONDS

public static long EPS_RANGE_SECONDS

EPS_RANGE_MS

public static long EPS_RANGE_MS

EPS_WEIGHT

public static double EPS_WEIGHT

EPS_ALPHA

public static double EPS_ALPHA

CHECK_LAST_ODOMETER

public static final boolean CHECK_LAST_ODOMETER
See Also:
Constant Field Values

SIMULATE_ENGINE_HOURS

public static boolean SIMULATE_ENGINE_HOURS

UPDATE_EVENT_WITH_GEOZONE_LOC

public static boolean UPDATE_EVENT_WITH_GEOZONE_LOC

MAX_DEVICE_ODOM_KM

public static final double MAX_DEVICE_ODOM_KM
See Also:
Constant Field Values

SAVE_EVENT_DRIVER_ID

public static final boolean SAVE_EVENT_DRIVER_ID
See Also:
Constant Field Values

PAST_DATE_UNDEFINED

public static final int PAST_DATE_UNDEFINED
See Also:
Constant Field Values

PAST_DATE_IGNORE

public static final int PAST_DATE_IGNORE
See Also:
Constant Field Values

PAST_DATE_DISABLED

public static final int PAST_DATE_DISABLED
See Also:
Constant Field Values

PAST_DATE_TRUNCATE

public static final int PAST_DATE_TRUNCATE
See Also:
Constant Field Values

FUTURE_DATE_UNDEFINED

public static final int FUTURE_DATE_UNDEFINED
See Also:
Constant Field Values

FUTURE_DATE_IGNORE

public static final int FUTURE_DATE_IGNORE
See Also:
Constant Field Values

FUTURE_DATE_DISABLED

public static final int FUTURE_DATE_DISABLED
See Also:
Constant Field Values

FUTURE_DATE_TRUNCATE

public static final int FUTURE_DATE_TRUNCATE
See Also:
Constant Field Values

INVALID_SPEED_UNDEFINED

public static final int INVALID_SPEED_UNDEFINED
See Also:
Constant Field Values

INVALID_SPEED_IGNORE

public static final int INVALID_SPEED_IGNORE
See Also:
Constant Field Values

INVALID_SPEED_DISABLED

public static final int INVALID_SPEED_DISABLED
See Also:
Constant Field Values

INVALID_SPEED_TRUNCATE

public static final int INVALID_SPEED_TRUNCATE
See Also:
Constant Field Values

INVALID_SPEED_ZERO

public static final int INVALID_SPEED_ZERO
See Also:
Constant Field Values

_TABLE_NAME

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

FLD_groupID

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

FLD_equipmentType

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

FLD_equipmentStatus

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

FLD_vehicleMake

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

FLD_vehicleModel

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

FLD_vehicleYear

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

FLD_vehicleID

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

FLD_licensePlate

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

FLD_licenseExpire

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

FLD_insuranceExpire

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

FLD_driverID

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

FLD_driverStatus

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

FLD_fuelCapacity

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

FLD_fuelEconomy

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

FLD_fuelRatePerHour

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

FLD_fuelCostPerLiter

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

FLD_fuelTankProfile

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

FLD_speedLimitKPH

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

FLD_planDistanceKM

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

FLD_installTime

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

FLD_resetTime

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

FLD_expirationTime

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

FLD_uniqueID

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

FLD_deviceCode

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

FLD_deviceType

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

FLD_pushpinID

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

FLD_displayColor

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

FLD_serialNumber

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

FLD_simPhoneNumber

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

FLD_simID

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

FLD_smsEmail

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

FLD_imeiNumber

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

FLD_dataKey

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

FLD_ignitionIndex

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

FLD_codeVersion

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

FLD_featureSet

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

FLD_ipAddressValid

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

FLD_lastTcpSessionID

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

FLD_ipAddressLocal

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

FLD_ipAddressCurrent

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

FLD_remotePortCurrent

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

FLD_listenPortCurrent

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

FLD_pingCommandURI

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

FLD_pendingPingCommand

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

FLD_lastPingTime

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

FLD_totalPingCount

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

FLD_maxPingCount

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

FLD_commandStateMask

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

FLD_expectAck

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

FLD_expectAckCode

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

FLD_lastAckCommand

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

FLD_lastAckResponse

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

FLD_lastAckTime

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

FLD_dcsPropertiesID

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

FLD_dcsCommandHost

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

FLD_dcsConfigMask

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

FLD_dcsConfigString

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

FLD_supportsDMTP

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

FLD_supportedEncodings

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

FLD_unitLimitInterval

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

FLD_maxAllowedEvents

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

FLD_totalProfileMask

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

FLD_totalMaxConn

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

FLD_totalMaxConnPerMin

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

FLD_duplexProfileMask

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

FLD_duplexMaxConn

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

FLD_duplexMaxConnPerMin

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

FLD_lastTotalConnectTime

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

FLD_lastDuplexConnectTime

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

FLD_lastInputState

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

FLD_lastOutputState

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

FLD_statusCodeState

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

FLD_lastBatteryLevel

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

FLD_lastFuelLevel

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

FLD_lastFuelTotal

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

FLD_lastOilLevel

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

FLD_lastValidLatitude

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

FLD_lastValidLongitude

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

FLD_lastValidHeading

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

FLD_lastValidSpeedKPH

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

FLD_lastGPSTimestamp

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

FLD_lastEventTimestamp

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

FLD_lastCellServingInfo

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

FLD_lastDistanceKM

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

FLD_lastOdometerKM

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

FLD_odometerOffsetKM

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

FLD_lastEngineOnHours

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

FLD_lastEngineOnTime

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

FLD_lastEngineOffTime

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

FLD_lastEngineHours

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

FLD_engineHoursOffset

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

FLD_lastIgnitionOnHours

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

FLD_lastIgnitionOnTime

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

FLD_lastIgnitionOffTime

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

FLD_lastIgnitionHours

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

FLD_lastStopTime

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

FLD_lastStartTime

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

FLD_lastMalfunctionLamp

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

FLD_lastFaultCode

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

FLD_allowNotify

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

FLD_lastNotifyTime

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

FLD_lastNotifyCode

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

FLD_lastNotifyRule

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

FLD_notifyEmail

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

FLD_notifySelector

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

FLD_notifyAction

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

FLD_notifyDescription

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

FLD_notifySubject

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

FLD_notifyText

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

FLD_notifyUseWrapper

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

FLD_notifyPriority

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

FLD_lastSubdivision

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

FLD_parkedLatitude

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

FLD_parkedLongitude

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

FLD_parkedRadius

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

FLD_parkedMaxSpeedKPH

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

FLD_proximityRadius

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

FLD_proximityGroupID

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

FLD_proximityMaximumAge

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

FLD_assignedUserID

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

FLD_thermalProfile

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

FLD_hoursOfOperation

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

FLD_pendingMessage

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

FLD_pendingMessageACK

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

FLD_lastEventsPerSecond

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

FLD_lastEventsPerSecondMS

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

NotificationFieldInfo

public static final DBField[] NotificationFieldInfo

FLD_borderCrossing

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

FLD_lastBorderCrossTime

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

BorderCrossingFieldInfo

public static final DBField[] BorderCrossingFieldInfo

FLD_linkURL

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

FLD_linkDescription

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

LinkFieldInfo

public static final DBField[] LinkFieldInfo

FLD_fixedLatitude

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

FLD_fixedLongitude

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

FLD_fixedAddress

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

FLD_fixedContactPhone

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

FLD_fixedServiceTime

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

FixedLocationFieldInfo

public static final DBField[] FixedLocationFieldInfo

FLD_activeCorridor

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

GeoCorridorFieldInfo

public static final DBField[] GeoCorridorFieldInfo

FLD_maintIntervalKM0

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

FLD_maintOdometerKM0

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

FLD_maintIntervalKM1

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

FLD_maintOdometerKM1

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

FLD_maintIntervalHR0

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

FLD_maintEngHoursHR0

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

FLD_maintNotes

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

FLD_reminderType

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

FLD_reminderMessage

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

FLD_reminderInterval

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

FLD_reminderTime

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

FLD_lastServiceTime

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

FLD_nextServiceTime

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

MaintOdometerFieldInfo

public static final DBField[] MaintOdometerFieldInfo

FLD_workOrderID

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

FLD_jobNumber

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

FLD_jobLatitude

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

FLD_jobLongitude

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

FLD_jobRadius

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

WorkOrderInfo

public static final DBField[] WorkOrderInfo

FLD_lastDataPushTime

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

FLD_lastEventCreateMillis

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

DataPushInfo

public static final DBField[] DataPushInfo

FLD_eLogEnabled

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

FLD_lastELogState

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

ELogHOSInfo

public static final DBField[] ELogHOSInfo

FLD_maxPassengers

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

FLD_customAttributes

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

AttributeInfo

public static final DBField[] AttributeInfo

DefaultWorkHours

public static WorkHours DefaultWorkHours

KEY_LICENSE_PLATE

public static final java.lang.String[] KEY_LICENSE_PLATE

KEY_DRIVER_BADGE

public static final java.lang.String[] KEY_DRIVER_BADGE

KEY_DRIVER_LICENSE

public static final java.lang.String[] KEY_DRIVER_LICENSE

KEY_DRIVER_PHONE

public static final java.lang.String[] KEY_DRIVER_PHONE
Constructor Detail

Device

public Device()

Device

public Device(Device.Key key)
Method Detail

SetLogEventDataInsertion

public static void SetLogEventDataInsertion(int logLevel)

MinMax

public static long MinMax(long val,
                          long min,
                          long max)

MinMax

public static double MinMax(double val,
                            double min,
                            double max)

initEventsPerSecond

public static void initEventsPerSecond()

GetTitles

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

GetEquipmentStatusMap

public static OrderedMap<java.lang.String,java.lang.String> GetEquipmentStatusMap(java.util.Locale locale)
Return a map of EquipmentStatus keys to description


getReminderType

public static Device.ReminderType getReminderType(Device d)
Returns the defined ReminderType for the specified device.

Parameters:
d - The device from which the ReminderType will be obtained. If null, the default ReminderType will be returned.
Returns:
The ReminderType [0=periodic, 1=single]

CalculateFuelCost

public static double CalculateFuelCost(Account a,
                                       Device d,
                                       double liters)

GetCheckLastOdometer

public static boolean GetCheckLastOdometer()
Get configured maximum allowed odometer value

Returns:
Maximum configured allowed odometer value

GetSimulateEngineHours

public static boolean GetSimulateEngineHours(Device dev)
Get configured state of estimating engine hours based on ignition state

Returns:
Estimating engine hours based on ignition state

UpdateEventWithGeozoneLocation

public static boolean UpdateEventWithGeozoneLocation()
Get configured state obtaining lat/lon from Geozone

Returns:
Obtain lat/lon from Geozone

GetMaximumOdometerKM

public static double GetMaximumOdometerKM()
Get configured maximum allowed odometer value

Returns:
Maximum configured allowed odometer value

GetMaximumRuntimeHours

public static double GetMaximumRuntimeHours()
Get configured maximum allowed engine-hours value

Returns:
Maximum configured allowed engine-hours value

CheckNotifySelector

public static boolean CheckNotifySelector()
True to test notify rule selector, false to ignore

Returns:
True to test notify rule selector, false to ignore

GetSaveEventDriverID

public static boolean GetSaveEventDriverID()
Returns true if configured to save the EventData "driverID" into the Device record

Returns:
True to save EventData "driverID", false otherwise.

setCellTowerGetLocation

public static void setCellTowerGetLocation(org.opengts.cellid.MobileLocationProvider ctgl)
Sets the MobileLocationProvider

Parameters:
ctgl - The MobileLocationProvider

hasCellTowerGetLocation

public static boolean hasCellTowerGetLocation()
Returns true if a MobileLocationProvider is defined

Returns:
True if a MobileLocationProvider is defined

getMobileLocationProvider

public static org.opengts.cellid.MobileLocationProvider getMobileLocationProvider()
Gets the MobileLocationProvider

Returns:
The MobileLocationProvider

setRuleFactory

public static void setRuleFactory(RuleFactory rf)
Sets the RuleFactory

Parameters:
rf - The RuleFactory

hasRuleFactory

public static boolean hasRuleFactory()
Returns true if a RuleFactory is defined

Returns:
True if a RuleFactory is defined

hasENRE

public static boolean hasENRE()
Returns true if the defined RuleFactory is the ENRE

Returns:
True if the defined RuleFactory is the ENRE

getRuleFactory

public static RuleFactory getRuleFactory()
Gets the RuleFactory

Returns:
The RuleFactory

getRuleFactory

public static RuleFactory getRuleFactory(boolean checkRuntime)
Gets the RuleFactory

Parameters:
checkRuntime - True to peform the RuleFactory runtime validation
Returns:
The RuleFactory

setSessionStatsFactory

public static void setSessionStatsFactory(SessionStatsFactory rf)
Sets the SessionStatsFactory

Parameters:
rf - The SessionStatsFactory

hasSessionStatsFactory

public static boolean hasSessionStatsFactory()
Returns true if a SessionStatsFactory has been defined

Returns:
True if a SessionStatsFactory has been defined

getSessionStatsFactory

public static SessionStatsFactory getSessionStatsFactory()
Gets the SessionStatsFactory

Returns:
The SessionStatsFactory

setEntityManager

public static void setEntityManager(EntityManager ef)
Sets the EntityManager

Parameters:
ef - The EntityManager

hasEntityManager

public static boolean hasEntityManager()
Returns true if an EntityManager has been defined

Returns:
True if an EntityManager has been defined

getEntityManager

public static EntityManager getEntityManager()
Gets the defined EntityManager

Returns:
The defined EntityManager

getEntityDescription

public static java.lang.String getEntityDescription(java.lang.String accountID,
                                                    java.lang.String entityID,
                                                    EntityManager.EntityType etype)
Gets the Description for the specified Entity ID

Parameters:
accountID - The Account ID
entityID - The Entity ID
etype - The Entity type
Returns:
The Entity Description

getEntityDescription

public static java.lang.String getEntityDescription(java.lang.String accountID,
                                                    java.lang.String entityID,
                                                    int etype)
Gets the Description for the specified Entity ID

Parameters:
accountID - The Account ID
entityID - The Entity ID
etype - The Entity type
Returns:
The Entity Description

isEntityAttached

public static boolean isEntityAttached(java.lang.String accountID,
                                       java.lang.String deviceID,
                                       java.lang.String entityID,
                                       EntityManager.EntityType etype)
Returns true if the specified Entity is attached to the specified Device ID

Parameters:
accountID - The Account ID
deviceID - The Device ID
entityID - The Entity ID
etype - The Entity type
Returns:
True if the Entity is attached to the device

isEntityAttached

public static boolean isEntityAttached(java.lang.String accountID,
                                       java.lang.String deviceID,
                                       java.lang.String entityID,
                                       int etype)
Returns true if the specified Entity is attached to the specified Device ID

Parameters:
accountID - The Account ID
deviceID - The Device ID
entityID - The Entity ID
etype - The Entity type
Returns:
True if the Entity is attached to the device

setFuelManager

public static void setFuelManager(FuelManager fm)
Sets the FuelManager

Parameters:
fm - The FuelManager

hasFuelManager

public static boolean hasFuelManager()
Returns true if a FuelManager has been defined

Returns:
True if a FuelManager has been defined

getFuelManager

public static FuelManager getFuelManager()
Gets the FuelManager

Returns:
The FuelManager

setPingDispatcher

public static void setPingDispatcher(PingDispatcher pd)
Sets the PingDispatcher

Parameters:
pd - The PingDispatcher

hasPingDispatcher

public static boolean hasPingDispatcher()
Returns true if a PingDispatcher has been defined

Returns:
True if a PingDispatcher has been defined

getPingDispatcher

public static PingDispatcher getPingDispatcher()
Gets the PingDispatcher

Returns:
The PingDispatcher

pastEventDateAction

public static int pastEventDateAction()
Gets the action to perform when a past event date is detected

Returns:
The action to perform when a past event date is detected

pastEventDateMaximumSec

public static long pastEventDateMaximumSec()
Gets the maximum number of seconds an event is allowed to be into the past

Returns:
The maximum number of seconds into the past

futureEventDateAction

public static int futureEventDateAction()
Gets the action to perform when a future event date is detected

Returns:
The action to perform when a future event date is detected

futureEventDateMaximumSec

public static long futureEventDateMaximumSec()
Gets the maximum number of seconds an event is allowed to be into the future

Returns:
The maximum number of seconds into the future

invalidSpeedAction

public static int invalidSpeedAction()

invalidSpeedMaximumKPH

public static double invalidSpeedMaximumKPH()

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<Device> getFactory()
Gets the Device DBFactory

Returns:
The Device DBFactory

getTableDescription

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

getGroupID

public java.lang.String getGroupID()
Gets the user informational Group ID
(user informational only, not used by DeviceGroup)
(currently used in various ReportLayout subclasses)

Returns:
The groupID used for user informational purposes only

setGroupID

public void setGroupID(java.lang.String v)
Sets the user informational Group ID
(user informational only, not used by DeviceGroup)
(currently used in various ReportLayout subclasses)

Parameters:
v - The user informational group id

getEquipmentType

public java.lang.String getEquipmentType()
Gets the equipment type

Returns:
The equipment type

setEquipmentType

public void setEquipmentType(java.lang.String v)
Sets the equipment type

Parameters:
v - The equipment type

hasEquipmentStatus

public boolean hasEquipmentStatus()
Returns true if an equipment-status is defined for this Device

Returns:
True if an equipment-status is defined for this Device

getEquipmentStatus

public java.lang.String getEquipmentStatus()
Gets the equipment status

Returns:
The equipment status

setEquipmentStatus

public void setEquipmentStatus(java.lang.String v)
Sets the equipment status

Parameters:
v - The equipment status

getVehicleMake

public java.lang.String getVehicleMake()
Gets the vehicle make

Returns:
The vehicle make

setVehicleMake

public void setVehicleMake(java.lang.String v)
Sets the vehicle make

Parameters:
v - The vehicle make

getVehicleModel

public java.lang.String getVehicleModel()
Gets the vehicle model

Returns:
The vehicle model

setVehicleModel

public void setVehicleModel(java.lang.String v)
Sets the vehicle model

Parameters:
v - The vehicle model

getVehicleYear

public int getVehicleYear()
Gets the vehicle year

Returns:
The vehicle year

setVehicleYear

public void setVehicleYear(int v)
Sets the vehicle year

Parameters:
v - The vehicle year

hasVehicleID

public boolean hasVehicleID()
Returns true if the Vehicle Identification Number (VIN) is defined

Returns:
The Vehicle ID (VIN)

getVehicleID

public java.lang.String getVehicleID()
Gets the Vehicle Identification Number (VIN)

Returns:
The Vehicle ID (VIN)

setVehicleID

public void setVehicleID(java.lang.String v)
Sets the Vehicle Identification Number (VIN)

Parameters:
v - The Vehicle ID (VIN)

getLastVehicleID

public java.lang.String getLastVehicleID()
Gets the previous value for the VIN. (Used for testing VIN changes only) Does not return null.


hasVinChanged

public boolean hasVinChanged()
Returns true if the VIN has changed


getLicensePlate

public java.lang.String getLicensePlate()
Gets the Vehicle License Plate

Returns:
The License Plate

setLicensePlate

public void setLicensePlate(java.lang.String v)
Sets the Vehicle License Plate

Parameters:
v - The License Plate

getLicenseExpire

public long getLicenseExpire()
Gets the license/registration expiration date as a DayNumber value

Returns:
The license expiration date as a DayNumber value

setLicenseExpire

public void setLicenseExpire(long v)
Sets the license/registration expiration date as a DayNumber value

Parameters:
v - The license expiration date as a DayNumber value

setLicenseExpire

public void setLicenseExpire(int year,
                             int month1,
                             int day)
Sets the license/registration expiration date

Parameters:
year - The expiration year
month1 - The expiration month
day - The expiration day

setLicenseExpire

public void setLicenseExpire(DayNumber dn)
Sets the license/registration expiration date as a DayNumber instance

Parameters:
dn - The license expiration date as a DayNumber instance

isLicenseExpired

public boolean isLicenseExpired(long asofDay)
Returns true if the license/registration is expired as-of the specified date

Parameters:
asofDay - The as-of expiration test DayNumber

isLicenseExpired

public boolean isLicenseExpired(DayNumber asof)
Returns true if the license/registration is expired as-of the specified date

Parameters:
asof - The as-of expiration test DayNumber

getInsuranceExpire

public long getInsuranceExpire()
Gets the insurance expiration date as a DayNumber value

Returns:
The insurance expiration date as a DayNumber value

setInsuranceExpire

public void setInsuranceExpire(long v)
Sets the insurance expiration date as a DayNumber value

Parameters:
v - The insurance expiration date as a DayNumber value

setInsuranceExpire

public void setInsuranceExpire(int year,
                               int month1,
                               int day)
Sets the insurance expiration date

Parameters:
year - The expiration year
month1 - The expiration month
day - The expiration day

setInsuranceExpire

public void setInsuranceExpire(DayNumber dn)
Sets the insurance expiration date as a DayNumber instance

Parameters:
dn - The insurance expiration date as a DayNumber instance

isInsuranceExpired

public boolean isInsuranceExpired(long asofDay)
Returns true if the insurance is expired as-of the specified date

Parameters:
asofDay - The as-of expiration test DayNumber

isInsuranceExpired

public boolean isInsuranceExpired(DayNumber asof)
Returns true if the insurance is expired as-of the specified date

Parameters:
asof - The as-of expiration test DayNumber

hasDriverID

public boolean hasDriverID()
Returns true if a driver-id is defined for this Device

Returns:
True if this Device record defines a DriverID

isDriverID

public boolean isDriverID(java.lang.String drvID)
Returns true if the specified driver-id matches the current driver-id. If either the specified driver-id or current driver-id are blank, then returns false.

Returns:
True if the specified driver-id matches the current driver-id.

getDriverID

public java.lang.String getDriverID()
Gets the Driver-ID, or blank if not defined

Returns:
The Driver-ID

setDriverID

public void setDriverID(java.lang.String v)
Sets the Driver-ID

Parameters:
v - The Driver-ID

getDriver

public Driver getDriver()
Gets the Driver record, or null if not defined

Returns:
The Driver record, or null if undefined

hasDriverStatus

public boolean hasDriverStatus()
Returns true if a driver-status is defined for this Device

Returns:
True if a driver-status is defined for this Device

getDriverStatus

public long getDriverStatus()
Gets the driver status

Returns:
The driver status

setDriverStatus

public void setDriverStatus(long v)
Sets the driver status

Parameters:
v - The driver status

getFuelCapacity

public double getFuelCapacity()
Gets the tank Fuel Capacity, in Liters

Returns:
The tank Fuel Capacity, in Liters

setFuelCapacity

public void setFuelCapacity(double v)
Sets the tank Fuel Capacity, in Liters

Parameters:
v - The tank Fuel Capacity, in Liters

getFuelEconomy

public double getFuelEconomy()
Gets the approximate Fuel Economy, in Km/Liter

Returns:
The approximate Fuel Economy, in Km/Liter

setFuelEconomy

public void setFuelEconomy(double v)
Sets the approximate Fuel Economy, in Km/Liter

Parameters:
v - The approximate Fuel Economy, in Km/Liter

getFuelRatePerHour

public double getFuelRatePerHour()
Gets the approximate Fuel Consumption Rate in Litres/Hour

Returns:
The approximate Fuel Consumption Rate in Litres/Hour

setFuelRatePerHour

public void setFuelRatePerHour(double v)
Sets the approximate Fuel Consumption Rate in Litres/Hour

Parameters:
v - The approximate Fuel Consumption Rate in Litres/Hour

getFuelCostPerLiter

public double getFuelCostPerLiter()
Gets the Fuel cost per Liter

Returns:
The Fuel cost per Liter

setFuelCostPerLiter

public void setFuelCostPerLiter(double v)
Sets the Fuel cost per Liter

Parameters:
v - The Fuel cost per Liter

getFuelTankProfile

public java.lang.String getFuelTankProfile()
Gets the Fuel tank profile

Returns:
The Fuel tank profile

setFuelTankProfile

public void setFuelTankProfile(java.lang.String v)
Sets the Fuel tank profile

Parameters:
v - The Fuel tank profile

hasFuelTankProfile

public boolean hasFuelTankProfile()
Returns true if a Fuel tank profile is defined

Returns:
True if a Fuel tank profile is defined

getFuelLevelProfile

public FuelLevelProfile getFuelLevelProfile(FuelLevelProfile dft)
Gets the FuelLevelProfile instance. Returns "dft" if no FuelLevelProfile defined.


getFuelLevelProfile

public FuelLevelProfile getFuelLevelProfile()
Gets the FuelLevelProfile instance. Returns "LINEAR" if no FuelLevelProfile defined. (does not return null)


getActualFuelLevel

public double getActualFuelLevel(double fuelLevel)
Gets the FuelLevelProfile instance


getSpeedLimitKPH

public double getSpeedLimitKPH()
Gets the assigned speed limit for this device, in km/h

Returns:
The assigned speed limit for this device, in km/h

setSpeedLimitKPH

public void setSpeedLimitKPH(double v)
Sets the assigned speed limit for this device, in km/h

Parameters:
v - The assigned speed limit for this device, in km/h

getPlanDistanceKM

public double getPlanDistanceKM()
Gets the assigned "Plan Distance" for this device, in kilometers

Returns:
The assigned "Plan Distance" for this device, in kilometers

setPlanDistanceKM

public void setPlanDistanceKM(double v)
Sets the assigned "Plan Distance" for this device, in kilometers

Parameters:
v - The assigned "Plan Distance" for this device, in kilometers

getInstallTime

public long getInstallTime()
Gets the install time of this Device (in Unix Epoch time format)

Returns:
The install time of this Device, or '0' if undefined.

setInstallTime

public void setInstallTime(long v)
Sets the install time of this Device (in Unix Epoch time format)

Parameters:
v - The install time of this Device, or '0' if undefined.

getResetTime

public long getResetTime()
Gets the reset time of this Device (in Unix Epoch time format)

Returns:
The reset time of this Device, or '0' if undefined.

setResetTime

public void setResetTime(long v)
Sets the reset time of this Device (in Unix Epoch time format)

Parameters:
v - The reset time of this Device, or '0' if undefined.

getExpirationTime

public long getExpirationTime()
Gets the expiration time of this Device (in Unix Epoch time format)

Returns:
The expiration time of this Device, or '0' if this Device never expires.

setExpirationTime

public void setExpirationTime(long v)
Sets the expiration time of this Device (in Unix Epoch time format)

Parameters:
v - The expiration time of this Device, or '0' if this Device never expires.

isExpired

public boolean isExpired()
Returns true if this Device has expired

Returns:
True if this Device has expired

doesExpire

public boolean doesExpire()
Returns true if this Device has an expiry date

Returns:
True if this Device has an expiry date

willExpire

public boolean willExpire(long withinSec)
Returns true if this Device will expire within the specified number of seconds

Parameters:
withinSec - The tested expiry time range (in seconds)
Returns:
True if this Device will expire within the specified number of seconds

supportsLinkURL

public static boolean supportsLinkURL()
Returns true if this Device record supports the "linkURL" field

Returns:
True if this Device record supports the "linkURL" field

hasLink

public boolean hasLink()
Returns true if this Device record defines a non-blank Link-URL value

Returns:
True if this Device record defines a non-blank Link-URL value

getLinkURL

public java.lang.String getLinkURL()
Gets the Link-URL for this Device

Returns:
The Link-URL for this Device

setLinkURL

public void setLinkURL(java.lang.String v)
Sets the Link-URL for this Device

Parameters:
v - The Link-URL for this Device

getLinkDescription

public java.lang.String getLinkDescription()
Gets the Link-Description for this Device

Returns:
The Link-Description for this Device

setLinkDescription

public void setLinkDescription(java.lang.String v)
Sets the Link-Description for this Device

Parameters:
v - The Link-Description for this Device

supportsNotification

public static boolean supportsNotification()
Returns true if this Device record supports the "allowNotify" field

Returns:
True if this Device record supports the "allowNotify" field

getAllowNotify

public boolean getAllowNotify()
Returns true if this device allows notifications

Returns:
True if this device allows notifications

setAllowNotify

public void setAllowNotify(boolean v)
Sets the "Allow Notification" state for this Device

Parameters:
v - The "Allow Notification" state for this Device

getAllowNotify

public boolean getAllowNotify(boolean checkAccount)
Returns true if this device allows notifications

Parameters:
checkAccount - True to also check Account
Returns:
True if this device allows notifications

getLastNotifyTime

public long getLastNotifyTime()
Gets the Last Notification time for this Device (in Unix Epoch time format)

Returns:
The Last Notification time for this Device (in Unix Epoch time format)

setLastNotifyTime

public void setLastNotifyTime(long v)
Sets the Last Notification time for this Device (in Unix Epoch time format)

Parameters:
v - The Last Notification time for this Device (in Unix Epoch time format)

getLastNotifyCode

public int getLastNotifyCode()
Gets the Last Notification Status-Code for this Device

Returns:
The Last Notification Status-Code for this Device

setLastNotifyCode

public void setLastNotifyCode(int v)
Sets the Last Notification Status-Code for this Device

Parameters:
v - The Last Notification Status-Code for this Device

getLastNotifyRule

public java.lang.String getLastNotifyRule()
Gets the Rule-ID which triggered the Last Notification for this Device

Returns:
The Rule-ID which triggered the Last Notification for this Device

setLastNotifyRule

public void setLastNotifyRule(java.lang.String v)
Sets the Rule-ID which triggered the Last Notification for this Device

Parameters:
v - The Rule-ID which triggered the Last Notification for this Device

setLastNotifyEvent

public void setLastNotifyEvent(long timestamp,
                               java.lang.String ruleID,
                               boolean update)
                        throws DBException
Sets the event information for the last rule-triggered notification

Parameters:
timestamp - The timestamp (Unix Epoch format) of the notification
ruleID - The Rule-ID which triggered the notification
update - True to update the Device record now
Throws:
DBException

setLastNotifyEvent

public void setLastNotifyEvent(EventData event,
                               java.lang.String ruleID,
                               boolean update)
                        throws DBException
Sets the event information for the last rule-triggered notification

Parameters:
event - The EventData record of the notification
ruleID - The Rule-ID which triggered the notification
update - True to update the Device record now
Throws:
DBException

clearLastNotifyEvent

public void clearLastNotifyEvent(boolean update)
                          throws DBException
Clears the last notification for this Device

Parameters:
update - True to update the Device record after clearing
Throws:
DBException

getLastNotifyEvent

public EventData getLastNotifyEvent()
Gets the EventData record for the last notification

Returns:
The EventData record for the last notification

getNotifyEmail

public java.lang.String getNotifyEmail()
Gets the Notification Email address

Returns:
The Notification Email Address

setNotifyEmail

public void setNotifyEmail(java.lang.String v)
Sets the Notification Email address

Parameters:
v - The Notification Email Address

getMaximumNotifyEmailLength

public static int getMaximumNotifyEmailLength()
Gets the maximum Notify Email length


getNotifyEmail

@Deprecated
public java.lang.String getNotifyEmail(boolean inclAccount,
                                                  boolean inclUser)
Deprecated. 

Returns a String containing all email address that should be notified for this Device

Parameters:
inclAccount - True to include the Account notify email address
inclUser - True to include the assigned User notify email address
Returns:
The String containing email addresses to notify

getNotifyEmail

public java.lang.String getNotifyEmail(boolean inclAccount,
                                       boolean inclUser,
                                       boolean inclGroup)
Returns a String containing all email address that should be notified for this Device

Parameters:
inclAccount - True to include the Account notify email address
inclUser - True to include the assigned User notify email address
inclGroup - True to include the notify email address from all group memberships
Returns:
The String containing email addresses to notify

getNotifySelector

public java.lang.String getNotifySelector()
Gets the Rule Selector to be evaluated by the installed RuleFactory.
This rule-selector is currently only used by default with the "RuleFactoryLite" module.

Returns:
The rule-selector to evaluate

setNotifySelector

public void setNotifySelector(java.lang.String v)
Sets the Rule Selector to be evaluated by the installed RuleFactory.
This rule-selector is currently only used by default with the "RuleFactoryLite" module.

Parameters:
v - The rule-selector to evaluate

getNotifyAction

public int getNotifyAction()
Gets the Notify Actions to be executed if the Notify Rule-Selector is triggered.
This notify action is currently only used by default with the "RuleFactoryLite" module.

Returns:
The notify action mask

setNotifyAction

public void setNotifyAction(int v)
Sets the Notify Actions to be executed if the Notify Rule-Selector is triggered.
This notify action is currently only used by default with the "RuleFactoryLite" module.

Parameters:
v - The notify action mask

getNotifyDescription

public java.lang.String getNotifyDescription()
Gets the Notify Description for the rule-selector specified.
This notify description is currently only used by default with the "RuleFactoryLite" module.

Returns:
The notify description

setNotifyDescription

public void setNotifyDescription(java.lang.String v)
Sets the Notify Description for the rule-selector specified.
This notify description is currently only used by default with the "RuleFactoryLite" module.

Parameters:
v - The notify description

getNotifySubject

public java.lang.String getNotifySubject()
Gets the Email Subject for the triggered notification email .
This email subject is currently only used by default with the "RuleFactoryLite" module.

Returns:
The notify email subject

setNotifySubject

public void setNotifySubject(java.lang.String v)
Sets the Email Subject for the triggered notification email .
This email subject is currently only used by default with the "RuleFactoryLite" module.

Parameters:
v - The notify email subject

getNotifyText

public java.lang.String getNotifyText()
Gets the Email Body/Text for the triggered notification email .
This email body/text is currently only used by default with the "RuleFactoryLite" module.

Returns:
The notify email body

setNotifyText

public void setNotifyText(java.lang.String v)
Sets the Email Body/Text for the triggered notification email .
This email body/text is currently only used by default with the "RuleFactoryLite" module.

Parameters:
v - The notify email body

getNotifyUseWrapper

public boolean getNotifyUseWrapper()
(OBSOLETE) Gets the configuration state indicating whether the email wrapper from the "private.xml" file should be used.
The method is obsolete and should not be used.

Returns:
The email wrapper configuration state

setNotifyUseWrapper

public void setNotifyUseWrapper(boolean v)
(OBSOLETE) Sets the configuration state indicating whether the email wrapper from the "private.xml" file should be used.
The method is obsolete and should not be used.

Parameters:
v - The email wrapper configuration state

getNotifyPriority

public int getNotifyPriority()
(OBSOLETE) Gets the notification priority.
The method is obsolete and should not be used.

Returns:
The notification priority

setNotifyPriority

public void setNotifyPriority(int v)
(OBSOLETE) Sets the notification priority.
The method is obsolete and should not be used.

Parameters:
v - The notification priority

clearParkedLocation

public void clearParkedLocation(boolean update)
                         throws DBException
Clears the parked location state

Throws:
DBException

setParkedLocation

public void setParkedLocation(GeoPoint parkLoc,
                              double parkRadM,
                              double parkSpeed,
                              boolean update)
                       throws DBException
Sets the parked location state

Parameters:
parkLoc - The GeoPoint of the location where the device should be "parked"
parkRadM - The radius, in meters, of the parked location
parkSpeed - The maximum speed allowed within the parked location
update - True to update the Device record now
Throws:
DBException

saveParkedLocation

public void saveParkedLocation()
                        throws DBException
Saves the set parked location back to the Device table

Throws:
DBException

isParked

public boolean isParked()
Returns true if this Device is parked

Returns:
True if this Device is parked

isParkedViolation

public boolean isParkedViolation(GeoPoint gp,
                                 double speedKPH)
Returns true if the specified GeoPoint location indicates a "Park" violation

Parameters:
gp - The current GeoPoint to test
speedKPH - The current speed to test
Returns:
True if the specified GeoPoint location indicates a "Park" violation

getParkedLatitude

public double getParkedLatitude()
Gets the Parked Latitude

Returns:
The parked latitude

setParkedLatitude

public void setParkedLatitude(double v)
Sets the Parked Latitude

Parameters:
v - The parked latitude

getParkedLongitude

public double getParkedLongitude()
Gets the Parked Longitude

Returns:
The parked Longitude

setParkedLongitude

public void setParkedLongitude(double v)
Sets the Parked Longitude

Parameters:
v - The parked Longitude

getParkedLocation

public GeoPoint getParkedLocation()
Gets the Parked GeoPoint

Returns:
The Parked GeoPoint, or an invalid GeoPoint (0/0) if not parked

getParkedRadius

public double getParkedRadius()
Gets the parked radius, in meters

Returns:
The parked radius, in meters

setParkedRadius

public void setParkedRadius(double v)
Sets the parked radius, in meters

Parameters:
v - The parked radius, in meters

getParkedMaxSpeedKPH

public double getParkedMaxSpeedKPH()
Gets the parked maximum speed km/h

Returns:
The parked maximum speed km/h

setParkedMaxSpeedKPH

public void setParkedMaxSpeedKPH(double v)
Sets the parked maximum speed km/h

Parameters:
v - The parked maximum speed km/h

getParkedAddress

public java.lang.String getParkedAddress()
Gets the parked address, if parked

Returns:
The parked address, if parked

setParkedAddress

public void setParkedAddress(java.lang.String v)
Sets the parked address, if parked

Parameters:
v - The parked address, if parked

getProximityRadius

public double getProximityRadius()
Gets the nearby proximity radius, in meters

Returns:
The nearby proximity radius, in meters

setProximityRadius

public void setProximityRadius(double v)
Sets the nearby proximity radius, in meters

Parameters:
v - The nearby proximity radius, in meters

getProximityBoundingBox

public GeoBounds getProximityBoundingBox(long asOfTime)
Gets the proximity bounding box. Returns null if a proximity bounding box is not applicable


getProximityGroupID

public java.lang.String getProximityGroupID()
Gets the nearby proximity Group ID

Returns:
The groupID used for checking nearby devices

setProximityGroupID

public void setProximityGroupID(java.lang.String v)
Sets the nearby proximity Group ID

Parameters:
v - The nearby proximity group id

getProximityMaximumAge

public long getProximityMaximumAge()
Gets the nearby proximity location maximum age (in seconds)

Returns:
The nearby proximity location maximum age (in seconds)

setProximityMaximumAge

public void setProximityMaximumAge(long v)
Sets the nearby proximity location maximum age (in seconds)

Parameters:
v - The nearby proximity location maximum age (in seconds)

supportsBorderCrossing

public static boolean supportsBorderCrossing()
Returns true if this Device record supports Border-Crossing

Returns:
True if this Device record supports Border-Crossing

isBorderCrossing

public boolean isBorderCrossing()
Returns true if Border-Crossing is enabled

Returns:
True if Border-Crossing is enabled

getBorderCrossing

public int getBorderCrossing()
Gets the Border-Crossing enabled state

Returns:
The Border-Crossing enabled state

setBorderCrossing

public void setBorderCrossing(int flags)
Sets the Border-Crossing enabled state

Parameters:
flags - The Border-Crossing enabled state

setBorderCrossing

public void setBorderCrossing(Device.BorderCrossingState bcs)
Sets the Border-Crossing enabled state

Parameters:
bcs - The Border-Crossing enabled state

getLastBorderCrossTime

public long getLastBorderCrossTime()
Gets the last calculated Border-Crossing time (Unix Epoch format)

Returns:
The last calculated Border-Crossing time (Unix Epoch format)

setLastBorderCrossTime

public void setLastBorderCrossTime(long v)
Sets the last calculated Border-Crossing time (Unix Epoch format)

Parameters:
v - The last calculated Border-Crossing time (Unix Epoch format)

getModemID

public java.lang.String getModemID()
Extracts the Mobile-ID from the IMEI# or Unique-ID
This method relies on the unique-id prefix to end with "_" or "-".

Returns:
The extracted Mobile-ID

setModemID

public void setModemID(java.lang.String mid)
Sets the preextracted Mobile-ID for this device

Parameters:
mid - The Mobile-ID for this device

getUniqueID

public java.lang.String getUniqueID()
Gets the Unique-ID for this Device

Specified by:
getUniqueID in interface DataTransport
Returns:
The Unique-ID

setUniqueID

public void setUniqueID(java.lang.String v)
Sets the Unique-ID for this Device

Parameters:
v - The Unique-ID

getDeviceCode

public java.lang.String getDeviceCode()
Gets the Device-Code (also called Server-ID) for this Device

Specified by:
getDeviceCode in interface DataTransport
Returns:
The Device-Code / Server-ID

setDeviceCode

public void setDeviceCode(java.lang.String v)
Sets the Device-Code (also called Server-ID) for this Device

Specified by:
setDeviceCode in interface DataTransport
Parameters:
v - The Device-Code / Server-ID

getDeviceType

public java.lang.String getDeviceType()
Gets the Device-Type for this Device

Specified by:
getDeviceType in interface DataTransport
Returns:
The Device-Type

setDeviceType

public void setDeviceType(java.lang.String v)
Sets the Device-Type for this Device

Specified by:
setDeviceType in interface DataTransport
Parameters:
v - The Device-Type

hasDcsPropertiesID

public boolean hasDcsPropertiesID()
Returns true if this device has a non-default DCS Properties ID

Returns:
True if this device has a non-default DCS Properties ID

getDcsPropertiesID

public java.lang.String getDcsPropertiesID()
Gets the DCS Properties ID assigned to this device (DCS Property ID)
Used by some DCS modules to select specific device configurations

Returns:
The DCS Property ID

setDcsPropertiesID

public void setDcsPropertiesID(java.lang.String v)
Sets the DCS Properties ID assigned to this device (DCS Property ID)
Used by some DCS modules to select specific device configurations

Parameters:
v - The DCS Property ID

GetDcsPropertiesID

public static java.lang.String GetDcsPropertiesID(Device device)
Gets the DCS Property ID for the specified device

Parameters:
device - The Device
Returns:
The DCS Property ID

getDcsCommandHost

public java.lang.String getDcsCommandHost()
Gets the DCS Command Host assigned to this device (ie. the host name where the DCS for this device is running)
May return blank to indicate that the default DCS command host should be used.

Returns:
The DCS Command Hostname

hasDcsCommandHost

public boolean hasDcsCommandHost()
Returns true if this device defines a custom command host.

Returns:
True if a custom command host is defined.

setDcsCommandHost

public void setDcsCommandHost(java.lang.String v)
Sets the DCS Command Host assigned to this device (ie. the host name where the DCS for this device is running)
May be blank to indicate that the default DCS command host should be used.

Parameters:
v - The DCS Command Hostname

hasPushpinID

public boolean hasPushpinID()
Returns true if this Device has a specific defined pushpin-id

Returns:
True if this Device has a specific defined pushpin-id

getPushpinID

public java.lang.String getPushpinID()
Gets the defined pushpin-id, or blank if no pushpin-id is defined

Returns:
The defined pushpin-id, or blank if no pushpin-id is defined

setPushpinID

public void setPushpinID(java.lang.String v)
Sets the defined pushpin-id, or blank if no pushpin-id is defined

Parameters:
v - The defined pushpin-id, or blank if no pushpin-id is defined

hasDisplayColor

public boolean hasDisplayColor()
Returns true if this Device has a specific defined display color

Returns:
True if this Device has a specific defined display color

getDisplayColor

public java.lang.String getDisplayColor()
Gets the defined display-color

Returns:
The defined display-color

getDisplayColor

public ColorTools.RGB getDisplayColor(ColorTools.RGB dft)
Gets the defined display-color, or returns the specified default color if not display-color is defined.

Returns:
The defined display-color

setDisplayColor

public void setDisplayColor(ColorTools.RGB v)
Sets the display color

Parameters:
v - The display color

setDisplayColor

public void setDisplayColor(java.lang.String v)
Sets the display color

Parameters:
v - The display color

getMapLegend

public java.lang.String getMapLegend()
Gets the map legend (currently not used)

Returns:
The map legend

setMapLegend

public void setMapLegend(java.lang.String legend)
Sets the map legend (currently not used)

Parameters:
legend - The map legend

getSerialNumber

public java.lang.String getSerialNumber()
Gets the assigned device serial number

Specified by:
getSerialNumber in interface DataTransport
Returns:
The serial number

setSerialNumber

public void setSerialNumber(java.lang.String v)
Sets the assigned device serial number

Specified by:
setSerialNumber in interface DataTransport
Parameters:
v - The serial number

getSimPhoneNumber

public java.lang.String getSimPhoneNumber()
Gets the SIM phone number

Specified by:
getSimPhoneNumber in interface DataTransport
Returns:
The SIM phone number

setSimPhoneNumber

public void setSimPhoneNumber(java.lang.String v)
Sets the SIM phone number

Specified by:
setSimPhoneNumber in interface DataTransport
Parameters:
v - The SIM phone number

getDeviceIDsForSimPhoneNumber

public static java.util.List<java.lang.String> getDeviceIDsForSimPhoneNumber(java.lang.String simPhone)
                                                                      throws DBException
Returns an array of Device-IDs for the specified SIM phone number

Parameters:
simPhone - The SIM phone number
Returns:
And array of Device-IDs for the specified SIM phone number
Throws:
DBException

getDeviceIDsForSimPhoneNumber

public static java.util.List<java.lang.String> getDeviceIDsForSimPhoneNumber(java.lang.String simPhone,
                                                                             char sepCH)
                                                                      throws DBException
Returns an array of Device-IDs for the specified SIM phone number

Parameters:
simPhone - The SIM phone number
sepCH - The preferred character for separating the account/device ids
Returns:
And array of Device-IDs for the specified SIM phone number
Throws:
DBException

getSimID

public java.lang.String getSimID()
Gets the SIM-ID

Returns:
The SIM-ID

setSimID

public void setSimID(java.lang.String v)
Gets the SIM-ID

Parameters:
v - The SIM-ID

getSmsEmail

public java.lang.String getSmsEmail()
Gets the SMS email address for this device.
Used for sending commands to the device using email-to-SMS.

Specified by:
getSmsEmail in interface DataTransport
Returns:
The SMS email address for this device

setSmsEmail

public void setSmsEmail(java.lang.String v)
Sets the SMS email address for this device.
Used for sending commands to the device using email-to-SMS.

Specified by:
setSmsEmail in interface DataTransport
Parameters:
v - The SMS email address for this device

getImeiNumber

public java.lang.String getImeiNumber()
Gets the IMEI# (or ESN) for this device.

Specified by:
getImeiNumber in interface DataTransport
Returns:
The IMEI# for this device

setImeiNumber

public void setImeiNumber(java.lang.String v)
Gets the IMEI# (or ESN) for this device.

Specified by:
setImeiNumber in interface DataTransport
Parameters:
v - The IMEI# for this device

validateDataKey

public boolean validateDataKey(java.lang.String pin)
Returns true if the specified key matches the "dataKey" (also call PIN) for this device

Parameters:
pin - The data key (PIN) to check
Returns:
True if the keys match

hasDataKey

public boolean hasDataKey()
Returns true if this device defines a data-key

Returns:
True if this device defines a data-key

getDataKey

public java.lang.String getDataKey()
Gets the data key (PIN) for this device

Returns:
The Data key (PIN) for this device

getDataKeyAsByteArray

public byte[] getDataKeyAsByteArray()
Gets the data key (PIN) for this device, as a byte array

Returns:
The Data key (PIN) for this device, as a byte array

setDataKey

public void setDataKey(java.lang.String v)
Gets the data key (PIN) for this device

Parameters:
v - The Data key (PIN) for this device

getLastInputState

public boolean getLastInputState(int bit)
Gets the specified bit state of the last digital input received

Returns:
The specified bit state of the last digital input received

getLastInputState

public long getLastInputState()
Gets the bit mask of the last digital input received
see also EventData.getInputMask()

Specified by:
getLastInputState in interface DataTransport
Returns:
The bit mask of the last digital input received

setLastInputState

public void setLastInputState(long v)
Sets the bit mask of the last digital input received

Specified by:
setLastInputState in interface DataTransport
Parameters:
v - The bit mask of the last digital input received

getLastOutputState

public boolean getLastOutputState(int bit)
Gets the specified bit state of the last digital output received

Returns:
The specified bit state of the last digital output received

getLastOutputState

public long getLastOutputState()
Gets the bit mask of the last digital output received
see also EventData.getOutputMask()

Specified by:
getLastOutputState in interface DataTransport
Returns:
The bit mask of the last digital output received

setLastOutputState

public void setLastOutputState(long v)
Sets the bit mask of the last digital output received

Specified by:
setLastOutputState in interface DataTransport
Parameters:
v - The bit mask of the last digital output received

getStatusCodeStateBit

public boolean getStatusCodeStateBit(int bit)
Gets the StatusCode state for the specified bit

Parameters:
bit - The bit index
Returns:
The StatusCode state for the specified bit

setStatusCodeStateBit

public void setStatusCodeStateBit(int bit,
                                  boolean state)
Sets the StatusCode state for the specified bit

Parameters:
bit - The bit index
state - The bit state

getStatusCodeState

public long getStatusCodeState()
Gets the bit mask of the StatusCode on/off state

Returns:
The bit mask of the StatusCode on/off state

setStatusCodeState

public void setStatusCodeState(long v)
Sets the bit mask of the StatusCode on/off state

Parameters:
v - The bit mask of the StatusCode on/off state

getLastBatteryLevel

public double getLastBatteryLevel()
Gets the last battery level recieved

Returns:
The last battery level recieved

setLastBatteryLevel

public void setLastBatteryLevel(double v)
Sets the last battery level recieved

Parameters:
v - The last battery level recieved

getLastFuelLevel

public double getLastFuelLevel()
Gets the last fuel level recieved

Returns:
The last fuel level recieved

setLastFuelLevel

public void setLastFuelLevel(double v)
Sets the last fuel level recieved

Parameters:
v - The last fuel level recieved

getLastFuelTotal

public double getLastFuelTotal()
Gets the last fuel total recieved

Returns:
The last fuel total recieved

setLastFuelTotal

public void setLastFuelTotal(double v)
Sets the last fuel total recieved

Parameters:
v - The last fuel total recieved

getFuelUsedInRange

public double getFuelUsedInRange(long startTime,
                                 long endTime)
Gets the fuel used within the specified time range


getLastOilLevel

public double getLastOilLevel()
Gets the last oil level recieved

Returns:
The last oil level recieved

setLastOilLevel

public void setLastOilLevel(double v)
Sets the last oil level recieved

Parameters:
v - The last oil level recieved

getIgnitionIndex

public int getIgnitionIndex()
Returns the bit index within the input mask which indicates the ignition state. If the ignition state is not indicated by a bit in the input state, but rather specific IGNITION_ON/IGNITION_OFF status code events, then this method returns "99". Returns "-1" if no ignition state bit index is defined.

Specified by:
getIgnitionIndex in interface DataTransport
Returns:
The ignition state but index.

setIgnitionIndex

public void setIgnitionIndex(int v)
Sets the bit index for the inputMask ignition state indicator.

Specified by:
setIgnitionIndex in interface DataTransport
Parameters:
v - The bit index, or 99 to indicate IGNITION_ON/IGNITION_OFF status codes

getIgnitionStatusCodes

public int[] getIgnitionStatusCodes()
Returns a 2 element array indicating the status codes which indicate the ignition state. The first element represents the ignition-off status code, and the second represents the ignition-on status code. Returns null if no ignition state status codes are defined.

Specified by:
getIgnitionStatusCodes in interface DataTransport
Returns:
The status codes indicating the ignition state, or null if not defined

getCurrentIgnitionState

public int getCurrentIgnitionState()
Returns the current ignition state
-1 = unknown
0 = off
1 = on

Returns:
The current ignition state for this device.

isIgnitionOn

public boolean isIgnitionOn(int code)
Returns true if the specified status code represents an Ignition-On for this device


isIgnitionOff

public boolean isIgnitionOff(int code)
Returns true if the specified status code represents an Ignition-Off for this device


getCurrentIgnitionState

public int getCurrentIgnitionState(boolean checkSC,
                                   boolean update)
Returns the current ignition state
-1 = unknown
0 = off
1 = on

Parameters:
checkSC - True to check ignition state based on the most recent event status codes
update - True to update Device last ignition on/off times
Returns:
The current ignition state for this device.

getIgnitionStateAsOfEvent

public int getIgnitionStateAsOfEvent(EventData ev)
Returns the ignition state as-of the specified Event
-1 = unknown
0 = off
1 = on


getIgnitionStateAsOfEvent

public int getIgnitionStateAsOfEvent(EventData ev,
                                     boolean checkSC)
Returns the ignition state as-of the specified Event
-1 = unknown
0 = off
1 = on


getEventIgnitionState

public int getEventIgnitionState(EventData ev)
Returns the ignition state change of the specified Event
-1 = no change
0 = changed to off
1 = changed to on


getDigitalInputIgnitionState

public boolean getDigitalInputIgnitionState(long gpioInput)
Returns the ignition state based on the specified digital input mask. Returns false if this device ignition state is based on Ignition On/Off status codes

Parameters:
gpioInput - The digital input mask
Returns:
True if the ignition bit index is on, false otherwise.

getCodeVersion

public java.lang.String getCodeVersion()
Gets the code/firmware version of this Device

Specified by:
getCodeVersion in interface DataTransport
Returns:
the code/firmware version of this Device

setCodeVersion

public void setCodeVersion(java.lang.String v)
Sets the code/firmware version of this Device

Specified by:
setCodeVersion in interface DataTransport
Parameters:
v - the code/firmware version of this Device

getFeatureSet

public java.lang.String getFeatureSet()
Gets the feature set of this Device

Specified by:
getFeatureSet in interface DataTransport
Returns:
the feature set of this Device

setFeatureSet

public void setFeatureSet(java.lang.String v)
Sets the feature set of this Device

Specified by:
setFeatureSet in interface DataTransport
Parameters:
v - The feature set of this Device

getIpAddressValid

public DTIPAddrList getIpAddressValid()
Gets the valid assigned IP address/mask for this Device
(used for validating incoming IP addresses used by this Device)

Specified by:
getIpAddressValid in interface DataTransport
Returns:
The valid assigned IP address/mask for this Device

setIpAddressValid

public void setIpAddressValid(DTIPAddrList v)
Sets the valid assigned IP address/mask for this Device
(used for validating incoming IP addresses used by this Device)

Specified by:
setIpAddressValid in interface DataTransport
Parameters:
v - The valid assigned IP address/mask for this Device

setIpAddressValid

public void setIpAddressValid(java.lang.String v)
Sets the valid assigned IP address/mask for this Device
(used for validating incoming IP addresses used by this Device)

Parameters:
v - The valid assigned IP address/mask for this Device

isValidIPAddress

public boolean isValidIPAddress(java.lang.String ipAddr)
Returns true if the specified IP address matches the IP address/mask assigned to this Device. (used for validating incoming IP addresses used by this Device)

Specified by:
isValidIPAddress in interface DataTransport
Parameters:
ipAddr - The IP address the Device is currently using to send data to the server
Returns:
True if IP address matches

hasLastTcpSessionID

public boolean hasLastTcpSessionID()
Returns true if this device has an assigned TCP session-id

Returns:
True if this device has an assigned TCP session-id

getLastTcpSessionID

public java.lang.String getLastTcpSessionID()
Gets the last TCP session ID

Returns:
The last TCP session ID

setLastTcpSessionID

public void setLastTcpSessionID(java.lang.String v)
Sets the last TCP session ID

Parameters:
v - The last TCP session ID

getIpAddressLocal

public DTIPAddress getIpAddressLocal()
Gets the local IP address to which this device sent its latest packet

Returns:
The local IP address for this Device

setIpAddressLocal

public void setIpAddressLocal(DTIPAddress v)
Sets the local IP address to which this device sent its latest packet

Parameters:
v - The local IP address for this Device

setIpAddressLocal

public void setIpAddressLocal(java.lang.String v)
Sets the local IP address to which this device sent its latest packet

Parameters:
v - The local IP address for this Device

getIpAddressCurrent

public DTIPAddress getIpAddressCurrent()
Gets the last known IP address used by the Device

Specified by:
getIpAddressCurrent in interface DataTransport
Returns:
The last known IP address used by the Device

setIpAddressCurrent

public void setIpAddressCurrent(DTIPAddress v)
Sets the last known IP address used by the Device

Parameters:
v - The last known IP address used by the Device

setIpAddressCurrent

public void setIpAddressCurrent(java.lang.String v)
Sets the last known IP address used by the Device

Specified by:
setIpAddressCurrent in interface DataTransport
Parameters:
v - The last known IP address used by the Device

getRemotePortCurrent

public int getRemotePortCurrent()
Gets the last known remote port used by the Device

Specified by:
getRemotePortCurrent in interface DataTransport
Returns:
The last known remote port used by the Device

setRemotePortCurrent

public void setRemotePortCurrent(int v)
Sets the last known remote port used by the Device

Specified by:
setRemotePortCurrent in interface DataTransport
Parameters:
v - The last known remote port used by the Device

getListenPortCurrent

public int getListenPortCurrent()
Gets the last known listen port used by the Device

Specified by:
getListenPortCurrent in interface DataTransport
Returns:
The last known listen port used by the Device

setListenPortCurrent

public void setListenPortCurrent(int v)
Sets the last known listen port used by the Device

Specified by:
setListenPortCurrent in interface DataTransport
Parameters:
v - The last known listen port used by the Device

saveOriginalLastValidGeoPoint

public boolean saveOriginalLastValidGeoPoint()
Save last valid GeoPoint


clearOriginalLastValidGeoPoint

public void clearOriginalLastValidGeoPoint()
Clear original last valid GeoPoint


getOriginalLastValidGeoPoint

public GeoPoint getOriginalLastValidGeoPoint()
Get Original last valid GeoPoint


getLastValidLatitude

public double getLastValidLatitude()
Gets the last known valid latitude for this Device

Returns:
The last known valid latitude for this Device

setLastValidLatitude

public void setLastValidLatitude(double v)
Gets the last known valid latitude for this Device

Parameters:
v - The last known valid latitude for this Device

getLastValidLongitude

public double getLastValidLongitude()
Gets the last known valid longitude for this Device

Returns:
The last known valid longitude for this Device

setLastValidLongitude

public void setLastValidLongitude(double v)
Sets the last known valid longitude for this Device

Parameters:
v - The last known valid longitude for this Device

hasLastValidLocation

public boolean hasLastValidLocation()
Returns true if this device has a last known valid GeoPoint

Returns:
True if this device has a last known valid GeoPoint

getLastValidLocation

public GeoPoint getLastValidLocation()
Gets the last known valid GeoPoint for this Device

Returns:
The last known valid GeoPoint for this Device

getLastValidLocation

public GeoPoint getLastValidLocation(boolean tryLastEvent)
Gets the last known valid GeoPoint for this Device

Parameters:
tryLastEvent - If true, the last valid EventData record may be queried
Returns:
The last known valid GeoPoint for this Device

getMetersToLastValidLocation

public double getMetersToLastValidLocation(GeoPoint gp)
Calculates and returns the number of meters from the last valid GPS location to the specified GeoPoint.

Parameters:
gp - The GeoPoint to test
Returns:
The number of meters to the specified GeoPoint

isNearLastValidLocation

public boolean isNearLastValidLocation(GeoPoint gp,
                                       double meters)
Returns true if the last know location of this device is is within the specified number of meters to the specified GeoPoint.

Parameters:
gp - The GeoPoint to test
meters - The radius to test, in meters

isNearLastValidLocation

public boolean isNearLastValidLocation(GeoPoint gp,
                                       double meters,
                                       long maxFixAge)
Returns true if the last know location of this device is is within the specified number of meters to the specified GeoPoint.

Parameters:
gp - The GeoPoint to test
meters - The radius to test, in meters
maxFixAge - The maximum fix age

getNearbyDevices

public java.util.Map<java.lang.String,Device.NearbyDevice> getNearbyDevices(double radiusM,
                                                                            long maxAgeSec,
                                                                            User userAuth)
                                                                     throws DBException
Return Device.NearbyDevice list of Devices near this Device Active only, this device excluded from list.

Parameters:
radiusM - The radius in meters
maxAgeSec - Maximum last location age (in seconds)
userAuth - If non-null, returns devices authorized to user only
Throws:
DBException

GetNearbyDeviceMap

public static java.util.Map<java.lang.String,Device.NearbyDevice> GetNearbyDeviceMap(Account account,
                                                                                     java.lang.String targetDevID,
                                                                                     boolean inclTargetID,
                                                                                     long startTime,
                                                                                     long endTime,
                                                                                     GeoPoint gp,
                                                                                     double radiusM,
                                                                                     boolean activeOnly,
                                                                                     User userAuth,
                                                                                     boolean sortByDist)
                                                                              throws DBException
Return Device.NearbyDevice list of Devices near specified location

Parameters:
account - The Account instance (cannot be null)
targetDevID - The target deviceID
inclTargetID - True to include targetDeviceID in NearbyDevice list, false to exclude.
startTime - Include last location timestamps after this time (0 to disable)
endTime - Include last location timestamps before this time (0 to disable)
gp - The GPS location
radiusM - The radius in meters
activeOnly - True for active devices only
userAuth - If non-null, returns devices authorized to user only
sortByDist - True to return list sorted by distance, from closest to farthest
Throws:
DBException

getLastValidAddress

public java.lang.String getLastValidAddress()
Returns the last valid street address, based on the last know location (not currently supported)

Returns:
The last valid street address

getLastSubdivision

public java.lang.String getLastSubdivision()
Gets the last valid subdivision/state

Returns:
The last valid subdivision/state

setLastSubdivision

public void setLastSubdivision(java.lang.String v)
Sets the last valid subdivision/state

Parameters:
v - The last valid subdivision/state

getLastValidSpeedKPH

public double getLastValidSpeedKPH()
Gets the last valid speed

Returns:
The last valid speed

setLastValidSpeedKPH

public void setLastValidSpeedKPH(double v)
Sets the last valid speed

Parameters:
v - The last valid speed

getLastValidHeading

public double getLastValidHeading()
Gets the last valid heading

Returns:
The last valid heading

setLastValidHeading

public void setLastValidHeading(double v)
Sets the last valid heading

Parameters:
v - The last valid heading

getLastGPSTimestamp

public long getLastGPSTimestamp()
Gets the last valid GPS timestamp

Returns:
The last valid GPS timestamp

setLastGPSTimestamp

public void setLastGPSTimestamp(long v)
Sets the last valid GPS timestamp

Parameters:
v - The last valid GPS timestamp

getLastEventTimestamp

public long getLastEventTimestamp()
Gets the last event timestamp

Returns:
The last event timestamp

setLastEventTimestamp

public void setLastEventTimestamp(long v)
Sets the last event timestamp

Parameters:
v - The last event timestamp

isOldEventTimestamp

public boolean isOldEventTimestamp(long timestamp)
Returns true if the specified timestamp is prior to the last received event timestamp

Parameters:
timestamp - The timestamp to check
Returns:
True if the timestamp is prior to the last received event timestamp

supportsEventsPerSecond

public static boolean supportsEventsPerSecond()
Returns true if EventsPerSecond is supported/enabled


getLastEventsPerSecond

public double getLastEventsPerSecond()
Gets the last estimated events-per-second

Returns:
The last estimated events-per-second

setLastEventsPerSecond

public void setLastEventsPerSecond(double v)
Sets the last estimated events-per-second

Parameters:
v - The last estimated events-per-second

getAgedEventsPerSecond

public double getAgedEventsPerSecond(long ageMS)
Gets the aged estimated events-per-second

Parameters:
ageMS - Aged timestamp
Returns:
The aged estimated events-per-second

getLastEventsPerSecondMS

public long getLastEventsPerSecondMS()
Gets the last event-per-second timestamp (milliseconds)

Returns:
The last event-per-second timestamp (milliseconds)

setLastEventsPerSecondMS

public void setLastEventsPerSecondMS(long v)
Sets the last event-per-second timestamp (milliseconds)

Parameters:
v - The last event-per-second timestamp (milliseconds)

getLastCellServingInfo

public java.lang.String getLastCellServingInfo()
Gets the last received serving cell-tower information

Returns:
The last received serving cell-tower information

setLastCellServingInfo

public void setLastCellServingInfo(java.lang.String v)
Sets the last received serving cell-tower information

Parameters:
v - The last received serving cell-tower information

setLastServingCellTower

public void setLastServingCellTower(org.opengts.cellid.CellTower sct)
Sets the last received serving cell-tower information

Parameters:
sct - The last received serving cell-tower information

getLastServingCellTower

public org.opengts.cellid.CellTower getLastServingCellTower()
Gets the last received serving cell-tower information

Returns:
The last received serving cell-tower information

checkGeozoneTransitions

public java.util.List<Device.GeozoneTransition> checkGeozoneTransitions(long eventTime,
                                                                        GeoPoint eventGP)
Checks the new event time and GeoPoint to calculate and returns a set of Geozone arrive/depart events, which should be inserted into the EventData table. If no Geozone transition occurred, then this method returns null.

Parameters:
eventTime - The tie of the event
eventGP - The new event location
Returns:
A list of Geozone transitions, or null if no transition occurred.

getAutoGeozoneID

public java.lang.String getAutoGeozoneID(EventData ev)
Creates a unique Geozone ID which may be used by the ENRE predefined-actions


getLastDistanceKM

public double getLastDistanceKM()
Gets the last distance value

Returns:
The last distance value

setLastDistanceKM

public void setLastDistanceKM(double distKM)
Sets the last distance value

Parameters:
distKM - The last distance value

getMaxOdometerKM

public double getMaxOdometerKM()
Gets the maximum allowed odometer value

Returns:
The maximum allowed odometer value

supportsLastOdometer

public static boolean supportsLastOdometer()
Returns true if the Device record supports the last odometer fields

Returns:
True if the Device record supports the last odometer fields

getLastOdometerKM

public double getLastOdometerKM()
Gets the last odometer value

Returns:
The last odometer value

setLastOdometerKM

public void setLastOdometerKM(double odomKM)
Sets the last odometer value

Parameters:
odomKM - The last odometer value

getNextOdometerKM

public double getNextOdometerKM(GeoPoint geoPoint)
Calculates the next odometer value based on the specified GeoPoint

Parameters:
geoPoint - The next GPS location
Returns:
The last odometer, plus the distance to the specified GeoPoint

adjustOdometerKM

public double adjustOdometerKM(double odomKM)
Adjusts the specified odometer value to the maximum allow value

Parameters:
odomKM - The odometer value to adjust
Returns:
The adjusted odometer value

adjustOdometerKM

public double adjustOdometerKM(double odomKM,
                               boolean checkLast)
Adjusts the specified odometer value to the maximum allow value

Parameters:
odomKM - The odometer value to adjust
Returns:
The adjusted odometer value

calculateOdometerKM

public double calculateOdometerKM(double odomKM,
                                  long fixtime,
                                  boolean validGPS,
                                  GeoPoint geoPoint,
                                  boolean estimate,
                                  boolean logInfo)
Calculates an odometer value based on the specified attributes

Parameters:
odomKM - The odometer value from the device (or 0.0 if the device does not provide an odometer)
fixtime - The timestamp of the event
validGPS - The GPS fix state
geoPoint - The GPS location
estimate - True if the odometer is to be calculated based on the GPS location
logInfo - True to display the results via "Print.logInfo"
Returns:
The calculated odometer value

getOdometerOffsetKM

public double getOdometerOffsetKM()
Gets the displayed odometer offset in kilometers.

Returns:
The displayed odometer offset in kilometers.

setOdometerOffsetKM

public void setOdometerOffsetKM(double v)
Sets the displayed odometer offset in kilometers.

Parameters:
v - The displayed odometer offset in kilometers.

getLastEngineOnHours

public double getLastEngineOnHours()
Gets the engine-hours at the last engine-on time

Returns:
The engine-hours at the last engine-on time

setLastEngineOnHours

public void setLastEngineOnHours(double v)
Sets the engine-hours at the last engine-on time

Parameters:
v - The engine-hours at the last engine-on time

getLastEngineOnTime

public long getLastEngineOnTime()
Gets the last engine on time received

Returns:
The last engine on time received

setLastEngineOnTime

public void setLastEngineOnTime(long v)
Sets the last engine on time received

Parameters:
v - The last engine on time received

getLastEngineOffTime

public long getLastEngineOffTime()
Gets the last engine off time received

Returns:
The last engine off time received

setLastEngineOffTime

public void setLastEngineOffTime(long v)
Sets the last engine off time received

Parameters:
v - The last engine off time received

getMaxRuntimeHours

public double getMaxRuntimeHours()
Gets the maximum allowed engine-hours value

Returns:
The maximum allowed engine-hours value

supportsLastEngineHours

public static boolean supportsLastEngineHours()
Returns true if LastEngineHours is supported

Returns:
True if LastEngineHours is supported

getLastEngineHours

public double getLastEngineHours()
Gets the last engine-hours received

Returns:
The last engine-hours received

setLastEngineHours

public void setLastEngineHours(double v)
Sets the last engine-hours received

Parameters:
v - The last engine-hours received

getEngineHoursOffset

public double getEngineHoursOffset()
Gets the displayed engine-hours offset

Returns:
The displayed engine-hours offset

setEngineHoursOffset

public void setEngineHoursOffset(double v)
Sets the displayed engine-hours offset

Parameters:
v - The displayed engine-hours offset

getLastIgnitionOnHours

public double getLastIgnitionOnHours()
Gets the ignition hours at the last ignition-on.

Returns:
The ignition hours at the last ignition-on.

setLastIgnitionOnHours

public void setLastIgnitionOnHours(double v)
Sets the ignition hours at the last ignition-on.

Parameters:
v - The ignition hours at the last ignition-on.

getLastIgnitionOnTime

public long getLastIgnitionOnTime()
Gets the last ignition on time received

Returns:
The last ignition on time received

setLastIgnitionOnTime

public void setLastIgnitionOnTime(long v)
Sets the last ignition on time received

Parameters:
v - The last ignition on time received

getLastIgnitionOffTime

public long getLastIgnitionOffTime()
Gets the last ignition off time received

Returns:
The last ignition off time received

setLastIgnitionOffTime

public void setLastIgnitionOffTime(long v)
Sets the last ignition off time received

Parameters:
v - The last ignition off time received

getLastIgnitionHours

public double getLastIgnitionHours()
Gets the last ignition hours received.

Returns:
The last ignition hours received

setLastIgnitionHours

public void setLastIgnitionHours(double v)
Sets the last ignition hours received.

Parameters:
v - The last ignition hours received

getLastStopTime

public long getLastStopTime()
Gets the last stopped time received.

Returns:
The last stopped time received

setLastStopTime

public void setLastStopTime(long v)
Sets the last stopped time received.

Parameters:
v - The last stopped time received

isStopped

public boolean isStopped()
Returns true if the device is currently stopped, based on the start/stop configuration calculated as each event arrives.

Returns:
True if the device is currently stopped.

getLastStopEvent

public EventData getLastStopEvent()
Gets the last Stop event

Returns:
The last Stop event

getLastStartTime

public long getLastStartTime()
Gets the last Start time

Returns:
The last Start time

setLastStartTime

public void setLastStartTime(long v)
Sets the last Start time

Parameters:
v - The last Start time

getLastMalfunctionLamp

public boolean getLastMalfunctionLamp()
Gets the last Malfuntion Indicator Lamp (MIL) state

Returns:
The last Malfuntion Indicator Lamp (MIL) state

setLastMalfunctionLamp

public void setLastMalfunctionLamp(boolean v)
Sets the last Malfuntion Indicator Lamp (MIL) state

Parameters:
v - The last Malfuntion Indicator Lamp (MIL) state

supportsFaultCodes

public static boolean supportsFaultCodes()
Returns true if Fault Codes are supported

Returns:
True if Fault Codes are supported

getLastFaultCode

public java.lang.String getLastFaultCode()
Gets the last fault codes

Returns:
The last fault codes

setLastFaultCode

public void setLastFaultCode(java.lang.String v)
Sets the last fault codes

Parameters:
v - The last fault codes

appendLastFaultCode

public void appendLastFaultCode(java.lang.String v)
Appends the specified fault code to the current list of fault codes

Parameters:
v - The fault code to add

getPingCommandURI

public java.lang.String getPingCommandURI()
(NOT FULLY IMPLEMENTED) Gets the Ping command URI/URL

Returns:
The Ping command URI/URL

setPingCommandURI

public void setPingCommandURI(java.lang.String v)
(NOT FULLY IMPLEMENTED) Sets the Ping command URI/URL

Parameters:
v - The Ping command URI/URL

getPendingPingCommand

public java.lang.String getPendingPingCommand()
Gets the currently pending commands which should be sent to the device

Returns:
Any pending device commands

getPendingCommand

public java.lang.String getPendingCommand()

setPendingPingCommand

public void setPendingPingCommand(java.lang.String v)
Sets the currently pending commands which should be sent to the device

Parameters:
v - Any pending device commands

setPendingCommand

public void setPendingCommand(java.lang.String v)

hasPendingPingCommand

public boolean hasPendingPingCommand()
Returns true if this device contains any pending commands

Returns:
True if this device contains any pending commands

hasPendingCommand

public boolean hasPendingCommand()

clearPendingPingCommand

public boolean clearPendingPingCommand(boolean update)
Clears the device pending commands

Parameters:
update - True to update the device record now
Returns:
True if the device record was successfully cleared and updated, false otherwise

clearPendingCommand

public boolean clearPendingCommand(boolean update)

getLastPingTime

public long getLastPingTime()
Gets the time of the last command sent to the device

Specified by:
getLastPingTime in interface DataTransport
Returns:
The time of the last command sent to the device

_setLastPingTime

public void _setLastPingTime(long v)
Sets the time of the last command sent to the device

Parameters:
v - The time of the last command sent to the device

setLastPingTime

public void setLastPingTime(long v)
Sets the time of the last command sent to the device

Parameters:
v - The time of the last command sent to the device

getTotalPingCount

public int getTotalPingCount()
Gets the total number of commands sent to the device, since last reset

Specified by:
getTotalPingCount in interface DataTransport
Returns:
The total number of commands sent to the device, since last reset

_setTotalPingCount

public void _setTotalPingCount(int v)
Sets the total number of commands sent to the device, since last reset

Parameters:
v - The total number of commands sent to the device, since last reset

setTotalPingCount

public void setTotalPingCount(int v)
Sets the total number of commands sent to the device, since last reset

Parameters:
v - The total number of commands sent to the device, since last reset

incrementPingCount

public boolean incrementPingCount(long pingTime,
                                  boolean reload,
                                  boolean update)
Increments the command count for this device

Parameters:
pingTime - The time of the command
reload - True to force a reload of the Device record prior to counting the command
update - True to update the Device after incrementing the count
Returns:
True if successfully incremented

getMaxPingCount

public int getMaxPingCount()
Gets the maximum number of commands that can be sent to the device

Specified by:
getMaxPingCount in interface DataTransport
Returns:
The maximum number of commands that can be sent to the device

_setMaxPingCount

public void _setMaxPingCount(int v)
Sets the maximum number of commands that can be sent to the device

Parameters:
v - The maximum number of commands that can be sent to the device

setMaxPingCount

public void setMaxPingCount(int v)
Sets the maximum number of commands that can be sent to the device

Parameters:
v - The maximum number of commands that can be sent to the device

exceedsMaxPingCount

public boolean exceedsMaxPingCount()
Returns true if the maximum number of commands sent to the server has been exceeded.

Returns:
True if the maximum number has been exceeded

getCommandStateMask

public long getCommandStateMask()
Gets the command state mask as set by commands sent to the device

Returns:
The command state mask

getCommandStateMaskBit

public boolean getCommandStateMaskBit(int bit)
Gets the state for the specified bit from the command state mask

Parameters:
bit - The command state bit index
Returns:
The state for the specified bit from the command state mask

setCommandStateMask

public void setCommandStateMask(long v)
Sets the command state mask as set by commands sent to the device

Parameters:
v - The command state mask

setCommandStateBit

public void setCommandStateBit(int bit,
                               boolean state)
Sets the state for the specified bit from the command state mask

Parameters:
bit - The command state bit
state - The state for the specified bits in the command state mask

getExpectAck

public boolean getExpectAck()
Returns true if an ACK is expected from the device

Returns:
True if an ACK is expected from the device

_setExpectAck

public void _setExpectAck(boolean v)
Sets the expected ACK state

Parameters:
v - The expected ACK state

setExpectAck

public void setExpectAck(boolean v)
Sets the expected ACK state

Parameters:
v - The expected ACK state

getExpectAckCode

public int getExpectAckCode()
Gets the expected ACK status code, or '0' if any code should match

Returns:
The expected ACK status code

setExpectAckCode

public void setExpectAckCode(int v)
Sets the expected ACK status code, or '0' if any code should match

Parameters:
v - The expected ACK status code

isAckStatusCode

public boolean isAckStatusCode(int statusCode)
Returns true if the device is expecting an ACK and the specified status code matched the expected ACK status code.

Parameters:
statusCode - The current event status code
Returns:
True if statusCode matched expected ACK status code

getLastAckCommand

public java.lang.String getLastAckCommand()
Gets the last ACK command sent to the device (if supported)

Returns:
The last ACK command sent to the device

setLastAckCommand

public void setLastAckCommand(java.lang.String v)
Sets the last ACK command sent to the device

Parameters:
v - The last ACK command sent to the device

isExpectingCommandAck

public boolean isExpectingCommandAck()
Returns true if an ACK is expected from the device

Returns:
True if an ACK is expected from the device

clearExpectCommandAck

public boolean clearExpectCommandAck(boolean didAck,
                                     boolean update)
Clears the expect ACK state for the specified command

Parameters:
didAck - True if the ACK was received
update - True to update the Device record
Returns:
True if cleared

getLastAckResponse

public java.lang.String getLastAckResponse()
Gets the last ACK response (if supported)

Returns:
The last ACK response

setLastAckResponse

public void setLastAckResponse(java.lang.String v)
Sets the last ACK response

Parameters:
v - The last ACK response

getLastAckTime

public long getLastAckTime()
Gets the last ACK time (if supported)

Returns:
The last ACK time

_setLastAckTime

public void _setLastAckTime(long v)
Sets the last ACK time (if supported)

Parameters:
v - The last ACK time

setLastAckTime

public void setLastAckTime(long v)
Sets the last ACK time (if supported)

Parameters:
v - The last ACK time

getDcsConfigMask

public long getDcsConfigMask()
Gets the DCS configuration mask (usage defined by specific DCS)

Returns:
The DCS configuration mask

setDcsConfigMask

public void setDcsConfigMask(long v)
Sets the DCS configuration mask (usage defined by specific DCS)

Parameters:
v - The DCS configuration mask

getDcsConfigString

public java.lang.String getDcsConfigString()
Gets the DCS configuration String (usage defined by specific DCS)

Returns:
The DCS configuration String

setDcsConfigString

public void setDcsConfigString(java.lang.String v)
Sets the DCS configuration String (usage defined by specific DCS)

Parameters:
v - The DCS configuration String

getSupportsDMTP

public boolean getSupportsDMTP()
OpenDMTP: Returns true if this device supports the OpenDMTP protocol

Specified by:
getSupportsDMTP in interface DataTransport
Returns:
True if this device supports the OpenDMTP protocol

supportsDMTP

public boolean supportsDMTP()
OpenDMTP: Returns true if this device supports the OpenDMTP protocol

Returns:
True if this device supports the OpenDMTP protocol

setSupportsDMTP

public void setSupportsDMTP(boolean v)
OpenDMTP: Sets the OpenDMTP protocol support state

Specified by:
setSupportsDMTP in interface DataTransport
Parameters:
v - The OpenDMTP protocol support state

getSupportedEncodings

public int getSupportedEncodings()
OpenDMTP: Gets the supported OpenDMTP encodings

Specified by:
getSupportedEncodings in interface DataTransport
Returns:
The supported OpenDMTP encodings

setSupportedEncodings

public void setSupportedEncodings(int v)
OpenDMTP: Sets the supported OpenDMTP encodings

Specified by:
setSupportedEncodings in interface DataTransport
Parameters:
v - The supported OpenDMTP encodings

getUnitLimitInterval

public int getUnitLimitInterval()
OpenDMTP: Gets the OpenDMTP unit limit interval

Specified by:
getUnitLimitInterval in interface DataTransport
Returns:
The OpenDMTP unit limit interval

setUnitLimitInterval

public void setUnitLimitInterval(int v)
OpenDMTP: Sets the OpenDMTP unit limit interval

Parameters:
v - The OpenDMTP unit limit interval

getMaxAllowedEvents

public int getMaxAllowedEvents()
OpenDMTP: Gets the maximum allowed OpenDMTP events

Specified by:
getMaxAllowedEvents in interface DataTransport
Returns:
The maximum allowed OpenDMTP events

setMaxAllowedEvents

public void setMaxAllowedEvents(int v)
OpenDMTP: Sets the maximum allowed OpenDMTP events

Parameters:
v - The maximum allowed OpenDMTP events

getTotalProfileMask

public DTProfileMask getTotalProfileMask()
OpenDMTP: Gets the total (UDP/TCP) connection profile mask

Specified by:
getTotalProfileMask in interface DataTransport
Returns:
The total (UDP/TCP) connection profile mask

setTotalProfileMask

public void setTotalProfileMask(DTProfileMask v)
OpenDMTP: Sets the total (UDP/TCP) connection profile mask

Specified by:
setTotalProfileMask in interface DataTransport
Parameters:
v - The total (UDP/TCP) connection profile mask

getTotalMaxConn

public int getTotalMaxConn()
OpenDMTP: Gets the maximum total connections allowed per interval
Note: The effective maximum value for this field is defined by the following:
(org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK * this.getUnitLimitIntervalMinutes())

Specified by:
getTotalMaxConn in interface DataTransport
Returns:
The maximum total connections allowed per interval

setTotalMaxConn

public void setTotalMaxConn(int v)
OpenDMTP: Sets the maximum total connections allowed per interval

Parameters:
v - The maximum total connections allowed per interval

getTotalMaxConnPerMin

public int getTotalMaxConnPerMin()
OpenDMTP: Gets the maximum total connections allowed per minute
Note: The effective maximum value for this field is defined by the constant:
"org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK"

Specified by:
getTotalMaxConnPerMin in interface DataTransport
Returns:
The maximum total connections allowed per minute

setTotalMaxConnPerMin

public void setTotalMaxConnPerMin(int v)
OpenDMTP: Sets the maximum total connections allowed per minute

Parameters:
v - The maximum total connections allowed per minute

getDuplexProfileMask

public DTProfileMask getDuplexProfileMask()
OpenDMTP: Gets the Duplex/TCP connection profile mask

Specified by:
getDuplexProfileMask in interface DataTransport
Returns:
The Duplex/TCP connection profile mask

setDuplexProfileMask

public void setDuplexProfileMask(DTProfileMask v)
OpenDMTP: Sets the Duplex/TCP connection profile mask

Specified by:
setDuplexProfileMask in interface DataTransport
Parameters:
v - The Duplex/TCP connection profile mask

getDuplexMaxConn

public int getDuplexMaxConn()
OpenDMTP: Gets the maximum Duplex/TCP connections per Interval Note: The effective maximum value for this field is defined by the following: (org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK * this.getUnitLimitIntervalMinutes())

Specified by:
getDuplexMaxConn in interface DataTransport
Returns:
The maximum Duplex/TCP connections per Interval

setDuplexMaxConn

public void setDuplexMaxConn(int v)
OpenDMTP: Sets the maximum Duplex/TCP connections per Interval

Parameters:
v - The maximum Duplex/TCP connections per Interval

getDuplexMaxConnPerMin

public int getDuplexMaxConnPerMin()
OpenDMTP: Gets the maximum Duplex/TCP connections per Minute Note: The effective maximum value for this field is defined by the constant: "org.opendmtp.server.base.ValidateConnections.BITS_PER_MINUTE_MASK"

Specified by:
getDuplexMaxConnPerMin in interface DataTransport
Returns:
The maximum Duplex/TCP connections per Minute

setDuplexMaxConnPerMin

public void setDuplexMaxConnPerMin(int v)
OpenDMTP: Sets the maximum Duplex/TCP connections per Minute

Parameters:
v - The maximum Duplex/TCP connections per Minute

getLastDuplexConnectTime

public long getLastDuplexConnectTime()
Gets the last Duplex/TCP connection time

Specified by:
getLastDuplexConnectTime in interface DataTransport
Returns:
The last Duplex/TCP connection time

_setLastDuplexConnectTime

public void _setLastDuplexConnectTime(long v)
Sets the last Duplex/TCP connection time

Parameters:
v - The last Duplex/TCP connection time

setLastDuplexConnectTime

public void setLastDuplexConnectTime(long v)
Sets the last Duplex/TCP connection time

Specified by:
setLastDuplexConnectTime in interface DataTransport
Parameters:
v - The last Duplex/TCP connection time

getLastTotalConnectTime

public long getLastTotalConnectTime()
Gets the last UDP/TCP connection time

Specified by:
getLastTotalConnectTime in interface DataTransport
Returns:
The last UDP/TCP connection time

_setLastTotalConnectTime

public void _setLastTotalConnectTime(long v)
Sets the last UDP/TCP connection time

Parameters:
v - The last UDP/TCP connection time

setLastTotalConnectTime

public void setLastTotalConnectTime(long v)
Sets the last UDP/TCP connection time

Specified by:
setLastTotalConnectTime in interface DataTransport
Parameters:
v - The last UDP/TCP connection time

getLastConnectTime

public long getLastConnectTime()
Gets the last UDP/TCP connection time

Returns:
The last UDP/TCP connection time

setLastConnectTime

public void setLastConnectTime(long v,
                               boolean isDuplex)
Sets the last UDP/TCP connection time

Parameters:
v - The last UDP/TCP connection time

supportsFixedLocation

public static boolean supportsFixedLocation()
Returns true if Fixed Locations are supported

Returns:
True if Fixed Locations are supported

getFixedLatitude

public double getFixedLatitude()
Gets the fixed latitude for this device

Returns:
The fixed latitude for this device

setFixedLatitude

public void setFixedLatitude(double v)
Sets the fixed latitude for this device

Parameters:
v - The fixed latitude for this device

getFixedLongitude

public double getFixedLongitude()
Gets the fixed longitude for this device

Returns:
The fixed longitude for this device

setFixedLongitude

public void setFixedLongitude(double v)
Sets the fixed longitude for this device

Parameters:
v - The fixed longitude for this device

hasFixedLocation

public boolean hasFixedLocation()
Returns true if this device supports fixed locations

Returns:
True if this device supports fixed locations

isValidFixedLocation

public boolean isValidFixedLocation()
Returns true if this device defines a valid fixed location

Returns:
True if this device defines a valid fixed location

getFixedLocation

public GeoPoint getFixedLocation()
Gets the fixed location for this device

Returns:
The fixed location for this device

getFixedAddress

public java.lang.String getFixedAddress()
Gets the address for the fixed location for this device

Returns:
The address for the fixed location for this device

setFixedAddress

public void setFixedAddress(java.lang.String v)
Sets the address for the fixed location for this device

Parameters:
v - The address for the fixed location for this device

getFixedContactPhone

public java.lang.String getFixedContactPhone()
Gets the phone number for the fixed location for this device

Returns:
The phone number for the fixed location for this device

setFixedContactPhone

public void setFixedContactPhone(java.lang.String v)
Sets the phone number for the fixed location for this device

Parameters:
v - The phone number for the fixed location for this device

getFixedServiceTime

public long getFixedServiceTime()
Gets the last time this fixed location was serviced

Returns:
The last time this fixed location was serviced

setFixedServiceTime

public void setFixedServiceTime(long v)
Sets the last time this fixed location was serviced

Parameters:
v - The last time this fixed location was serviced

supportsActiveCorridor

public static boolean supportsActiveCorridor()
Returns true if active corridors are supported

Returns:
True if active corridors are supported

getActiveCorridor

public java.lang.String getActiveCorridor()
Gets the active corridor for this device

Returns:
The active corridor for this device

hasActiveCorridor

public boolean hasActiveCorridor()
Returns true if this device has an active corridor

Returns:
True if this device has an active corridor

setActiveCorridor

public void setActiveCorridor(java.lang.String v)
Sets the active corridor for this device

Parameters:
v - The active corridor for this device

getCorridorIDsForAccount

public static java.lang.String[] getCorridorIDsForAccount(java.lang.String acctId)
Gets a String array of all GeoCorridor ID for the specified account
(TODO: move to Account.java)

Parameters:
acctId - The Account ID
Returns:
String array of GeoCorridor IDs

supportsPeriodicMaintenance

public static boolean supportsPeriodicMaintenance()
Returns true if Periodic Maintenance fields are supported

Returns:
True if Periodic Maintenance fields are supported

getPeriodicMaintOdometerCount

public static int getPeriodicMaintOdometerCount()
Gets the number of maintenance fields to support (current maximum value is 2)

Returns:
The number of maintenance fields to support

setMaintTriggeredKM

public void setMaintTriggeredKM(int ndx)
Sets the index of the first triggered device maintenance.
(Used for Rule '$MAINTKM' trigger state caching)


getMaintTriggeredKM

public int getMaintTriggeredKM()
Gets the index of the first triggered device maintenance.
Returns '-1' if not defined. (Used for Rule '$MAINTKM' trigger state caching)


getMaintDescriptionKM

public java.lang.String getMaintDescriptionKM(int ndx)
Gets the maintenance descrption for the specified index

Parameters:
ndx - The index of the maintenance descrption to return
Returns:
The maintenance description

getMaintOdometerKM

public double getMaintOdometerKM(int ndx)
Gets the last maintenance odometer for the specified index

Parameters:
ndx - The index of the maintenance odometer to return
Returns:
The maintenance odometer (in kilometers)

resetMaintOdometerKM

public void resetMaintOdometerKM(int ndx)
Resets the last maintenance odometer for the specified index

Parameters:
ndx - The index of the maintenance odometer to reset

getMaintIntervalKM

public double getMaintIntervalKM(int ndx)
Gets the last maintenance interval for the specified index

Parameters:
ndx - The index of the maintenance interval to return
Returns:
The maintenance interval (in kilometers)

isMaintenanceDueKM

public boolean isMaintenanceDueKM(int ndx,
                                  double deltaKM)
Returns true if the maintenance interval is due for the specified index and specified number of delta kilometers.

Parameters:
ndx - The index of the maintenance interval
deltaKM - The delta-kilometers to check
Returns:
True if maintenance is due

getMaintDescriptionKM0

public java.lang.String getMaintDescriptionKM0()
Gets the maintenance descrption for index #0

Returns:
The maintenance descrption #0

getMaintIntervalKM0

public double getMaintIntervalKM0()
Gets the maintenance interval for index #0

Returns:
The maintenance interval #0, in kilometers

setMaintIntervalKM0

public void setMaintIntervalKM0(double v)
Sets the maintenance interval for index #0

Parameters:
v - The maintenance interval #0, in kilometers

getMaintOdometerKM0

public double getMaintOdometerKM0()
Gets the maintenance odometer for index #0

Returns:
The maintenance odometer #0, in kilometers

setMaintOdometerKM0

public void setMaintOdometerKM0(double v)
Sets the maintenance odometer for index #0

Parameters:
v - The maintenance odometer #0, in kilometers

resetMaintOdometerKM0

public void resetMaintOdometerKM0()
Resets the maintenance odometer for index #0


getMaintDescriptionKM1

public java.lang.String getMaintDescriptionKM1()
Gets the maintenance descrption for index #1

Returns:
The maintenance descrption #1

getMaintIntervalKM1

public double getMaintIntervalKM1()
Gets the maintenance interval for index #1

Returns:
The maintenance interval #1, in kilometers

setMaintIntervalKM1

public void setMaintIntervalKM1(double v)
Sets the maintenance interval for index #1

Parameters:
v - The maintenance interval #1, in kilometers

getMaintOdometerKM1

public double getMaintOdometerKM1()
Gets the maintenance odometer for index #1

Returns:
The maintenance odometer #1, in kilometers

setMaintOdometerKM1

public void setMaintOdometerKM1(double v)
Sets the maintenance odometer for index #1

Parameters:
v - The maintenance odometer #1, in kilometers

resetMaintOdometerKM1

public void resetMaintOdometerKM1()
Resets the maintenance odometer for index #1


getPeriodicMaintEngHoursCount

public static int getPeriodicMaintEngHoursCount()
Gets the number of supported maintenance engine-hour fields

Returns:
The number of supported maintenance engine-hour fields

getMaintEngHoursHR

public double getMaintEngHoursHR(int ndx)
Gets the Maintenance Engine Hours for the specified index

Parameters:
ndx - The maintenance engine-hours index
Returns:
The maintenance engine hours

resetMaintEngHoursHR

public void resetMaintEngHoursHR(int ndx)
Resets the maintenance engine hours for the specified index

Parameters:
ndx - The maintenance engine-hours index

getMaintIntervalHR

public double getMaintIntervalHR(int ndx)
Gets the maintenance engine-hours interval for the specified index

Parameters:
ndx - The maintenance engine-hours index
Returns:
The maintenance engine-hours interval

isMaintenanceDueHR

public boolean isMaintenanceDueHR(int ndx,
                                  double deltaHR)
Returns true if the maintenance engine hours for the specified index is due

Parameters:
ndx - The maintenance engine-hours index
deltaHR - The delta engine-hours to check

getMaintIntervalHR0

public double getMaintIntervalHR0()
Gets the maintenance engine-hours interval for index #0

Returns:
The maintenance engine-hours interval for index #0

setMaintIntervalHR0

public void setMaintIntervalHR0(double v)
Sets the maintenance engine-hours interval for index #0

Parameters:
v - The maintenance engine-hours interval for index #0

getMaintEngHoursHR0

public double getMaintEngHoursHR0()
Gets the maintenance engine-hours elapsed for index #0

Returns:
The maintenance engine-hours elapsed for index #0

setMaintEngHoursHR0

public void setMaintEngHoursHR0(double v)
Sets the maintenance engine-hours elapsed for index #0

Parameters:
v - The maintenance engine-hours elapsed for index #0

resetMaintEngHoursHR0

public void resetMaintEngHoursHR0()
Resets the maintenance engine-hours for index #0


getMaintNotes

public java.lang.String getMaintNotes()
Gets the maintenance notes

Returns:
the maintenance notes

setMaintNotes

public void setMaintNotes(java.lang.String v)
Sets the maintenance notes

Parameters:
v - the maintenance notes

getReminderType

public int getReminderType()
Gets the maintenance reminder type (currently always returns '0')

Returns:
the maintenance reminder type

setReminderType

public void setReminderType(int v)
Sets the maintenance reminder type

Parameters:
v - the maintenance reminder type

setReminderType

public void setReminderType(Device.ReminderType r)
Sets the maintenance reminder type

Parameters:
r - the maintenance reminder type

getReminderMessage

public java.lang.String getReminderMessage()
Gets the maintenance reminder message

Returns:
the maintenance reminder message

setReminderMessage

public void setReminderMessage(java.lang.String v)
Sets the maintenance reminder message

Parameters:
v - the maintenance reminder message

getReminderTime

public long getReminderTime()
Gets the maintenance reminder time

Returns:
the maintenance reminder time

setReminderTime

public void setReminderTime(long v)
Sets the maintenance reminder time

Parameters:
v - the maintenance reminder time

getReminderInterval

public java.lang.String getReminderInterval()
Gets the maintenance reminder interval

Returns:
the maintenance reminder interval

setReminderInterval

public void setReminderInterval(java.lang.String v)
Sets the maintenance reminder interval

Parameters:
v - the maintenance reminder interval

isReminderExpired

public boolean isReminderExpired(java.util.TimeZone tz,
                                 long nowTime)
Returns true if the maintenance reminder has expired

Parameters:
tz - The TimeZone
nowTime - The current time
Returns:
True if expired

isReminderExpired

public boolean isReminderExpired(java.util.TimeZone tz)
Returns true if the reminder time has expired

Parameters:
tz - The TimeZone
Returns:
True if expired

resetReminder

public void resetReminder(long currentTime)
Reset the reminder time

Parameters:
currentTime - The time to which the reminder is reset

resetReminder

public void resetReminder()
Reset the reminder time (to current time)


getLastServiceTime

public long getLastServiceTime()
Gets the last service time

Returns:
The last service time

setLastServiceTime

public void setLastServiceTime(long v)
Sets the last service time

Parameters:
v - The last service time

getLastServiceDayNumber

public long getLastServiceDayNumber()
Gets the day of the last service

Returns:
The day of the last service

getNextServiceTime

public long getNextServiceTime()
Gets the next service time

Returns:
The next service time

setNextServiceTime

public void setNextServiceTime(long v)
Sets the next service time

Parameters:
v - The next service time

getNextServiceDayNumber

public long getNextServiceDayNumber()
Gets the day of the next service

Returns:
The day of the next service

supportsAssignedUserID

public static boolean supportsAssignedUserID()
Returns true if assigned-userID is supported

Returns:
True if assigned-userID is supported

getAssignedUserID

public java.lang.String getAssignedUserID()
Gets the assigned User-ID

Returns:
The assigned User-ID

setAssignedUserID

public void setAssignedUserID(java.lang.String v)
Sets the assigned User-ID

Parameters:
v - The assigned User-ID

getAssignedUser

public User getAssignedUser()
Gets the assigned User

Returns:
The assigned User, or null if no assigned User

getAssignedUserTimeZone

public java.util.TimeZone getAssignedUserTimeZone()
Gets the TimeZone for the assigned user-id. If there is no assigned user-id, or the assigned user-id does not have a TimeZone preference, then it returns the Account preferred timezone. Does not return null

Returns:
The assigned user timezone, or the Account timezone.

supportsThermalProfile

public static boolean supportsThermalProfile()
Returns true if ThermalProfile is supported

Returns:
True if ThermalProfile is supported

getThermalProfile

public java.lang.String getThermalProfile()
Gets the temperature profile for this device

Returns:
The temperature profile

setThermalProfile

public void setThermalProfile(java.lang.String v)
Sets the temperature profile for this device

Parameters:
v - The temperature profile

supportsHoursOfOperation

public static boolean supportsHoursOfOperation()
Returns true if HoursOfOperation/WorkHours is supported

Returns:
True if HoursOfOperation/WorkHours is supported

hasHoursOfOperation

public boolean hasHoursOfOperation()
Returns true if this device has a defined HoursOfOperation (ie. non-blank)

Returns:
True if this device has a defined HoursOfOperation (ie. non-blank)

getHoursOfOperation

public java.lang.String getHoursOfOperation()
Gets the HoursOfOperation for this device (as a String)

Returns:
The HoursOfOperation

setHoursOfOperation

public void setHoursOfOperation(java.lang.String v)
Sets the HoursOfOperation for this device

Parameters:
v - The HoursOfOperation

setHoursOfOperation

public void setHoursOfOperation(RTProperties rtp)
Sets the HoursOfOperation for this device

Parameters:
rtp - The HoursOfOperation specification (as a RTProperties instance)

setHoursOfOperation

public void setHoursOfOperation(WorkHours wh)
Sets the HoursOfOperation for this device

Parameters:
wh - The HoursOfOperation specification (as a WorkHours instance)

getWorkHours

public WorkHours getWorkHours(WorkHours dft)
Gets a WorkHours instance, based on the HoursOfOperation of this Device

Returns:
The WorkHours instance.

isHoursOfOperation

public boolean isHoursOfOperation(long ts)
Returns true if the specified time is within the HoursOfOperation relative to the Account timezone.

Parameters:
ts - The timestamp representing the time to check
Returns:
True if time is within HoursOfOperation, false otherwise

isHoursOfOperation

public boolean isHoursOfOperation(DateTime dt,
                                  java.util.TimeZone tz)
Returns true if the specified time is within the HoursOfOperation.

Parameters:
dt - The DateTime instance representing the time to check
tz - The TimeZone (null to use the Account TimeZone)
Returns:
True if time is within HoursOfOperation, false otherwise

supportsPendingMessage

public static boolean supportsPendingMessage()
Returns true if PendingMessage is supported

Returns:
True if PendingMessage is supported

hasPendingMessage

public boolean hasPendingMessage()
Returns true if this device has a pending message

Returns:
True if this device has a pending message

getPendingMessage

public java.lang.String getPendingMessage()
Gets the pending message for this device

Returns:
The pending message

setPendingMessage

public void setPendingMessage(java.lang.String v)
Sets the pending message for this device

Parameters:
v - The pending message

getPendingMessageACK

public java.lang.String getPendingMessageACK()
Gets the pending message acknowledgement for this device

Returns:
The pending message acknowledgement

setPendingMessageACK

public void setPendingMessageACK(java.lang.String v)
Sets the pending message acknowledgement for this device

Parameters:
v - The pending message acknowledgement

getMaxPassengers

public int getMaxPassengers()
Gets the maximum number of passengers

Returns:
The maximum number of passengers

setMaxPassengers

public void setMaxPassengers(int v)
Sets the maximum number of passengers

Parameters:
v - The maximum number of passengers

getCustomAttributes

public java.lang.String getCustomAttributes()
Gets the custom attributes for this device

Returns:
The custom attributes for this device

setCustomAttributes

public void setCustomAttributes(java.lang.String v)
Sets the custom attributes for this device

Parameters:
v - The custom attributes for this device

getCustomAttributesRTP

public RTProperties getCustomAttributesRTP()
Gets the custom attributes for this device as an RTProperties instance

Returns:
The custom RTProperties attributes for this device

getCustomAttributeKeys

public java.util.Collection<java.lang.String> getCustomAttributeKeys()
Gets a Collection of custom attribute keys for this device

Returns:
A Collection of custom attribute keys for this device

getCustomAttribute

public java.lang.String getCustomAttribute(java.lang.String key)
Gets the value for a specific custom attribute key

Returns:
The value for a specific custom attribute key

setCustomAttribute

public java.lang.String setCustomAttribute(java.lang.String key,
                                           java.lang.String value)
Sets a specific custom attribute value

Parameters:
key - The custom attribute key
value - The custom value

getWorkOrderID

public java.lang.String getWorkOrderID()
Gets the Work Order ID

Returns:
The Work Order ID (may be a comma separated list)

setWorkOrderID

public void setWorkOrderID(java.lang.String v)
Sets the Work Order ID

Parameters:
v - The Work Order ID (may be a comma separated list)

getWorkOrderIDs

public java.lang.String[] getWorkOrderIDs()
Gets the Work Order IDs as an array

Returns:
The array of Work Order IDs

addWorkOrderID

public boolean addWorkOrderID(java.lang.String woid)
Adds the specified Work Order ID to the current list

Parameters:
woid - The Work Order ID to add
Returns:
True if added

removeWorkOrderID

public boolean removeWorkOrderID(java.lang.String woid)
Removes the specified Work Order ID from the current list

Parameters:
woid - The Work Order ID to remove
Returns:
True if removed

setWorkOrderIDs

public void setWorkOrderIDs(java.lang.String[] W)
Sets the Work Order IDs as an array

Parameters:
W - The Work Order ID array

getJobNumber

public java.lang.String getJobNumber()
Gets the Job number

Returns:
The Job number

setJobNumber

public void setJobNumber(java.lang.String v)
Sets the Job number

Parameters:
v - The Job number

hasJobNumber

public boolean hasJobNumber()
Returns true if Job number is defined

Returns:
True if Job number is defined

setJobLocation

public void setJobLocation(GeoPoint jobLoc,
                           double jobRadM)
Sets the Job location

Parameters:
jobLoc - The Job Location GeoPoint
jobRadM - The Job radius in meters

hasCurrentJob

public boolean hasCurrentJob()
Returns true if there is a current job defined

Returns:
True if there is a current job defined

isImplicitJobDepart

public boolean isImplicitJobDepart(GeoPoint gp)
Returns true if the specified location would represent a job depart

Parameters:
gp - The GeoPoint to test
Returns:
True if the specified location represents a job depart

getJobLatitude

public double getJobLatitude()
Gets the Job latitude

Returns:
The Job latitude

setJobLatitude

public void setJobLatitude(double v)
Sets the Job latitude

Parameters:
v - The Job latitude

getJobLongitude

public double getJobLongitude()
Gets the Job longitude

Returns:
The Job longitude

setJobLongitude

public void setJobLongitude(double v)
Sets the Job longitude

Parameters:
v - The Job longitude

getJobRadius

public double getJobRadius()
Gets the Job radius, in meters

Returns:
The Job radius, in meters

setJobRadius

public void setJobRadius(double v)
Sets the Job radius, in meters

Parameters:
v - The Job radius, in meters

supportsELogState

public boolean supportsELogState()
Returns true if ELogState is supported

Returns:
True if ELogState is supported

getELogEnabled

public boolean getELogEnabled()
Returns true if ELog/HOS is enabled for this Device

Returns:
True if ELog/HOS is enabled for this Device

setELogEnabled

public void setELogEnabled(boolean v)
Sets the "ELog/HOS Enabled" state for this Device

Parameters:
v - The "ELog/HOS Enabled" state for this Device

getLastELogState

public DTELogState getLastELogState()
Gets the last ELog/HOS state
RTP:"enabled=true lastTS=123456789 lastSC=0xF010 isDriving=true|false distKM=1234.5"

Returns:
The last ELog/HOS state

setLastELogState

public void setLastELogState(DTELogState v)
Sets the last HOS pata push time

Parameters:
v - The last HOS data push time

supportsDataPushTime

public boolean supportsDataPushTime()
Returns true if DataPushTime is supported

Returns:
True if DataPushTime is supported

getLastDataPushTime

public long getLastDataPushTime()
Gets the last data push time

Returns:
The last data push time

setLastDataPushTime

public void setLastDataPushTime(long v)
Sets the last data push time

Parameters:
v - The last data push time

getLastEventCreateMillis

public long getLastEventCreateMillis()
Gets the Last Event Creation time, in milliseconds

Returns:
The Last Event Creation time, in milliseconds

setLastEventCreateMillis

public void setLastEventCreateMillis(long v)
Sets the Last Event Creation time, in milliseconds

Parameters:
v - The Last Event Creation time, in milliseconds

getIsActive

public boolean getIsActive()
Gets the active state of this Device record

Overrides:
getIsActive in class AccountRecord<Device>

setCreationDefaultValues

public void setCreationDefaultValues()
Sets the record creation default values

Overrides:
setCreationDefaultValues in class DBRecord<Device>

getAssocAccountID

public java.lang.String getAssocAccountID()
DataTransport Interface: Gets the Associated AccountID

Specified by:
getAssocAccountID in interface DataTransport
Returns:
The Associated AccountID

getAssocDeviceID

public java.lang.String getAssocDeviceID()
DataTransport Interface: Gets the Associated DeviceID

Specified by:
getAssocDeviceID in interface DataTransport
Returns:
The Associated DeviceID

getDCServerConfig

public DCServerConfig getDCServerConfig()
Gets the DCServerConfig instance for this Device

Returns:
The DCServerConfig instance for this Device

getSupportedCommands

public java.util.Map<java.lang.String,java.lang.String> getSupportedCommands(BasicPrivateLabel privLabel,
                                                                             User user,
                                                                             java.lang.String type)
Return a list of supported commands

Parameters:
privLabel - The current PrivateLabel instance
user - The current user instance
type - The command location type (ie. "map", "admin", ...)
Returns:
A map of the specified commands

getStartStopSupported

public boolean getStartStopSupported()
Gets the "Start/Stop StatusCode supported" config

Returns:
The "Start/Stop StatusCode supported" state

getStartStopStatusCodes

public int[] getStartStopStatusCodes()
Returns the start/stop status codes defined in the Device record

Returns:
The start/stop status codes

isPingSupported

public boolean isPingSupported(BasicPrivateLabel privLabel,
                               User user)
Returns true if sending commands is supported for the specified private-label and user

Parameters:
privLabel - The BasicPrivateLabel instance
user - The User

sendDeviceCommand

public boolean sendDeviceCommand(java.lang.String cmdType,
                                 java.lang.String cmdName,
                                 java.lang.String[] cmdArgs)
Sends the specified command to this device

Parameters:
cmdType - The Command type
cmdName - The Command name
cmdArgs - The Command args/parameters
Returns:
True if the command was sent successfully

SetAllowSlowReverseGeocoding

public static void SetAllowSlowReverseGeocoding(boolean allow)
Enabled/Disabled slow reverse-geocoding (default is to allow)

Parameters:
allow - True to allow, false to dis-allow

GetAllowSlowReverseGeocoding

public static boolean GetAllowSlowReverseGeocoding()
Returns true is slow reverse-geocoding is allowed

Returns:
True if allowed, false otherwise

getEventCount

public long getEventCount(long timeStart,
                          long timeEnd)
                   throws DBException
Gets the number of events between the specified timestamps (inclusive)
Note: will return -1 if EventData table is InnoDB

Parameters:
timeStart - The starting timestamp
timeEnd - The ending timestamp
Returns:
The number of events between the specified timestamps (inclusive)
Throws:
DBException

getEventCount

public long getEventCount()
                   throws DBException
Gets the total number of events for this Device/Vehicle

Returns:
The total number of EventData records for this Device
Throws:
DBException

log_EventData

public void log_EventData(int logLevel,
                          EventData ev)
Prints the event information to the log file

Parameters:
ev - The event to log

insertEventData

public boolean insertEventData(EventData evdb)
Insert event into EventData table

Parameters:
evdb - The EventData record to insert
Returns:
True if successful, false otherwise

_insertEventData

protected boolean _insertEventData(EventData evdb)
Insert event into EventData table

Parameters:
evdb - The EventData record to insert
Returns:
True if successful, false otherwise

postCommandHandling

public boolean postCommandHandling(DCServerConfig.Command command,
                                   java.lang.String cmdStr,
                                   boolean update)
Post command handling (called by "DCServerConfig.Command.setDeviceCommandAttributes" after a successful command)

Parameters:
command - The executed DCServerConfig.Command
cmdStr - The command string sent to the device
update - True to update the Device record now.
Returns:
True if there are changed fields.

getAuthorizedUsers

public static OrderedSet<User> getAuthorizedUsers(Device device)
                                           throws DBException
Gets a list of authorised Users for this Device

Parameters:
device - The device for which the User list will be returned.
Returns:
The list of authorized users
Throws:
DBException

deleteEventsPriorTo

public long deleteEventsPriorTo(long priorToTime)
                         throws DBException
Deletes old events from EventData table.

Parameters:
priorToTime - EventData records up to (but excluding) this timestamp will be deleted.
Returns:
The number of records deleted
Throws:
DBException

_createChangedFieldsSet

public java.util.Set<java.lang.String> _createChangedFieldsSet(java.util.Set<java.lang.String> flds)
                                                        throws DBException
Creates a list of fields that should be updated for this device

Parameters:
flds - The pre-initialized list of fields to update
Returns:
The final set of fields to update
Throws:
DBException

_createChangedFieldsSet

public java.util.Set<java.lang.String> _createChangedFieldsSet(java.lang.String... flds)
                                                        throws DBException
Creates a list of fields that should be updated for this device

Parameters:
flds - The pre-initialized list of fields to update
Returns:
The final set of fields to update
Throws:
DBException

clearOtherChangedFieldNames

public void clearOtherChangedFieldNames()
clear all fields specified in the internal update field set


hasChangedFieldNames

public boolean hasChangedFieldNames()
Returns true if the changed field set has been initialized

Returns:
True if the changed field set has been initialized

getOtherChangedFieldNames

public java.util.Set<java.lang.String> getOtherChangedFieldNames()
Returns the set of fields to update (may be null)

Returns:
The set of fields to update (may be null)

addOtherChangedFieldNames

public void addOtherChangedFieldNames(java.util.Set<java.lang.String> flds)
Adds the specified list of update fields to the internal set

Parameters:
flds - The list of fields to add

addOtherChangedFieldNames

public void addOtherChangedFieldNames(java.lang.String... flds)
Adds the specified list of update fields to the internal set

Parameters:
flds - The list of fields to add

updateOtherChangedEventFields

public void updateOtherChangedEventFields()
                                   throws DBException
Updates all fields specified in the internal update field set

Throws:
DBException

updateChangedEventFields

public void updateChangedEventFields()
                              throws DBException
Updates all fields specified in the internal changed field set

Throws:
DBException

updateChangedEventFields

public void updateChangedEventFields(java.util.Set<java.lang.String> flds)
                              throws DBException
Updates the specified changed fields

Parameters:
flds - The field set to update
Throws:
DBException

updateChangedEventFields

public void updateChangedEventFields(java.lang.String... flds)
                              throws DBException
Updates the specified changed fields

Parameters:
flds - The field set to update
Throws:
DBException

insertSessionStatistic

public void insertSessionStatistic(long startTime,
                                   java.lang.String ipAddr,
                                   boolean isDuplex,
                                   long bytesRead,
                                   long bytesWritten,
                                   long evtsRecv)
Insert connection session statistics into the SessionStats table

Parameters:
startTime - The time of the session stat
ipAddr - The IP address
isDuplex - True if TCP/Duplex
bytesRead - The number of bytes read
bytesWritten - The number of bytes written
evtsRecv - The number of events received

CheckSelectorSyntax

public static boolean CheckSelectorSyntax(java.lang.String selector)
Validates the syntax of the specified Rule selector

Parameters:
selector - The rule selector to check
Returns:
True if the rule selector is valid

checkEventRules

protected boolean checkEventRules(EventData event)
Checks the rules which are applicable for the specified event Note: The EventData instance MUST already be set with the parent Device record!

Parameters:
event - The EventData instance to check

getStatusCode

public StatusCode getStatusCode(int code)
Gets the StatusCode instance for the specified code

Parameters:
code - The numeric status code value
Returns:
The StatusCode instance

getAttachedEntityIDs

public java.lang.String[] getAttachedEntityIDs(EntityManager.EntityType etype)
Gets and array of the attached Entity IDs which are attached to this Device

Parameters:
etype - The EntityType
Returns:
The array of Entity IDs

getAttachedEntityIDs

public java.lang.String[] getAttachedEntityIDs(int entityType)
Gets and array of the attached Entity IDs which are attached to this Device

Parameters:
entityType - The EntityType
Returns:
The array of Entity IDs

getAttachedEntityDescriptions

public java.lang.String[] getAttachedEntityDescriptions(EntityManager.EntityType etype)
Gets and array of the attached Entity Descriptions which are attached to this Device

Parameters:
etype - The EntityType
Returns:
The array of Entity IDs

getAttachedEntityDescriptions

public java.lang.String[] getAttachedEntityDescriptions(int entityType)
Gets and array of the attached Entity Descriptions which are attached to this Device

Parameters:
entityType - The EntityType
Returns:
The array of Entity IDs

getSavedRangeEvents

public EventData[] getSavedRangeEvents()
Gets the saved list of cached events

Returns:
The list of events to cache

setSavedRangeEvents

public void setSavedRangeEvents(EventData[] events)
Sets the saved list of cached events

Parameters:
events - The list of events to cache

getRangeEvents

public EventData[] getRangeEvents(long timeStart,
                                  long timeEnd,
                                  int[] statusCodes,
                                  boolean validGPS,
                                  EventData.LimitType limitType,
                                  long limit)
                           throws DBException
Gets an array of events for the specified range and attributes

Parameters:
timeStart - The event start time
timeEnd - The event end time
statusCodes - The list of status-codes
validGPS - True to read only events with valid GPS locations
limitType - The limit type (FIRST, LAST)
limit - The maximum number of events to return
Returns:
The array of EventData records
Throws:
DBException

getRangeEvents

public EventData[] getRangeEvents(long timeStart,
                                  long timeEnd,
                                  boolean validGPS,
                                  EventData.LimitType limitType,
                                  long limit)
                           throws DBException
Gets an array of events for the specified range and attributes

Parameters:
timeStart - The event start time
timeEnd - The event end time
validGPS - True to read only events with valid GPS locations
limitType - The limit type (FIRST, LAST)
limit - The maximum number of events to return
Returns:
The array of EventData records
Throws:
DBException

getLatestEvents

public EventData[] getLatestEvents(long limit,
                                   boolean validGPS)
                            throws DBException
Gets an array of EventData records

Parameters:
limit - The maximum number of events to return
validGPS - True to read only events with valid GPS locations
Returns:
The array of EventData records
Throws:
DBException

getFirstEvent

public EventData getFirstEvent(long startTime,
                               boolean validGPS)
                        throws DBException
Gets the first EventData record greater-than or equal-to the specified start time

Parameters:
startTime - The event start time
validGPS - True to only return the first event with a valid GPS
Returns:
The EventData record
Throws:
DBException

getLastEvent

public EventData getLastEvent(boolean validGPS)
                       throws DBException
Gets the last EventData record in the EventData table for this Device

Parameters:
validGPS - True to only return the last event with a valid GPS
Returns:
The EventData record
Throws:
DBException

getLastEvent

public EventData getLastEvent(long endTime,
                              boolean validGPS)
                       throws DBException
Gets the last EventData record in the EventData table for this Device

Parameters:
endTime - Return the EventData record less-than or equal-to this time
validGPS - True to only return the last event with a valid GPS
Returns:
The EventData record
Throws:
DBException

getLastEvent

public EventData getLastEvent(int[] statusCodes)
                       throws DBException
Gets the last EventData record in the EventData table for this Device

Parameters:
statusCodes - Return the last event that matches one of these status codes
Returns:
The EventData record
Throws:
DBException

getLastEvent

public EventData getLastEvent(int[] statusCodes,
                              long endTime,
                              boolean validGPS)
                       throws DBException
Gets the last EventData record in the EventData table for this Device

Parameters:
statusCodes - Return the last event that matches one of these status codes
endTime - Return the EventData record less-than or equal-to this time
validGPS - True to only return the last event with a valid GPS
Returns:
The EventData record
Throws:
DBException

reprocessEventDataRecords

public void reprocessEventDataRecords(long timeStart,
                                      long timeEnd,
                                      Device.EventDataHandler edh)
                               throws DBException
Reprocesses a range of EventData reocrds

Parameters:
timeStart - The start time
timeEnd - The end time
edh - The callback EventDataHandler instance
Throws:
DBException

vinDidChange

protected void vinDidChange(java.lang.String oldVIN,
                            java.lang.String newVIN)
Callback for VIN changed


eventWillInsert

protected void eventWillInsert(EventData evdb)
Callback indicating EventData instance will be inserted Note: "evdb.getDevice()" may be a copy of "this" Device instance. No adjustments have been made to the Device instance.


eventDidInsert

protected void eventDidInsert(EventData evdb)
Callback indicating EventData instance has been inserted Note: "evdb.getDevice()" may be a copy of "this" Device instance, but made prior to any adjustments made from the EventData instance.


save

public void save()
          throws DBException
Save this Device to db storage

Overrides:
save in class DBRecord<Device>
Throws:
DBException - If a database error occurs

toString

public java.lang.String toString()
Return a String representation of this Device

Overrides:
toString in class DBRecord<Device>
Returns:
The String representation

setTransport

public void setTransport(Transport xport)
Sets the Transport for this Device

Parameters:
xport - The Transport instance

getTransportID

public java.lang.String getTransportID()
Gets the Transport-ID for this Device (if any)

Specified by:
getTransportID in interface DataTransport
Returns:
The Transport-ID for this Device, or an empty string is not defined

getDataTransport

public DataTransport getDataTransport()
Gets the DataTransport for this Device

Returns:
The DataTransport for this Device

countOldEvents

public long countOldEvents(long oldTimeSec)
                    throws DBException
Count the number of events prior to the specified time
Note: Will return -1 if EventData table is InnoDB.

Parameters:
oldTimeSec - The timestamp before which events will be counted
Returns:
The number of events counted
Throws:
DBException

deleteOldEvents

public long deleteOldEvents(long oldTimeSec,
                            java.lang.StringBuffer logMsg)
                     throws DBException
Delete events prior to the specified time.
Note: Will return -1 if EventData table is InnoDB. Old events will still be deleted, however it will still go through the motions of attempting to delete events, event if the range is empty.

Parameters:
oldTimeSec - The timestamp before which events will be deleted
logMsg - A StringBuffer instance into which deletion log messages are placed.
Returns:
The number of events deleted
Throws:
DBException

_reload

public Device _reload(java.lang.String... fldNames)
               throws DBException
Description copied from class: DBRecord
Reload the contents of this record from the DB

Overrides:
_reload in class DBRecord<Device>
Returns:
The DBRecord
Throws:
DBException - If a general DB error occurs

exists

public static boolean exists(java.lang.String acctID,
                             java.lang.String devID)
                      throws DBException
Returns true if the specified record exists

Parameters:
acctID - The Account ID
devID - The Device ID
Returns:
True if the record exists
Throws:
DBException

loadDeviceBySimPhoneNumber

public static Device loadDeviceBySimPhoneNumber(java.lang.String simPhone)
                                         throws DBException
This method is used to load a Device record based on the SIM phone number. Intended for use by an incoming SMS message handler. It is up to the caller to check whether this Device or Account are inactive.

Parameters:
simPhone - The SIM phone number of the device
Returns:
The loaded Device instance, or null if the Device was not found
Throws:
DBException - if a database error occurs

loadDeviceByUniqueID

public static Device loadDeviceByUniqueID(java.lang.String uniqId)
                                   throws DBException
This method is called by "Transport.loadDeviceByUniqueID(String)" to load a Device within a Device Communication Server, based on a Unique-ID. It is up to the caller to check whether this Device or Account are inactive.

Parameters:
uniqId - The Unique-ID of the device (ie. IMEI, ESN, Serial#, etc)
Returns:
The loaded Device instance, or null if the Device was not found
Throws:
DBException - if a database error occurs

loadDeviceByName

public static Device loadDeviceByName(Account account,
                                      java.lang.String devID)
                               throws DBException
This method is called by "Transport.loadDeviceByTransportID(...)" to load a Device within a Device Communication Server, based on the Account and Device IDs.

Parameters:
account - The Account instance representing the owning account
devID - The Device-ID
Returns:
The loaded Device instance, or null if the Device was not found
Throws:
DBException - if a database error occurs

getDevice

public static Device getDevice(Account account,
                               java.lang.String devID)
                        throws DBException
Gets the specified Device record

Parameters:
account - The Account
devID - The Device ID
Returns:
The Device record
Throws:
DBException

getDevice

public static Device getDevice(Account account,
                               java.lang.String devID,
                               java.lang.String... fieldNames)
                        throws DBException
Gets the specified Device record

Parameters:
account - The Account
devID - The Device ID
fieldNames - The specific field-names to load (null to load all)
Returns:
The Device record (null if Device does not exist)
Throws:
DBException

_getDevice

public static Device _getDevice(Account account,
                                java.lang.String devID)
                         throws DBException
Gets the specified Device record.
This method should only be used when relatively sure that the specified deviceID exists.

Parameters:
account - The Account
devID - The Device ID
Returns:
The Device record (does not return null)
Throws:
DBException - If any DB error occurs.

_getDevice

public static Device _getDevice(Account account,
                                java.lang.String devID,
                                java.lang.String... fieldNames)
                         throws DBException
Gets the specified Device record.
This method should only be used when relatively sure that the specified deviceID exists.

Parameters:
account - The Account
devID - The Device ID
fieldNames - The specific field-names to load (null to load all). All non-specified fields will be undefined in this Device record.
Returns:
The Device record (does not return null)
Throws:
DBException - If any DB error occurs.

getDevice

public static Device getDevice(Account account,
                               java.lang.String devID,
                               boolean create)
                        throws DBException
Gets or Creates a Device record

Parameters:
account - The Account
devID - The Device ID
create - True to create the Device if it does not already exist
Returns:
The Device record
Throws:
DBExeption
DBException

createNewDevice

public static Device createNewDevice(Account account,
                                     java.lang.String devID,
                                     java.lang.String uniqueID)
                              throws DBException
Create/Save Device record

Parameters:
account - The Account
devID - The Device ID
uniqueID - The Device Unique ID
Returns:
The Device record
Throws:
DBExeption
DBException

createVirtualDevice

public static Device createVirtualDevice(java.lang.String acctID,
                                         java.lang.String devID)
(EXPERIMENTAL) Creates a virtual Device record

Parameters:
acctID - The Account ID
devID - The Device ID
Returns:
The Device record

getDeviceIDsForAccount

public static OrderedSet<java.lang.String> getDeviceIDsForAccount(java.lang.String acctId,
                                                                  User userAuth,
                                                                  boolean inclInactv)
                                                           throws DBException
Gets a set of Device IDs for the specified Account (oes not return null)

Parameters:
acctId - The Account ID
userAuth - The User record
inclInactv - True to include inactive Devices
Returns:
A set of Device IDs
Throws:
DBExeption
DBException

getDeviceIDsForAccount

public static OrderedSet<java.lang.String> getDeviceIDsForAccount(java.lang.String acctId,
                                                                  User userAuth,
                                                                  boolean inclInactv,
                                                                  long limit)
                                                           throws DBException
Gets a set of Device IDs for the specified Account (oes not return null)

Parameters:
acctId - The Account ID
userAuth - The User record
inclInactv - True to include inactive Devices
limit - The maximum number of Device IDs to return
Returns:
A set of Device IDs
Throws:
DBExeption
DBException

getKeyFieldTitle

public static java.lang.String getKeyFieldTitle(java.lang.String key,
                                                java.lang.String arg,
                                                java.util.Locale locale)
Gets the field title for the specified key

Parameters:
key - The key
arg - The type parameter
locale - The Locale
Returns:
The title

getKeyFieldValue

public java.lang.String getKeyFieldValue(java.lang.String key,
                                         java.lang.String arg,
                                         BasicPrivateLabel bpl)
Gets the field value for the specified key

Parameters:
key - The key
arg - The type parameter
bpl - The BasicPrivateLabel
Returns:
The value

_getKeyFieldString

public static java.lang.String _getKeyFieldString(boolean getTitle,
                                                  java.lang.String key,
                                                  java.lang.String arg,
                                                  java.util.Locale locale,
                                                  BasicPrivateLabel bpl,
                                                  Device dev)
Gets the field title/value for the specified key

Parameters:
getTitle - True to get the title, false for value
key - The key
arg - The type parameter
locale - The Locale
bpl - The BasicPrivateLabel
dev - The Device record
Returns:
The title/value

getDeviceDescriptionComparator

public static java.util.Comparator<Device> getDeviceDescriptionComparator()
Gets the Device Description Sort Comparator

Returns:
The Device Description Sort Comparator

main

public static void main(java.lang.String[] args)
Main entry point for Device command-line tools

Parameters:
args - The main entry point arguments