org.opengts.db
Class EventUtil

java.lang.Object
  extended by org.opengts.db.EventUtil

public class EventUtil
extends java.lang.Object


Nested Class Summary
static interface EventUtil.OptionalEventFields
           
 
Field Summary
static java.lang.String ATTR_account
           
static java.lang.String ATTR_age
           
static java.lang.String ATTR_battery
           
static java.lang.String ATTR_code
           
static java.lang.String ATTR_color
           
static java.lang.String ATTR_command
           
static java.lang.String ATTR_day
           
static java.lang.String ATTR_desc
           
static java.lang.String ATTR_device
           
static java.lang.String ATTR_epoch
           
static java.lang.String ATTR_id
           
static java.lang.String ATTR_index
           
static java.lang.String ATTR_isFleet
           
static java.lang.String ATTR_limit
           
static java.lang.String ATTR_month
           
static java.lang.String ATTR_ppNdx
           
static java.lang.String ATTR_radius
           
static java.lang.String ATTR_route
           
static java.lang.String ATTR_routeColor
           
static java.lang.String ATTR_signal
           
static java.lang.String ATTR_textColor
           
static java.lang.String ATTR_timestamp
           
static java.lang.String ATTR_timezone
           
static java.lang.String ATTR_type
           
static java.lang.String ATTR_units
           
static java.lang.String ATTR_year
           
static char CSV_SEPARATOR_CHAR
           
static long DFT_MAX_PUSHPIN_LIMIT
           
static java.lang.String DSTYPE_device
           
static java.lang.String DSTYPE_group
           
static java.lang.String DSTYPE_poi
           
static int FORMAT_AEMP
           
static int FORMAT_BML
           
static int FORMAT_CSV
           
static int FORMAT_GPX
           
static int FORMAT_JSON
           
static int FORMAT_JSONX
           
static int FORMAT_KML
           
static int FORMAT_TXT
           
static int FORMAT_UNKNOWN
           
static int FORMAT_XML
           
static int FORMAT_XMLOLD
           
static java.lang.String JSON_Account
           
static java.lang.String JSON_Actions
           
static java.lang.String JSON_arg
           
static java.lang.String JSON_cmd
           
static java.lang.String JSON_color
           
static java.lang.String JSON_Command
           
static java.lang.String JSON_Data
           
static java.lang.String JSON_DataColumns
           
static java.lang.String JSON_DataSets
           
static java.lang.String JSON_date
           
static java.lang.String JSON_day
           
static java.lang.String JSON_desc
           
static java.lang.String JSON_Error
           
static java.lang.String JSON_id
           
static java.lang.String JSON_JMapData
           
static java.lang.String JSON_LastEvent
           
static java.lang.String JSON_month
           
static java.lang.String JSON_Points
           
static java.lang.String JSON_ppNdx
           
static java.lang.String JSON_radius
           
static java.lang.String JSON_route
           
static java.lang.String JSON_routeColor
           
static java.lang.String JSON_Shapes
           
static java.lang.String JSON_textColor
           
static java.lang.String JSON_time
           
static java.lang.String JSON_Time
           
static java.lang.String JSON_type
           
static java.lang.String JSON_User
           
static java.lang.String JSON_Version
           
static java.lang.String JSON_year
           
static java.lang.String JSON_YMD
           
static java.lang.String MAP_ESCAPE_B64
           
static java.lang.String MAP_ESCAPE_HTML
           
static int MAPDATA_DEFAULT
           
static int MAPDATA_JSON
           
static int MAPDATA_XML
           
static boolean SEPARATE_DATASET_PER_DEVICE
           
static java.lang.String TAG_Account
           
static java.lang.String TAG_Action
           
static java.lang.String TAG_Address
           
static java.lang.String TAG_Altitude
           
static java.lang.String TAG_City
           
static java.lang.String TAG_DataColumns
           
static java.lang.String TAG_DataSet
           
static java.lang.String TAG_Description
           
static java.lang.String TAG_Device
           
static java.lang.String TAG_DigitalInputMask
           
static java.lang.String TAG_DriverID
           
static java.lang.String TAG_DriverMessage
           
static java.lang.String TAG_EngineCoolantLevel
           
static java.lang.String TAG_EngineCoolantTemperature
           
static java.lang.String TAG_EngineFuelUsed
           
static java.lang.String TAG_EngineHours
           
static java.lang.String TAG_EngineRPM
           
static java.lang.String TAG_Event
           
static java.lang.String TAG_EventData
           
static java.lang.String TAG_Geozone
           
static java.lang.String TAG_GPSPoint
           
static java.lang.String TAG_Heading
           
