org.opengts.servers
Class GPSEvent

java.lang.Object
  extended by org.opengts.db.EventDataProviderAdapter
      extended by org.opengts.servers.GPSEvent
All Implemented Interfaces:
EventDataProvider, GeoPointProvider

public class GPSEvent
extends EventDataProviderAdapter
implements GeoPointProvider


Constructor Summary
GPSEvent(DCServerConfig server, java.lang.String ipAddress, int clientPort, Device device)
          Constructor
GPSEvent(DCServerConfig server, java.lang.String ipAddress, int clientPort, java.lang.String modemID)
          Constructor
GPSEvent(DCServerConfig server, java.lang.String ipAddress, int clientPort, java.lang.String acctID, java.lang.String devID)
          Constructor
 
Method Summary
protected  boolean _setDevice(Device device, java.lang.String ipAddress, int clientPort)
           
 java.lang.String getAccountID()
           
 java.lang.String getAddress()
           
 java.util.Map<java.lang.String,java.lang.Object> getAlternateFieldMap()
          Retrurns the "alternate" field map
 double getAltitude()
           
 double getBatteryLevel()
           
 double getBestAccuracy()
           
 GeoPoint getBestGeoPoint()
           
 Device getDevice()
           
protected  java.lang.String getDeviceCode()
           
 java.lang.String getDeviceDescription()
           
 java.lang.String getDeviceID()
           
 java.lang.String getDeviceVIN()
           
 double getEngineHours()
           
 int getEventIndex()
           
 java.lang.Object getFieldValue(java.lang.String fldName)
           
 double getFuelTotal()
           
 GeoPoint getGeoPoint()
          Returns a GeoPoint instance
 java.lang.String getGeozoneID()
           
 long getGpsAge()
           
 double getHDOP()
           
 double getHeading()
           
 double getHorzAccuracy()
           
 long getInputMask()
           
 boolean getIsFirstEvent()
           
 boolean getIsLastEvent()
           
 double getLatitude()
           
 double getLongitude()
           
 double getOdometerKM()
           
 RTProperties getProperties()
          Returns the internal RTProperties instance which holds the EventData field values.
 double getPtoHours()
           
 int getPushpinIconIndex(java.lang.String iconSelector, OrderedSet<java.lang.String> iconKeys, boolean isFleet, BasicPrivateLabel bpl)
           
 int getSatelliteCount()
           
 double getSignalStrength()
           
 double getSpeedKPH()
           
 int getStatusCode()
           
 java.lang.String getStatusCodeDescription(BasicPrivateLabel bpl)
           
 long getTimestamp()
           
 java.lang.String getUniqueID()
           
 boolean hasAddress()
           
 boolean hasAltitude()
           
 boolean hasBatteryLevel()
           
 boolean hasDevice()
           
 boolean hasEngineHours()
           
 boolean hasFuelTotal()
           
 boolean hasGeozoneID()
           
 boolean hasGpsAge()
           
 boolean hasHDOP()
           
 boolean hasHeading()
           
 boolean hasHorzAccuracy()
           
 boolean hasInputMask()
           
 boolean hasLatitude()
           
 boolean hasLongitude()
           
 boolean hasOdometerKM()
           
 boolean hasPtoHours()
           
 boolean hasSatelliteCount()
           
 boolean hasSignalStrength()
           
 boolean hasSpeedKPH()
           
 boolean hasStatusCode()
           
 boolean hasTimestamp()
           
 boolean insertEventData()
           
 boolean insertEventData(long fixtime, int statusCode)
           
 boolean insertEventData(long fixtime, int statusCode, Geozone zone)
           
 boolean isValidGeoPoint()
           
protected  Device loadDevice(java.lang.String modemID)
           
protected  Device loadDevice(java.lang.String acctID, java.lang.String devID)
           
 void setAltitude(double altM)
           
 void setBatteryLevel(double level)
           
 void setEngineHours(double hours)
           
 void setEventIndex(int ndx)
           
 void setFieldValue(java.lang.String fldName, boolean fldVal)
           
 void setFieldValue(java.lang.String fldName, double fldVal)
           
 void setFieldValue(java.lang.String fldName, int fldVal)
           
 void setFieldValue(java.lang.String fldName, long fldVal)
           
 void setFieldValue(java.lang.String fldName, java.lang.Object fldVal)
           
 void setFieldValue(java.lang.String fldName, java.lang.String fldVal)
           
 void setFuelTotal(double fuel)
           
 void setGeoPoint(GeoPoint gp)
           
 void setGeozone(Geozone zone)
           
 void setGeozoneID(java.lang.String gzid)
           
 void setGpsAge(long ageSec)
           
 void setHDOP(double hdop)
           
 void setHeading(double heading)
           
 void setHorzAccuracy(double acc)
           
 void setInputMask(long mask)
           
 void setIsLastEvent(boolean isLast)
           
 void setLatitude(double lat)
           
 void setLongitude(double lon)
           
 void setOdometerKM(double km)
           
 void setPtoHours(double hours)
           
 void setSatelliteCount(int count)
           
 void setSignalStrength(double rssi)
           
 void setSpeedKPH(double kph)
           
 void setStatusCode(int code)
           
 void setTimestamp(long timestamp)
           
 java.lang.String toString()
           
 boolean updateDevice()
           
 
Methods inherited from class org.opengts.db.EventDataProviderAdapter
getCreationAge, getStatusCodeProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GPSEvent

public GPSEvent(DCServerConfig server,
                java.lang.String ipAddress,
                int clientPort,
                Device device)
Constructor


GPSEvent

public GPSEvent(DCServerConfig server,
                java.lang.String ipAddress,
                int clientPort,
                java.lang.String modemID)
Constructor


GPSEvent

public GPSEvent(DCServerConfig server,
                java.lang.String ipAddress,
                int clientPort,
                java.lang.String acctID,
                java.lang.String devID)
Constructor

Method Detail

getDeviceCode

protected java.lang.String getDeviceCode()

loadDevice

protected Device loadDevice(java.lang.String modemID)

loadDevice

protected Device loadDevice(java.lang.String acctID,
                            java.lang.String devID)

_setDevice

protected boolean _setDevice(Device device,
                             java.lang.String ipAddress,
                             int clientPort)

hasDevice

public boolean hasDevice()

getDevice

public Device getDevice()

updateDevice

public boolean updateDevice()

insertEventData

public boolean insertEventData(long fixtime,
                               int statusCode)

insertEventData

public boolean insertEventData(long fixtime,
                               int statusCode,
                               Geozone zone)

insertEventData

public boolean insertEventData()

getUniqueID

public java.lang.String getUniqueID()

getAccountID

public java.lang.String getAccountID()
Specified by:
getAccountID in interface EventDataProvider
Overrides:
getAccountID in class EventDataProviderAdapter

getDeviceID

public java.lang.String getDeviceID()
Specified by:
getDeviceID in interface EventDataProvider
Overrides:
getDeviceID in class EventDataProviderAdapter

getDeviceDescription

public java.lang.String getDeviceDescription()
Specified by:
getDeviceDescription in interface EventDataProvider
Overrides:
getDeviceDescription in class EventDataProviderAdapter

getDeviceVIN

public java.lang.String getDeviceVIN()
Specified by:
getDeviceVIN in interface EventDataProvider
Overrides:
getDeviceVIN in class EventDataProviderAdapter

getStatusCodeDescription

public java.lang.String getStatusCodeDescription(BasicPrivateLabel bpl)
Specified by:
getStatusCodeDescription in interface EventDataProvider
Overrides:
getStatusCodeDescription in class EventDataProviderAdapter

getPushpinIconIndex

public int getPushpinIconIndex(java.lang.String iconSelector,
                               OrderedSet<java.lang.String> iconKeys,
                               boolean isFleet,
                               BasicPrivateLabel bpl)