static java.lang.String TAG_LastEvent
           
static java.lang.String TAG_MapData
           
static java.lang.String TAG_Odometer
           
static java.lang.String TAG_Point
           
static java.lang.String TAG_PostalCode
           
static java.lang.String TAG_Shape
           
static java.lang.String TAG_Speed
           
static java.lang.String TAG_StatusCode
           
static java.lang.String TAG_Time
           
static java.lang.String TAG_Timestamp
           
static java.lang.String TAG_VehicleBatteryVolts
           
 
Method Summary
static void closeOutputStream(java.io.OutputStream out)
           
 java.lang.String formatMapEvent(BasicPrivateLabel privLabel, EventDataProvider edp, java.lang.String iconSelector, OrderedSet<java.lang.String> iconKeys, boolean isFleet, int stoppedState, java.util.TimeZone tmz, java.lang.String dateFmt, java.lang.String timeFmt)
           
 java.lang.String formatMapEvent(BasicPrivateLabel privLabel, EventDataProvider edp, java.lang.String iconSelector, OrderedSet<java.lang.String> iconKeys, boolean isFleet, int stoppedState, java.util.TimeZone tmz, java.lang.String dateFmt, java.lang.String timeFmt, char csvSep)
           
static int GetDefaultMapDataFormat()
           
static EventUtil getInstance()
           
 JSON._Object getJMapData_JSON(BasicPrivateLabel privLabel, EventDataProvider[] edp, boolean includeShapes, java.lang.String iconSelector, OrderedSet<java.lang.String> iconKeys, boolean isFleet, boolean fleetRoute, java.lang.String selID, java.util.TimeZone tmz, Account acct, User user, DateTime latestTime, double lastBattery, double lastSignal, double minProximityM, java.util.Collection<java.lang.String> actions, char csvSep)
           
static EventUtil.OptionalEventFields getOptionalEventFieldHandler()
           
 java.lang.String getParseMapEventJS(boolean isFleet, java.util.Locale locale)
           
 java.lang.String getParseMapEventJS(boolean isFleet, java.util.Locale locale, char csvSep)
           
static boolean hasOptionalEventFieldHandler()
           
static boolean IsXMLMapDataFormat(int mdf)
           
static void main(java.lang.String[] argv)
           
static java.io.OutputStream openFileOutputStream(java.lang.String outFile)
           
static int parseOutputFormat(java.lang.String fmt, int dftFmt)
           
static void SetDefaultMapDataFormat(int dftDataFmt)
           
static void setOptionalEventFieldHandler(EventUtil.OptionalEventFields oef)
           
 boolean writeEvents_JSON(java.io.PrintWriter pwout, Account account, java.util.Collection<Device> devList, boolean allTags, java.util.TimeZone dispTmz, BasicPrivateLabel privLabel)
           
 boolean writeEvents(java.io.OutputStream out, Account account, java.util.Collection<Device> devList, int formatEnum, boolean allTags, java.util.TimeZone tmz, BasicPrivateLabel privLabel)
           
 boolean writeEvents(java.io.PrintWriter pwout, Account account, java.util.Collection<Device> devList, int formatEnum, boolean allTags, java.util.TimeZone dispTmz, BasicPrivateLabel privLabel)
           
 boolean writeMapEvents_xml(int indentLevel, java.io.PrintWriter pwout, boolean isSoapRequest, boolean isTopLevelTag, BasicPrivateLabel privLabel, EventDataProvider[] edp, boolean includeShapes, java.lang.String iconSelector, OrderedSet<java.lang.String> iconKeys, boolean isFleet, boolean fleetRoute, java.lang.String selID, java.util.TimeZone tmz, Account acct, User user, DateTime latestTime, double lastBattery, double lastSignal, double minProximityM)
           
 boolean writeMapEvents(int dataFmt, int indentLevel, java.io.PrintWriter pwout, boolean isSoapRequest, boolean isTopLevelTag, BasicPrivateLabel privLabel, EventDataProvider[] edp, boolean includeShapes, java.lang.String iconSelector, OrderedSet<java.lang.String> iconKeys, boolean isFleet, boolean fleetRoute, java.lang.String selID, java.util.TimeZone tmz, Account acct, User user, DateTime latestTime, double lastBattery, double lastSignal, double minProximityM)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DFT_MAX_PUSHPIN_LIMIT

public static final long DFT_MAX_PUSHPIN_LIMIT
See Also:
Constant Field Values

MAP_ESCAPE_HTML

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

MAP_ESCAPE_B64

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

MAPDATA_DEFAULT

public static final int MAPDATA_DEFAULT
See Also:
Constant Field Values

MAPDATA_XML