Specified by:
getPushpinIconIndex in interface EventDataProvider
Overrides:
getPushpinIconIndex in class EventDataProviderAdapter

getProperties

public RTProperties getProperties()
Returns the internal RTProperties instance which holds the EventData field values.

Returns:
The internal RTProperties instance.

getAlternateFieldMap

public java.util.Map<java.lang.String,java.lang.Object> getAlternateFieldMap()
Retrurns the "alternate" field map

Returns:
The "alternate" field map

setTimestamp

public void setTimestamp(long timestamp)

hasTimestamp

public boolean hasTimestamp()

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface EventDataProvider
Overrides:
getTimestamp in class EventDataProviderAdapter

setStatusCode

public void setStatusCode(int code)

hasStatusCode

public boolean hasStatusCode()

getStatusCode

public int getStatusCode()
Specified by:
getStatusCode in interface EventDataProvider
Overrides:
getStatusCode in class EventDataProviderAdapter

setLatitude

public void setLatitude(double lat)

hasLatitude

public boolean hasLatitude()

getLatitude

public double getLatitude()
Specified by:
getLatitude in interface EventDataProvider
Overrides:
getLatitude in class EventDataProviderAdapter

setLongitude

public void setLongitude(double lon)

hasLongitude

public boolean hasLongitude()

getLongitude

public double getLongitude()
Specified by:
getLongitude in interface EventDataProvider
Overrides:
getLongitude in class EventDataProviderAdapter

setGeoPoint

public void setGeoPoint(GeoPoint gp)

getGeoPoint

public GeoPoint getGeoPoint()
Description copied from interface: GeoPointProvider
Returns a GeoPoint instance

Specified by:
getGeoPoint in interface EventDataProvider
Specified by:
getGeoPoint in interface GeoPointProvider
Overrides:
getGeoPoint in class EventDataProviderAdapter
Returns:
A GeoPoint instance

isValidGeoPoint

public boolean isValidGeoPoint()
Specified by:
isValidGeoPoint in interface EventDataProvider
Overrides:
isValidGeoPoint in class EventDataProviderAdapter

setHorzAccuracy

public void setHorzAccuracy(double acc)

hasHorzAccuracy

public boolean hasHorzAccuracy()

getHorzAccuracy

public double getHorzAccuracy()
Specified by:
getHorzAccuracy in interface EventDataProvider
Overrides:
getHorzAccuracy in class EventDataProviderAdapter

getBestGeoPoint

public GeoPoint getBestGeoPoint()
Specified by:
getBestGeoPoint in interface EventDataProvider
Overrides:
getBestGeoPoint in class EventDataProviderAdapter

getBestAccuracy

public double getBestAccuracy()
Specified by:
getBestAccuracy in interface EventDataProvider
Overrides:
getBestAccuracy in class EventDataProviderAdapter

setGpsAge

public void setGpsAge(long ageSec)

hasGpsAge

public boolean hasGpsAge()

getGpsAge

public long getGpsAge()
Specified by:
getGpsAge in interface EventDataProvider
Overrides:
getGpsAge in class EventDataProviderAdapter

setHDOP

public void setHDOP(double hdop)

hasHDOP

public boolean hasHDOP()

getHDOP

public double getHDOP()

setSatelliteCount

public void setSatelliteCount(int count)

hasSatelliteCount

public boolean hasSatelliteCount()

getSatelliteCount

public int getSatelliteCount()
Specified by:
getSatelliteCount in interface EventDataProvider
Overrides:
getSatelliteCount in class EventDataProviderAdapter

setBatteryLevel

public void setBatteryLevel(double level)

hasBatteryLevel

public boolean hasBatteryLevel()

getBatteryLevel

public double getBatteryLevel()
Specified by:
getBatteryLevel in interface EventDataProvider
Overrides:
getBatteryLevel in class EventDataProviderAdapter

setSignalStrength

public void setSignalStrength(double rssi)

hasSignalStrength

public boolean hasSignalStrength()

getSignalStrength

public double getSignalStrength()

setSpeedKPH

public void setSpeedKPH(double kph)

hasSpeedKPH

public boolean hasSpeedKPH()

getSpeedKPH

public double getSpeedKPH()
Specified by:
getSpeedKPH in interface EventDataProvider
Overrides:
getSpeedKPH in class EventDataProviderAdapter

setHeading

public void setHeading(double heading)

hasHeading

public boolean hasHeading()

getHeading

public double getHeading()
Specified by:
getHeading in interface EventDataProvider
Overrides:
getHeading in class EventDataProviderAdapter

setAltitude

public void setAltitude(double altM)

hasAltitude

public boolean hasAltitude()

getAltitude

public double getAltitude()
Specified by:
getAltitude in interface EventDataProvider
Overrides:
getAltitude in class EventDataProviderAdapter

setOdometerKM

public void setOdometerKM(double km)

hasOdometerKM

public boolean hasOdometerKM()

getOdometerKM

public double getOdometerKM()
Specified by:
getOdometerKM in interface EventDataProvider
Overrides:
getOdometerKM in class EventDataProviderAdapter

setGeozoneID

public void setGeozoneID(java.lang.String gzid)

setGeozone

public void setGeozone(Geozone zone)

hasGeozoneID

public boolean hasGeozoneID()

getGeozoneID

public java.lang.String getGeozoneID()
Specified by:
getGeozoneID in interface EventDataProvider
Overrides:
getGeozoneID in class EventDataProviderAdapter

hasAddress

public boolean hasAddress()

getAddress

public java.lang.String getAddress()
Specified by:
getAddress in interface EventDataProvider
Overrides:
getAddress in class EventDataProviderAdapter

setInputMask

public void setInputMask(long mask)

hasInputMask

public boolean hasInputMask()

getInputMask

public long getInputMask()
Specified by:
getInputMask in interface EventDataProvider
Overrides:
getInputMask in class EventDataProviderAdapter

setEngineHours

public void setEngineHours(double hours)

hasEngineHours

public boolean hasEngineHours()

getEngineHours

public double getEngineHours()

setPtoHours

public void setPtoHours(double hours)

hasPtoHours

public boolean hasPtoHours()

getPtoHours

public double getPtoHours()

setFuelTotal

public void setFuelTotal(double fuel)

hasFuelTotal

public boolean hasFuelTotal()

getFuelTotal

public double getFuelTotal()

setEventIndex

public void setEventIndex(int ndx)
Specified by:
setEventIndex in interface EventDataProvider
Overrides:
setEventIndex in class EventDataProviderAdapter

getEventIndex

public int getEventIndex()
Specified by:
getEventIndex in interface EventDataProvider
Overrides:
getEventIndex in class EventDataProviderAdapter

getIsFirstEvent

public boolean getIsFirstEvent()
Specified by:
getIsFirstEvent in interface EventDataProvider
Overrides:
getIsFirstEvent in class EventDataProviderAdapter

setIsLastEvent

public void setIsLastEvent(boolean isLast)
Specified by:
setIsLastEvent in interface EventDataProvider
Overrides:
setIsLastEvent in class EventDataProviderAdapter

getIsLastEvent

public boolean getIsLastEvent()
Specified by:
getIsLastEvent in interface EventDataProvider
Overrides:
getIsLastEvent in class EventDataProviderAdapter

getFieldValue

public java.lang.Object getFieldValue(java.lang.String fldName)

setFieldValue

public void setFieldValue(java.lang.String fldName,
                          java.lang.Object fldVal)

setFieldValue

public void setFieldValue(java.lang.String fldName,
                          boolean fldVal)

setFieldValue

public void setFieldValue(java.lang.String fldName,
                          int fldVal)

setFieldValue

public void setFieldValue(java.lang.String fldName,
                          long fldVal)

setFieldValue

public void setFieldValue(java.lang.String fldName,
                          double fldVal)

setFieldValue

public void setFieldValue(java.lang.String fldName,
                          java.lang.String fldVal)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object