public static final int MAPDATA_XML
See Also:
Constant Field Values

MAPDATA_JSON

public static final int MAPDATA_JSON
See Also:
Constant Field Values

FORMAT_UNKNOWN

public static final int FORMAT_UNKNOWN
See Also:
Constant Field Values

FORMAT_CSV

public static final int FORMAT_CSV
See Also:
Constant Field Values

FORMAT_KML

public static final int FORMAT_KML
See Also:
Constant Field Values

FORMAT_XML

public static final int FORMAT_XML
See Also:
Constant Field Values

FORMAT_XMLOLD

public static final int FORMAT_XMLOLD
See Also:
Constant Field Values

FORMAT_TXT

public static final int FORMAT_TXT
See Also:
Constant Field Values

FORMAT_GPX

public static final int FORMAT_GPX
See Also:
Constant Field Values

FORMAT_JSON

public static final int FORMAT_JSON
See Also:
Constant Field Values

FORMAT_JSONX

public static final int FORMAT_JSONX
See Also:
Constant Field Values

FORMAT_BML

public static final int FORMAT_BML
See Also:
Constant Field Values

FORMAT_AEMP

public static final int FORMAT_AEMP
See Also:
Constant Field Values

SEPARATE_DATASET_PER_DEVICE

public static final boolean SEPARATE_DATASET_PER_DEVICE
See Also:
Constant Field Values

TAG_MapData

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

TAG_LastEvent

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

TAG_Time

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

TAG_DataColumns

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

TAG_DataSet

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

TAG_Point

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

TAG_Shape

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

TAG_Action

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

JSON_Error

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

JSON_Command

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

JSON_Account

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

JSON_User

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

JSON_Version

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

JSON_JMapData

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

JSON_Time

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

JSON_LastEvent

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

JSON_DataColumns

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

JSON_Data

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

JSON_Shapes

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

JSON_DataSets

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

JSON_Points

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

JSON_Actions

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

JSON_YMD

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

JSON_year

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

JSON_month

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

JSON_day

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

JSON_date

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

JSON_time

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

JSON_cmd

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

JSON_arg

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

JSON_type

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

JSON_radius

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

JSON_color

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

JSON_desc

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

JSON_ppNdx

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

JSON_route

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

JSON_routeColor

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

JSON_textColor

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

JSON_id

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

ATTR_isFleet

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

ATTR_type

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

ATTR_id

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

ATTR_route

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

ATTR_routeColor

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

ATTR_textColor

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

ATTR_timestamp

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

ATTR_timezone

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

ATTR_device

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

ATTR_year

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

ATTR_month

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

ATTR_day

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

ATTR_color

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

ATTR_desc

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

ATTR_ppNdx

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

ATTR_radius

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

ATTR_battery

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

ATTR_signal

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

ATTR_command

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

DSTYPE_device

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

DSTYPE_group

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

DSTYPE_poi

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

CSV_SEPARATOR_CHAR

public static final char CSV_SEPARATOR_CHAR
See Also:
Constant Field Values

TAG_Account

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

TAG_Device

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

TAG_EventData

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

TAG_Description

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

TAG_Event

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

TAG_Timestamp

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

TAG_StatusCode

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

TAG_GPSPoint

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

TAG_Speed

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

TAG_Heading

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

TAG_Altitude

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

TAG_Odometer

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

TAG_Geozone

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

TAG_Address

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

TAG_City

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

TAG_PostalCode

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

TAG_DigitalInputMask

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

TAG_DriverID

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

TAG_DriverMessage

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

TAG_EngineRPM

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

TAG_EngineHours

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

TAG_VehicleBatteryVolts

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

TAG_EngineCoolantLevel

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

TAG_EngineCoolantTemperature

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

TAG_EngineFuelUsed

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

ATTR_account

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

ATTR_epoch

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

ATTR_age

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

ATTR_units

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

ATTR_limit

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

ATTR_index

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

ATTR_code

public static final java.lang.String ATTR_code
See Also:
Constant Field Values
Method Detail

SetDefaultMapDataFormat

public static void SetDefaultMapDataFormat(int dftDataFmt)

GetDefaultMapDataFormat

public static int GetDefaultMapDataFormat()

IsXMLMapDataFormat

public static boolean IsXMLMapDataFormat(int mdf)

setOptionalEventFieldHandler

public static void setOptionalEventFieldHandler(EventUtil.OptionalEventFields oef)

getOptionalEventFieldHandler

public static EventUtil.OptionalEventFields getOptionalEventFieldHandler()

hasOptionalEventFieldHandler

public static boolean hasOptionalEventFieldHandler()

parseOutputFormat

public static int parseOutputFormat(java.lang.String fmt,
                                    int dftFmt)

getInstance

public static EventUtil getInstance()

getParseMapEventJS

public java.lang.String getParseMapEventJS(boolean isFleet,
                                           java.util.Locale locale)

getParseMapEventJS

public java.lang.String getParseMapEventJS(boolean isFleet,
                                           java.util.Locale locale,
                                           char csvSep)

formatMapEvent

public java.lang.String formatMapEvent(BasicPrivateLabel privLabel,
                                       EventDataProvider edp,
                                       java.lang.String iconSelector,
                                       OrderedSet<java.lang.String> iconKeys,
                                       boolean isFleet,
                                       int stoppedState,
                                       java.util.TimeZone tmz,
                                       java.lang.String dateFmt,
                                       java.lang.String timeFmt)

formatMapEvent

public java.lang.String formatMapEvent(BasicPrivateLabel privLabel,
                                       EventDataProvider edp,
                                       java.lang.String iconSelector,
                                       OrderedSet<java.lang.String> iconKeys,
                                       boolean isFleet,
                                       int stoppedState,
                                       java.util.TimeZone tmz,
                                       java.lang.String dateFmt,
                                       java.lang.String timeFmt,
                                       char csvSep)

writeMapEvents

public boolean writeMapEvents(int dataFmt,
                              int indentLevel,
                              java.io.PrintWriter pwout,
                              boolean isSoapRequest,
                              boolean isTopLevelTag,
                              BasicPrivateLabel privLabel,
                              EventDataProvider[] edp,
                              boolean includeShapes,
                              java.lang.String iconSelector,
                              OrderedSet<java.lang.String> iconKeys,
                              boolean isFleet,
                              boolean fleetRoute,
                              java.lang.String selID,
                              java.util.TimeZone tmz,
                              Account acct,
                              User user,
                              DateTime latestTime,
                              double lastBattery,
                              double lastSignal,
                              double minProximityM)
                       throws java.io.IOException
Throws:
java.io.IOException

writeMapEvents_xml

public boolean writeMapEvents_xml(int indentLevel,
                                  java.io.PrintWriter pwout,
                                  boolean isSoapRequest,
                                  boolean isTopLevelTag,
                                  BasicPrivateLabel privLabel,
                                  EventDataProvider[] edp,
                                  boolean includeShapes,
                                  java.lang.String iconSelector,
                                  OrderedSet<java.lang.String> iconKeys,
                                  boolean isFleet,
                                  boolean fleetRoute,
                                  java.lang.String selID,
                                  java.util.TimeZone tmz,
                                  Account acct,
                                  User user,
                                  DateTime latestTime,
                                  double lastBattery,
                                  double lastSignal,
                                  double minProximityM)
                           throws java.io.IOException
Throws:
java.io.IOException

getJMapData_JSON

public JSON._Object getJMapData_JSON(BasicPrivateLabel privLabel,
                                     EventDataProvider[] edp,
                                     boolean includeShapes,
                                     java.lang.String iconSelector,
                                     OrderedSet<java.lang.String> iconKeys,
                                     boolean isFleet,
                                     boolean fleetRoute,
                                     java.lang.String selID,
                                     java.util.TimeZone tmz,
                                     Account acct,
                                     User user,
                                     DateTime latestTime,
                                     double lastBattery,
                                     double lastSignal,
                                     double minProximityM,
                                     java.util.Collection<java.lang.String> actions,
                                     char csvSep)

writeEvents_JSON

public boolean writeEvents_JSON(java.io.PrintWriter pwout,
                                Account account,
                                java.util.Collection<Device> devList,
                                boolean allTags,
                                java.util.TimeZone dispTmz,
                                BasicPrivateLabel privLabel)
                         throws java.io.IOException
Throws:
java.io.IOException

writeEvents

public boolean writeEvents(java.io.OutputStream out,
                           Account account,
                           java.util.Collection<Device> devList,
                           int formatEnum,
                           boolean allTags,
                           java.util.TimeZone tmz,
                           BasicPrivateLabel privLabel)
                    throws java.io.IOException
Throws:
java.io.IOException

writeEvents

public boolean writeEvents(java.io.PrintWriter pwout,
                           Account account,
                           java.util.Collection<Device> devList,
                           int formatEnum,
                           boolean allTags,
                           java.util.TimeZone dispTmz,
                           BasicPrivateLabel privLabel)
                    throws java.io.IOException
Throws:
java.io.IOException

openFileOutputStream

public static java.io.OutputStream openFileOutputStream(java.lang.String outFile)

closeOutputStream

public static void closeOutputStream(java.io.OutputStream out)

main

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